From: Roby Gamboa
Subject: Absolute/Physical addressing in Lisp?
Date: 
Message-ID: <3A87662E.C22B274B@firstworld.net>
Hi, folks:

I'm fairly seasoned in software engineering in C/C++ and Java, but
relatively new to Lisp and Scheme. I was wondering if there was a way to
provide an interface from a Lisp application into the direct memory
access or physical addressing scheme of the underlying operating system.

The references that I have (Winston's 'Lisp, 3rd ed.' and Graham's 'ANSI
Common Lisp'), plus several online references lead me to believe that,
if supported, they would have to be implemented as aliens, calling into
the underlying OS's memory management and physical device interface
code. Would this be a correct assumption?

If possible, pointers to representative samples would be great.

Thanks for any and all help.

Roby Gamboa
·······@firstworld.net

From: Ian Wild
Subject: Re: Absolute/Physical addressing in Lisp?
Date: 
Message-ID: <3A87AFCE.604656F8@cfmu.eurocontrol.be>
Roby Gamboa wrote:
> 
> Hi, folks:
> 
> I'm fairly seasoned in software engineering in C/C++ and Java, but
> relatively new to Lisp and Scheme. I was wondering if there was a way to
> provide an interface from a Lisp application into the direct memory
> access or physical addressing scheme of the underlying operating system.

I would have thought this impossible from /any/ language.  You
certainly can't directly access physical memory from C (or
even Java!) without getting a special licence from the OS.


> The references that I have (Winston's 'Lisp, 3rd ed.' and Graham's 'ANSI
> Common Lisp'), plus several online references lead me to believe that,
> if supported, they would have to be implemented as aliens, calling into
> the underlying OS's memory management and physical device interface
> code. Would this be a correct assumption?

Let's hope so, otherwise OS reliability goes down the lavvy.
From: Barry Margolin
Subject: Re: Absolute/Physical addressing in Lisp?
Date: 
Message-ID: <VTSh6.14$QE.6252@burlma1-snr2>
In article <·················@cfmu.eurocontrol.be>,
Ian Wild  <···@cfmu.eurocontrol.be> wrote:
>Roby Gamboa wrote:
>> 
>> Hi, folks:
>> 
>> I'm fairly seasoned in software engineering in C/C++ and Java, but
>> relatively new to Lisp and Scheme. I was wondering if there was a way to
>> provide an interface from a Lisp application into the direct memory
>> access or physical addressing scheme of the underlying operating system.
>
>I would have thought this impossible from /any/ language.  You
>certainly can't directly access physical memory from C (or
>even Java!) without getting a special licence from the OS.

Read between the lines -- he obviously means the virtual memory system.

Most Lisps have implementation-dependent "subprimitives" that allow you to
construct pointers with arbitrary values.

-- 
Barry Margolin, ······@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Ian Wild
Subject: Re: Absolute/Physical addressing in Lisp?
Date: 
Message-ID: <3A880072.A1E6C233@cfmu.eurocontrol.be>
Barry Margolin wrote:
> 
> In article <·················@cfmu.eurocontrol.be>,
> Ian Wild  <···@cfmu.eurocontrol.be> wrote:

> >...certainly can't directly access physical memory from C (or
> >even Java!) without getting a special licence from the OS.
> 
> Read between the lines -- he obviously means the virtual memory system.

Really?  He claims to be "fairly seasoned in software engineering" and
talks about the "physical device interface".  Doesn't sound to me like
he's looking at virtual memory.
From: Cesar Rabak
Subject: Re: Absolute/Physical addressing in Lisp?
Date: 
Message-ID: <3A8848D9.EF4A3ABB@uol.com.br>
Ian Wild wrote:
[snipped]
> 
> I would have thought this impossible from /any/ language.  You
> certainly can't directly access physical memory from C (or
> even Java!) without getting a special licence from the OS.
> 

OK, but once this policy/administrative issue is settled, is there a way
in Lisp.

My understanding is that the OP thinks of accessing physical addresses
to use a special control board in his system, for example.
From: Barry Margolin
Subject: Re: Absolute/Physical addressing in Lisp?
Date: 
Message-ID: <hUXh6.25$QE.7792@burlma1-snr2>
In article <·················@uol.com.br>,
Cesar Rabak  <·······@uol.com.br> wrote:
>Ian Wild wrote:
>[snipped]
>> 
>> I would have thought this impossible from /any/ language.  You
>> certainly can't directly access physical memory from C (or
>> even Java!) without getting a special licence from the OS.
>> 
>
>OK, but once this policy/administrative issue is settled, is there a way
>in Lisp.
>
>My understanding is that the OP thinks of accessing physical addresses
>to use a special control board in his system, for example.

In Unix-like operating systems, it's typically implemented using a device
driver, which you access by opening a device special file.  Lisp can open
files and read/write bytes.

-- 
Barry Margolin, ······@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Pierre R. Mai
Subject: Re: Absolute/Physical addressing in Lisp?
Date: 
Message-ID: <87itmfczoe.fsf@orion.bln.pmsf.de>
Barry Margolin <······@genuity.net> writes:

> In article <·················@uol.com.br>,
> Cesar Rabak  <·······@uol.com.br> wrote:
> >Ian Wild wrote:
> >[snipped]
> >> 
> >> I would have thought this impossible from /any/ language.  You
> >> certainly can't directly access physical memory from C (or
> >> even Java!) without getting a special licence from the OS.
> >> 
> >
> >OK, but once this policy/administrative issue is settled, is there a way
> >in Lisp.
> >
> >My understanding is that the OP thinks of accessing physical addresses
> >to use a special control board in his system, for example.
> 
> In Unix-like operating systems, it's typically implemented using a device
> driver, which you access by opening a device special file.  Lisp can open
> files and read/write bytes.

Other possibilities include:

- The OS allows you to cause the device space to be mapped into your
  process's address space.  Many CL implementations will then allow
  you to access such memory using either sub-primitive operators
  and/or alien interfacing functions.

- The OS allows you to access certain (previously arranged) ranges of
  device space using the architectures device-IO operations.  Many CL
  implementations will allow you to emit machine-code instructions of
  your choice, possibly using the built-in assembler.

In any case the details will vary between CL implementations and/or
platforms.

Regs, Pierre.

-- 
Pierre R. Mai <····@acm.org>                    http://www.pmsf.de/pmai/
 The most likely way for the world to be destroyed, most experts agree,
 is by accident. That's where we come in; we're computer professionals.
 We cause accidents.                           -- Nathaniel Borenstein