954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Operating System in Python

Is it possible to write a full blown operating system (such as Linux) in Python? I mean writing a kernal, and then other applications that the kernal calls, without having Windows, Linux, UNIX, or Macintosh OS installed on your computer?

linux
Posting Shark
933 posts since Aug 2006
Reputation Points: 118
Solved Threads: 30
 

Yes, there is a devlopment of a full featured GUI Operating System written in Python under the name Unununium (wouldn't be my choice), nicknamed after the 111th chemical element 'Roentgenium', whose temporary IUPAC name until November 2004 was 'Unununium'. See:
http://en.wikipedia.org/wiki/Unununium_(operating_system )

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

the link doesn't work

Ancient Dragon
Retired & Loving It
Team Colleague
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

More information on Unununium Python based OS, also kindly known as UUU, can be had at:
http://unununium.org/introduction

Ene Uran
Posting Virtuoso
1,723 posts since Aug 2005
Reputation Points: 625
Solved Threads: 213
 
LaMouche
Posting Whiz in Training
269 posts since Oct 2006
Reputation Points: 83
Solved Threads: 39
 

The info on the links is not encouraging: "very little code was written in 2005, and 2006 doesn't look much better." Hmm...

My mildly informed $0.02, for the purpose of generating lively discussion: I don't think a true OS can be written in Python, for the following reason: Python requires memory management to work behind the scenes. But, memory management requires an OS or a virtual machine to keep track of which memory blocks are stale and need to be garbage-collected. Hence, Python will always be dependent on an OS in order to function, even if the Python code is turned into C and thence into an executable.

Agree? Disagree?

Jeff

jrcagle
Practically a Master Poster
608 posts since Jul 2006
Reputation Points: 92
Solved Threads: 156
 

According to my engineering professor, the reason there is a variety of computer languages is that each language (at least the popular once) was written for a purpose. Python was not written to make Operating Systems, but C was (for Unix). So it would be a little silly to use Python.

sneekula
Nearly a Posting Maven
2,427 posts since Oct 2006
Reputation Points: 961
Solved Threads: 212
 

This should be worth a wooden nickel, I understand UUU uses C for the low level stuff and Python for the Windoze stuff. This way the memory manager should not be much of an obstacle. Will it ever get off the ground? I don't know.

I have the hunch that C had to rely on a bit of assembly code when the Unix OS was written.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 
I have the hunch that C had to rely on a bit of assembly code when the Unix OS was written.

Yep.

jrcagle
Practically a Master Poster
608 posts since Jul 2006
Reputation Points: 92
Solved Threads: 156
 

Sure Python requires memory management, but if you provide a bare-metal type OS beneath the interpreter, somewhat like how BIOS provides a compatibility layer, then you could set out to write an OS that's extremely heavily implemented with Python. Still, doing so would require an intimate understanding of the plumbing of the Python Interpreter.

If one could develop this compatibility layer with a regard to cross-platform support, if implemented thoughtfully, then for each distinct architecture, one would have to write the lowest-level support layer and then could import most/all functionality of the rest of the system. At least, in the general case. Developing something like this would completely rock.

docdawning
Newbie Poster
3 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

Sure Python requires memory management, but if you provide a bare-metal type OS beneath the interpreter, somewhat like how BIOS provides a compatibility layer, then you could set out to write an OS that's extremely heavily implemented with Python. Still, doing so would require an intimate understanding of the plumbing of the Python Interpreter.

If one could develop this compatibility layer with a regard to cross-platform support, if implemented thoughtfully, then for each distinct architecture, one would have to write the lowest-level support layer and then could import most/all functionality of the rest of the system. At least, in the general case. Developing something like this would completely rock.


In extreme programming, there is a useful paradigm:you aren't gonna need it. That's probably the best thing to say about your python OS: you aren't gonna need it. So if you want to develop something, do something useful instead :)

( see also this link )

Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
 

In extreme programming, there is a useful paradigm: you aren't gonna need it. That's probably the best thing to say about your python OS: you aren't gonna need it. So if you want to develop something, do something useful instead :)

( see also this link )

Generally I'd totally agree, but this isn't a pragmatic discussion. XP is awesome for balancing resources to get immediate results. But in the major long run, additional more structured design paradigms shine.

docdawning
Newbie Poster
3 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

Here's one of my favorite sayings. "Can it be done? Yes. Will it be done? No." I don't think it's necessary.

AutoPython
Junior Poster
138 posts since Sep 2009
Reputation Points: 14
Solved Threads: 18
 

In the end all your computer understand is machine code, it does not care if you used C, Assembly, Java, python or qbasic.

The main problem with making a OS in python, is that it need alot of conversion to turn to machine code and that takes time crucial for function that must be performed in a fraction of second. Speed is the main issue.

I think that projects like Cython, can take python closer to that direction.

http://www.cython.org/

What Cython does is that it permits you to write pure python code but also use C/C++ features like static typing , pointers , manual memory management etc. to boost speed up to C speed . Then code is automatically converted to c code which can be compiled like any c code. Benchmarks on Cython show that it perfromes from 30% slower than C to 30% faster (more often slower though).

And Cython is not the only thing, it comes from Pyrex. And for those that have been using Puppylinux they may have heard of Genie , a python kind of language that is compiled.

http://puppylinux.org/wikka/ValaGenieintro

Genie like Vala are children of the gnome framework

http://live.gnome.org/Genie

So it seems that there surely motivation.

The question remains of course why we need a python OS ... I think that has been already answered with Linux Because it much easier to maintain and write code for. In Linux python started for very simple scrips and now moves to lower and lower levels , slowly but progressively.

And the fact that projects like Cython are supported by mighty companies like Google. Its clear that loads of programmers do want to replace C with python . Its not a easy task , it wont happen tomorrow, but it certainly move toward this direction.

Its no longer a question if it will happen , it is a question of when it will happen.

thekilon
Newbie Poster
23 posts since Jan 2009
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You