tornewuff / pycorn

An interpreted operating system written in Python.
GNU General Public License v3.0
66 stars 13 forks source link

Rapsberry Pi as target #6

Open piranna opened 11 years ago

piranna commented 11 years ago

Allow to compile and run Pycorn on the Rapsberry Pi board. I have in background since a lot of time to port PyMite to the Rapsberry Pi, but I don't have the time or the ARM knowledges to do it (but I was able to port it to x86 using QEmu , by the way :-) ).

Since my long term purpose was to develop a pure-Python OS over it just from drivers up to process scheudler (more or less the same that Pycorn long term purpose), it would be good to allow it to run over different platforms and interpreters, both for comparation purposes and interoperability.

Bouteillebleu commented 11 years ago

Torne's done some work on this - see https://github.com/tornewuff/pycorn/commit/f38b59305dc7b23b24fe69518359baabc6e29148 - although I think you need an actual Raspberry Pi, as there doesn't seem to be a qemu-system-arm target for the RasPi.

piranna commented 11 years ago

I have it, so that's no a problem ;-) There's also some QEmu configurations to emulate it on a PC on Internet and on the Rapsberry Pi forums, although doesn't seems to be easy (at least for me) :-( El 09/10/2013 23:39, "Bouteillebleu" notifications@github.com escribió:

Torne's done some work on this - see f38b593https://github.com/tornewuff/pycorn/commit/f38b59305dc7b23b24fe69518359baabc6e29148- although I think you need an actual Raspberry Pi, as there doesn't seem to be a qemu-system-arm target for the RasPi.

— Reply to this email directly or view it on GitHubhttps://github.com/tornewuff/pycorn/issues/6#issuecomment-26011295 .

tornewuff commented 11 years ago

It already works on a Pi; just set MACH to bcm2835 in config.mk and it'll build for it, though it doesn't have a qemu config so you can't "makepp run". Just running makepp will give you the kernel image to use on a real device.

Like the pxa270 port, however, the only driver is the boot serial console.

piranna commented 11 years ago

Like the pxa270 port, however, the only driver is the boot serial console.

Enough to start :-) Would be possible to update the readme to add this platforms?

Also, what's the Python VM being used? CPython? A custom one? It doesn't appear anywhere...

"Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton de sitios diferentes, simplemente escribe un sistema operativo Unix." – Linus Tordvals, creador del sistema operativo Linux

tornewuff commented 11 years ago

Yeah I should update the docs to explain exactly how to boot it on the Pi, sorry :)

It runs CPython, yes (currently 2.7.3 as I haven't been paying enough attention to update to 2.7.5) - I intend to move to CPython 3.3+ at some point but there's not much difference right now due to the tiny amount of python code implemented :)

Long-term it would be nice to use PyPy but it's not clear how difficult it is to get PyPy to run in a selfhosted environment and again, there's not any real difference/advantage at this stage.

piranna commented 11 years ago

[OffTopic]

It runs CPython, yes (currently 2.7.3 as I haven't been paying enough attention to update to 2.7.5) - I intend to move to CPython 3.3+ at some point but there's not much difference right now due to the tiny amount of python code implemented :)

You've definitelly convinced me to give it a try (no compatibility problems!!!! :-P). PyMite is great but has it's own virtual machine, only understand 2.6.x and some little differences with the sintaxis (dicts are not first class elements, you need to import from a module, and 'sys' module has not the same elements that regular ones). 2.7 it's cool, and being raw CPython the port to use 3.3 would be easy (unicode, yeah!!! :-P ).

Long-term it would be nice to use PyPy but it's not clear how difficult it

is to get PyPy to run in a selfhosted environment and again, there's not any real difference/advantage at this stage.

That would be great :-) I didn't used PyPy, but being able to generate plain executables it would be easy. Maybe you would have problems with the LLVM runtime, but it they could compile and boot Linux and FreeBSD kernels compiled with it, I think it should be possible...

[/OffTopic]

"Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton de sitios diferentes, simplemente escribe un sistema operativo Unix." – Linus Tordvals, creador del sistema operativo Linux