Python Operating System???

D

David Brown

Hello. I recently came across a free operating system called Unununium (or
something like that) and it was developed in Python and Assembly.

Now, I have been looking for a way to make an operating system for a long
long time and the only possibilities I could find were C++ and assembly. I
don't mind assembly so much if I don't have to use it very often. But C++ is
so complicated and errors are pretty much impossible to find in the code for
me.

So, I was wondering if it would be possible to find a bootloader that loads
a python file at startup or something...

Is there an example somewhere of a Python OS?

Thanks!
 
L

Lucas Raab

David said:
Hello. I recently came across a free operating system called Unununium (or
something like that) and it was developed in Python and Assembly.

Now, I have been looking for a way to make an operating system for a long
long time and the only possibilities I could find were C++ and assembly. I
don't mind assembly so much if I don't have to use it very often. But C++ is
so complicated and errors are pretty much impossible to find in the code for
me.

So, I was wondering if it would be possible to find a bootloader that loads
a python file at startup or something...

Is there an example somewhere of a Python OS?

Thanks!

Hasn't there been numerous discussions about this in the past??
 
A

Arich Chanachai

David said:
Hello. I recently came across a free operating system called Unununium (or
something like that) and it was developed in Python and Assembly.

Now, I have been looking for a way to make an operating system for a long
long time and the only possibilities I could find were C++ and assembly. I
don't mind assembly so much if I don't have to use it very often. But C++ is
so complicated and errors are pretty much impossible to find in the code for
me.

So, I was wondering if it would be possible to find a bootloader that loads
a python file at startup or something...

Is there an example somewhere of a Python OS?

Thanks!
People don't make Python OSs because it's a serious pain in the
Deng-Xiao-ping. J/k, I am half kidding. Go to google groups, and
search for Python OS. You will find that this topic has been discussed
numerous times. There was another project other than Unununium which
was Python based, but it is not being developed any longer and I fail to
remember what it was called. So search away, you will find many
results! Alternatively you could contact the Unununium folks for help.

Note also that there are Java OSs as well (and probably others). But
then again, if you don't like C++, you probably won't like Java. They
can be very different languages, but in my experience, the reasons why
one does not like C++ is usually due to a quality/flaw that can also be
found in Java.
 
C

Carl Banks

Arich said:
But
then again, if you don't like C++, you probably won't like Java. They
can be very different languages, but in my experience, the reasons why
one does not like C++ is usually due to a quality/flaw that can also be
found in Java.

Oh, brother.

The Zen of Python says that "simple is better than complex" and
"complex is better than complicated". Java does pretty well here. C++
didn't even get "complicated is better than convoluted" right. There's
are a ton of flaws in C++ not found in Java.
 
F

Fuzzyman

The bootloader would have to be a 'python-core'. Ideally a fast
implementation of just the python syntax and language features. Now
*that* would be an excellent basis for a restricted mode python
interpreter - which could make 'python applets' closer to a reality. It
would also make python for embedded systems and embedding python in
larger programs easier as well. A purely 'core language' implementation
with no libraries.....

Obviously you'd need file systems, drivers, and something to create the
functionality of the os and sys libraries. Basing it on the existing
Linux kernel would seem like a much more sensible idea....

There is/was a project (Peter Hansen ?) to produce a pure python file
system. that could be an interesting component.

Regards,

Fuzzy
http://www.voidspace.org.uk/python/index.shtml
 
C

Christopher Koppler

Oh, brother.

The Zen of Python says that "simple is better than complex" and
"complex is better than complicated". Java does pretty well here. C++
didn't even get "complicated is better than convoluted" right. There's
are a ton of flaws in C++ not found in Java.

Still, Java feels like C++ done right, while being more wrong >:-[
 
R

Roose

What exactly do you mean by an operating system?

If you don't want to program in C/C++ then you're going to have a hard time.
I don't want to be too discouraging, but with that attitude I doubt you
would get very far.

It sounds like you want to make more of an OS shell -- no? You can
implement a shell on top of any OS and probably do it in a language like
Python.

But if it is going to be a complete OS in pure Python, uh, it won't be!
You'll have to do a lot of stuff in C, at the least interface with the
hardware.
 
P

Peter Hansen

Fuzzyman said:
There is/was a project (Peter Hansen ?) to produce a pure python file
system. that could be an interesting component.

Good memory... uh, sort of. :) It was probably me you're
thinking of, but the point of the project was solely a
"virtual" file system, to be used exclusively as a tool
for supporting automated testing. It has no concept of
persistence, no support for it in the design, and wouldn't
be what would help anyone in this respect. Sorry.

(Work on it has actually not progressed lately, because
there is no additional requirement driving the work.
The primitive initial state of the tool suffices so far.)

-Peter
 
A

Arich Chanachai

Roose said:
What exactly do you mean by an operating system?

If you don't want to program in C/C++ then you're going to have a hard time.
I don't want to be too discouraging, but with that attitude I doubt you
would get very far.
Indeed, this is very true.
It sounds like you want to make more of an OS shell -- no? You can
implement a shell on top of any OS and probably do it in a language like
Python.
He should just build around a linux core or use OS kit (if he is
serious/determined).
But if it is going to be a complete OS in pure Python, uh, it won't be!
You'll have to do a lot of stuff in C, at the least interface with the
hardware.
He could use something like O' caml or Oz no? I might be confused, but
I understood them to be C/C++ comparable in terms of power and in that
they both compile vs. VMs and interpreters (for O' caml this is optional
I think). Or what about D?
 
J

John Roth

David Brown said:
Hello. I recently came across a free operating system called Unununium (or
something like that) and it was developed in Python and Assembly.

