Python Operating System

Discussion in 'Python' started by PythonUsr, Dec 10, 2006.

  1. PythonUsr

    PythonUsr Guest

    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)
    PythonUsr, Dec 10, 2006
    #1
    1. Advertising

  2. 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/academic/product/0,1144,0131429388,00.html

    Diez
    Diez B. Roggisch, Dec 10, 2006
    #2
    1. Advertising

  3. Richard Jones, Dec 11, 2006
    #3
  4. 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
    Diez B. Roggisch, Dec 11, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vasanth
    Replies:
    0
    Views:
    540
    Vasanth
    Jun 28, 2004
  2. Steven Cheng[MSFT]
    Replies:
    4
    Views:
    4,319
    Steven Cheng[MSFT]
    May 13, 2004
  3. Karunakararao
    Replies:
    0
    Views:
    640
    Karunakararao
    May 11, 2004
  4. =?Utf-8?B?U3JlZQ==?=
    Replies:
    1
    Views:
    344
    Ken Cox [Microsoft MVP]
    May 31, 2004
  5. David Brown

    Python Operating System???

    David Brown, Jan 6, 2005, in forum: Python
    Replies:
    54
    Views:
    1,355
Loading...

Share This Page