Reimplenting Linux Kernel in Python

Michael Hobbs mike at
Thu Oct 14 17:15:34 CEST 2004

Maboroshi <nobody at> wrote:
> My question has to do with python and linux - I was interested in 
> finding out what it would take to reimplement the Linux Kernel in python 
> basically just taking the source code from linux and rewriting it in 
> python Would this idea make sense to do - if so what would be the 
> benefits of doing this and in what way would this not be a good idea

I had once given serious thought to what it would take to write an OS only
in a high-level language. (Standard ML was my language of choice at the
time.) The short answer is, no, it can't be done with Python as it currently

First, you would need a Python compiler that can compile Python programs to 
machine code. Otherwise, what would you write your interpreter in? Python?
What would you write the interpreter's interpreter in? It can't be Python
all the way down. (Turtles are a different story, though. ;)

Second, in order to communicate with hardware, you would need modifications 
to the Python language so that you can read and write bytes to specific
memory locations. You would also need to be able to signal interrupts. Plus,
you would also need to be able get the exact memory location of functions,
in order register interrupt handlers.

-- Michael Hobbs

More information about the Python-list mailing list