Python Operating System???

Bengt Richter bokr at oz.net
Sat Jan 8 21:49:35 EST 2005


On Sat, 08 Jan 2005 12:47:52 -0500, Peter Hansen <peter at engcorp.com> wrote:

>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...
Well, usually there's more than one tool in the chain from source
to bootable loader and OS image, even if you are writing in C and assembler,
and there's usually more to an OS than the bootable image contains.

So ISTM "writing an OS in <language>" is pretty loose talk ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list