Python Operating System???
Arich Chanachai
macrocosm at fastmail.fm
Sat Jan 8 13:27:48 EST 2005
Peter Hansen 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.
*nods*
>
> 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).
If my memory serves me, you are entirely correct.
>
> 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.
*nods*
>
> 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.
*nods*
>
> 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
Indeed indeed. Once must remain focused and ask oneself what he/she is
attempting to achieve. In all likelihood, a little asm/c/python glue
work won't hurt the objective, especially given that doing otherwise
would entail a very _low level_ reworking of Python that would take as
much and likely more effort and skill than to resort to asm/c when
Python falls incapable. One could do a Python-Lisp OS w/ Lisp used for
the Python incapable areas, but you would near entirely loose the
benefits of Lisp in that respect--- it would have to be so low-level,
could you call it Lisp? (A question someone else here posed in this
thread.)
- Arich
More information about the Python-list
mailing list