Python Operating System???

Peter Hansen peter at engcorp.com
Sat Jan 8 12:47:52 EST 2005


Paul Rubin wrote:
> When Unix was first written, people thought implementing an OS in C
> was ludicrous.  Everyone knew OS's had to be written in assembler.

Actually, when Unix was first written that belief was entirely
correct, and OSes *did* have to be written in assembler.

That is, pure C did not have the capability to handle all
that was required.  I recall it taking a good decade before it
became *common* to find C compilers with, for example, @interrupt
support to let the compiler generate code that properly saved
all registers and used RTI instead of RTS (or whatever it might
have been called one one's particular flavour of CPU).

Now, once you added a few tiny interrupt handlers, and some context
switching (stack manipulation) routines, pretty much everything else
*could* be done in C, but that doesn't invalidate the point.

I think it's safe to say that none of pure C, pure Lisp, or pure Python
are really capable of being used as the *sole* language to build
an operating system.

It's also safe to say that this is a largely irrelevant point.
It would probably only be of academic interest to try to do
something like that.  Any practical attempt would not think more
than twice of resorting to a little "glue" in assembler or in
the form of "canned" byte sequences built by hand and stuck
into the appropriate places in memory...

-Peter



More information about the Python-list mailing list