Page 1 of 1

OS Kernel in Python?

Posted: Wed Nov 21, 2001 10:23 am
by JoshuaHornDE
Hello,

Is it possible to write an OS kernel in Python? If you don't know what Python is, http://www.python.org. (Python & Basic being all that I know) I am unhappy with my current project, which turns to be more of a shell than a real OS kernel.  ???

Re: OS Kernel in Python?

Posted: Thu Nov 22, 2001 3:50 am
by Ranieri
The problem with kernel code is that it cannot have any dependence on ANYTHING. This means for example it cannot use the standard c library (unless you provide one explicitly).
In the case of python (or perl, or Java) the case is complicated further, as these languages are compiled into bytecode that is later interpreted. This means that you are dependent on the bytecode interpreter.

In a nutshell, python programs can only run if you are on a platform where the python interpreter can run.
If you were to try and make as much as possible in Python you would need to try and make a small kernel in assembler/c or similar that provides enough functionality for the bytecode interpreter to run.

In other words, it's not worth the effort.

Re: OS Kernel in Python?

Posted: Thu Nov 22, 2001 7:45 am
by Fredrick
So, basically, If a kernel was produced in Python, it would have to have it's interpreter to run.


My prob. is when I'm writing this kinda stuff (kernels) I never know what to do first!

Re: OS Kernel in Python?

Posted: Thu Nov 22, 2001 10:01 am
by mansonbound
you do that so often?

Re: OS Kernel in Python?

Posted: Thu Dec 06, 2001 5:41 am
by Charlie
Well, if you learnt a bit of assembler (ASM perhaps; the intel processor language base) then you could write a basic interpreter for Python, but that would take quite a while I suspect and quite a bit of expertise.

Re: OS Kernel in Python?

Posted: Sat Dec 15, 2001 3:37 am
by MiniOS
But, like winzip, it can create the executable code to interprete the code itself.

If we can use Python to create a kernel with the self-interprete code, I think it is possible to use Python to create a kernel.

I can't try. I never try to develop any OS