By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,795 Members | 1,761 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,795 IT Pros & Developers. It's quick & easy.

Python Operating System

P: n/a
Although I know for a fact that an Operating System can be written in
Python, I need to ask some questions to the more advanced users of
Python.

Uuu and Cleese are two operating systems that were / are written in
Python. Does anyone use them? If so, how do they function / feel? Do
they have a graphical mode and a command line mode, such as Linux does?

How hard would it be to write a full blown bootable operating system in
Python? With a command line and a GUI in all? Would the books you see
on the shelves at, say, Barnes and Noble, do the trick? Or do you need
to dig deeper into the language than what is taught in the 1,000 page
books?

Thanks in advance, and I am truly sorry if this has been a discussion
before in this group!

-- Alex (PythonUsr)

Dec 10 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
PythonUsr schrieb:
Although I know for a fact that an Operating System can be written in
Python, I need to ask some questions to the more advanced users of
Python.

Uuu and Cleese are two operating systems that were / are written in
Python. Does anyone use them? If so, how do they function / feel? Do
they have a graphical mode and a command line mode, such as Linux does?

How hard would it be to write a full blown bootable operating system in
Python? With a command line and a GUI in all? Would the books you see
on the shelves at, say, Barnes and Noble, do the trick? Or do you need
to dig deeper into the language than what is taught in the 1,000 page
books?
There are limits to what Python can do as a language for OS development.
For example, Python has no notion of pointers and thus makes
writing interrupt routines impossible, which are the base for nearly all
lower level OS tasks like IO-drivers, memory virtualization and the like.

What these projects are more like is a bootable interpreter on a minimal
OS kernel. At least in my book that doesn't count as an operating
system, but here definitions might vary. Yet it certainly isn't a
general purpose OS, as no binary interfaces to OS services are defined
that would make calls from other languages into the OS possible.

In other words: IMHO, it is _not_ possible to write an OS in Python, at
least not if OS is understood the way current OSses work. And even if
the definition is stretched, there is a more than fair amount of work
that needs to be done in other languages, most likely C - either because
Pyhon isn't capable of doing them at all, or just not fast enough to do
them proper.

Regarding the books to read: this kind of programming isn't so much
about the details of python, albeit some of its inner workings like the
GIL put up quite a few hurdles for the aspiring OS programmer, but of OS
concepts and designs. Which is a field Andrew Tanenbaum has earned quite
a few merits, so I guess his book could be a starter:

http://vig.prenhall.com/catalog/acad...429388,00.html

Diez
Dec 10 '06 #2

P: n/a
Diez B. Roggisch wrote:
Python has no notion of pointers
See:

http://docs.python.org/lib/module-ctypes.html

In particular:

http://docs.python.org/lib/ctypes-pointers.html
Richard

Dec 11 '06 #3

P: n/a
Richard Jones schrieb:
Diez B. Roggisch wrote:
>Python has no notion of pointers

See:

http://docs.python.org/lib/module-ctypes.html

In particular:

http://docs.python.org/lib/ctypes-pointers.html
Certainly cool, yet not too helpful for writing an interrupt handler
that needs to run lightning fast & without prior GIL acquisition.

Also PyPy with RPython might someday add much to the low-level
programming capabilities, but a pure Python OS isn't feasible IMHO right
now.

Diez
Dec 11 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.