1,105,427 Community Members

Operating System in Python

Member Avatar
linux
Posting Shark
936 posts since Aug 2006
Reputation Points: 107 [?]
Q&As Helped to Solve: 34 [?]
Skill Endorsements: 0 [?]
 
0
 

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?

Member Avatar
vegaseat
DaniWeb's Hypocrite
6,984 posts since Oct 2004
Reputation Points: 1,544 [?]
Q&As Helped to Solve: 1,872 [?]
Skill Endorsements: 67 [?]
Moderator
 
0
 

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)

Member Avatar
Ancient Dragon
Achieved Level 70
27,632 posts since Aug 2005
Reputation Points: 5,232 [?]
Q&As Helped to Solve: 3,037 [?]
Skill Endorsements: 115 [?]
Team Colleague
Featured
Sponsor
 
0
 

the link doesn't work

Member Avatar
Ene Uran
Posting Virtuoso
1,822 posts since Aug 2005
Reputation Points: 610 [?]
Q&As Helped to Solve: 278 [?]
Skill Endorsements: 10 [?]
 
0
 

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

Member Avatar
Mouche
Posting Whiz in Training
291 posts since Oct 2006
Reputation Points: 63 [?]
Q&As Helped to Solve: 53 [?]
Skill Endorsements: 3 [?]
Featured
 
0
 

This works:
http://en.wikipedia.org/wiki/Unununium_(operating_system)

Member Avatar
jrcagle
Practically a Master Poster
608 posts since Jul 2006
Reputation Points: 77 [?]
Q&As Helped to Solve: 160 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
sneekula
Nearly a Posting Maven
2,496 posts since Oct 2006
Reputation Points: 917 [?]
Q&As Helped to Solve: 263 [?]
Skill Endorsements: 5 [?]
 
0
 

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.

Member Avatar
vegaseat
DaniWeb's Hypocrite
6,984 posts since Oct 2004
Reputation Points: 1,544 [?]
Q&As Helped to Solve: 1,872 [?]
Skill Endorsements: 67 [?]
Moderator
 
0
 

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.

Member Avatar
jrcagle
Practically a Master Poster
608 posts since Jul 2006
Reputation Points: 77 [?]
Q&As Helped to Solve: 160 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Yep.

Member Avatar
docdawning
Newbie Poster
3 posts since Nov 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

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.

Member Avatar
Gribouillis
Posting Maven
3,454 posts since Jul 2008
Reputation Points: 1,140 [?]
Q&As Helped to Solve: 884 [?]
Skill Endorsements: 18 [?]
Moderator
 
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)

Member Avatar
docdawning
Newbie Poster
3 posts since Nov 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
AutoPython
Junior Poster
142 posts since Sep 2009
Reputation Points: 4 [?]
Q&As Helped to Solve: 18 [?]
Skill Endorsements: 0 [?]
 
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.

Member Avatar
thekilon
Light Poster
26 posts since Jan 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
1
 

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.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article