Python OS

Diez B. Roggisch deetsNOSPAM at web.de
Sun Nov 7 15:55:27 EST 2004


> OS's have been written for VMs (LISP and Forth) that didn't have the
> notion of interrupt before they were built. For LISPMs, interrupt
> handlers are LISP objects (*). Java may not be as powerful as LISP,
> but I'm pretty sure you could turn interrupts into method invocations
> without having to extend the VM.

How so? An interrupt is a address the processor directly jumps to by
adjusting its PC. The JVM doesn't even have the idea of function pointers.
Invoking a (even static) method involves several lookups in dicts until the
actual code  pointer is known - and that's byte code then, not machine
code.

As your examples show, one can implement a VM ontop of a considederably thin
layer of low level code and expose hooks that allow for system
functionality to be developed in a high-level language running bytecode.
Fine. Never doubted that. I've written myself C-wrappings that allowed
python callables to be passed as callbacks to the C-lib - no black magic
there. But that took some dozen lines of C-code, and time-critical
interrupts won't work properly if you allow their code beeing implemented
in a notably slower language.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list