Direct memory & CPU access

David Goehrig dave at nexttolast.com
Tue Dec 13 13:48:31 UTC 2011


Last night I was playing around with adapting a simple compiler I've written for x86, PowePC, AVR32, and ARM to Self, and had code generation working nicely.

BUT the memory object gave me no way to poke my raw byte code to and address, and I had no obvious way to transfer that address to the instruction pointer of the CPU from within Self (short of extending the VM). At that point I decided sleep was more important and went to bed. 

The code this came from was a C program I used to bootstrap programs in the field, ship a new program in a lispy  language, and compile it to native, fork() then jump to the new code, and return the parent process to waiting for a new program.  For kicks one weekend, I wrote the main program loop in the lispy language, hand compiled the Linux & Mac OS calls to perform the read() and fork(), and had a self hosting system. 

Having a tethered environment wherein you can extend and break the SelfVM from inside self seems like it should already exist, so does anyone know if it does?  I would have thought that is a prerequisite for Klein. 

If we were to turn the glove inside out, maybe the problem is we don't have a low enough level of abstraction modeled in the current Self system (for memory, CPU, pci, etc) to make Klein simpler. 




-=-=- dave at nexttolast.com -=-=-



More information about the Self-interest mailing list