Now, I have been looking for a way to make an operating system for a long
long time and the only possibilities I could find were C++ and assembly. I
don't mind assembly so much if I don't have to use it very often. But C++
is
so complicated and errors are pretty much impossible to find in the code
for
me.

So, I was wondering if it would be possible to find a bootloader that
loads
a python file at startup or something...

Is there an example somewhere of a Python OS?

As far as I know, there's no working example. Unununium is still
very early development, and it's going off in a quite interesting
direction that is hardly standard.

Writing an operating system is a lot of work. The approach I'd
take would be to start out with an existing micro-kernel and
enhance it with a kernel level Python system so that you wouldn't
need any C or Asm level code in a typical process.

Then I'd pursue a restricted subset of Python that could be
compiled directly to machine code, and start recoding the
various C and Asm parts in that. See the PyPy project for
the direction they're taking for writing the Python system in
Python.

Have fun with the project!

John Roth
 
N

Nick Vargish

Arich Chanachai said:
He should just build around a linux core or use OS kit (if he is
serious/determined).

There's Ubuntu Linux, a Debian-based distro with commercial backing
and a regular release schedule. One of the neat things about Ubuntu is
that Python use is encouraged. "Python scripting everywhere" is a
stated goal, and they have a number of bounties that concentrate on
deepening the use of Python in the OS:

http://www.ubuntulinux.org/community/bounties

I've been using it on a couple of desktops, and I've been impressed by
the overall quality of the distro. One thing I especially like is that
the root account is disabled by default, administrative tasks are
performed with sudo by users in the appropriate group (much like it is
in Mac OS X 10.3).

Nick
 
S

Stephen Kellett

Christopher said:
Still, Java feels like C++ done right, while being more wrong >:-[

Couldn't disagree more. Just about anything you want to do that is
low-level, is impossible in Java. Anyway this is off-topic.

Stephen
 
M

Michael Hobbs

David Brown said:
Hello. I recently came across a free operating system called Unununium (or
something like that) and it was developed in Python and Assembly.

Now, I have been looking for a way to make an operating system for a long
long time and the only possibilities I could find were C++ and assembly.

The problem when using Python instead of C for OS development is that
C was *specifically designed* to create an OS, while Python was designed
for completely different purposes. If you want to write an OS, it would
be wise to use a language that is suited for that purpose. If you
dislike C so much and prefer Python so much more, your first step should
be to design a Python dialect that is more appropriate for writing OS's.

(I know that you mentioned C++, not C, but I decided to setup C as a
straw-man to make my argument.)

- Mike
 
P

Paul Rubin

The problem when using Python instead of C for OS development is that
C was *specifically designed* to create an OS, while Python was designed
for completely different purposes. If you want to write an OS, it would
be wise to use a language that is suited for that purpose. If you
dislike C so much and prefer Python so much more, your first step should
be to design a Python dialect that is more appropriate for writing OS's.

But I thought Python was an all-purpose language. After all, OS's
have been written in Lisp before too.
 
B

Bengt Richter

The problem when using Python instead of C for OS development is that
C was *specifically designed* to create an OS, while Python was designed
for completely different purposes. If you want to write an OS, it would
be wise to use a language that is suited for that purpose. If you
dislike C so much and prefer Python so much more, your first step should
be to design a Python dialect that is more appropriate for writing OS's.

(I know that you mentioned C++, not C, but I decided to setup C as a
straw-man to make my argument.)
I'd say look at Ada for HLL inspiration, if you want to deal with OS level stuff
in Python.

Regards,
Bengt Richter
 
A

Arich Chanachai

Paul said:
(e-mail address removed) (Michael Hobbs) writes:



But I thought Python was an all-purpose language. After all, OS's
have been written in Lisp before too.
Pure Lisp? Or a Lisp/C/Asm combo? Lisp has a compiled flavor by the way.
 
P

Paul Rubin

Arich Chanachai said:
Pure Lisp? Or a Lisp/C/Asm combo? Lisp has a compiled flavor by the way.

Compiled flavor? Lisp has been compiled since the 1950's.

No, there was no C code on Lisp machines. There was some low-level
code at the bottom whose capabilities were such that you could
accurately call it asm, but it was Lisp too, just a very restricted
form.
 
R

Roose

Michael Hobbs said:
The problem when using Python instead of C for OS development is that
C was *specifically designed* to create an OS, while Python was designed
for completely different purposes. If you want to write an OS, it would
be wise to use a language that is suited for that purpose. If you
dislike C so much and prefer Python so much more, your first step should
be to design a Python dialect that is more appropriate for writing OS's.

Yes, that sounds pretty realistic : ) For someone who is choosing the wrong
language to write an OS, and who I would guess doesn't understand interrupt
programming and the like -- their first task should be to redesign Python!!
 
R

Roose

But I thought Python was an all-purpose language. After all, OS's
have been written in Lisp before too.

It is a general purpose APPLICATION language. I am surprised that this
hasn't been mentioned on this thread.

An OS is NOT an application. It is a completely different kind of program.
Do you guys understand the difference between user and kernel mode? Do you
know what address spaces and hardware interrupts are? Python is not
equipped to handle these things. You would end up doing so much in C
extensions that it could barely be called Python.

I am not trying to be insulting... but unless someone would like to educate
me otherwise, the idea of an OS written in Python is almost ludicrous. As I
said, I think you might mean an OS SHELL, which would be a reasonable
(although maybe unconventional) thing to write in python.

Also I am no threading expert, but I would imagine it would be very hard to
write a task scheduler in Python given that it has the whole GIL thing. (As
I said that isn't my domain of expertise but I'm sure someone here could
expound on that.)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,202
Latest member
MikoOslo

Latest Threads

Top