a Python based OS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: a Python based OS

Post by Chandra »

Just to make some people here, happy....
Combuster wrote:(Where python may be replaced with any higher level language.)
Or may be assembly?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: a Python based OS

Post by Combuster »

There's a big difference: if you can't do an assembly OS on your own you have other people's code to steal. :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
guyfawkes
Member
Member
Posts: 93
Joined: Mon Jul 18, 2011 9:47 am

Re: a Python based OS

Post by guyfawkes »

Combuster wrote:There's a big difference: if you can't do an assembly OS on your own you have other people's code to steal. :wink:
ASM OS's are not very easy to steal, they are like a tower of playing cards.
Trying to glue bits of different ASM OS's needs a very good understanding of assembly, which defeats the point.

If your talking about riping a whole OS and just changing the name, then i agree.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: a Python based OS

Post by NickJohnson »

If you're not that dead-set on Python as an interpreted language, and instead just want something dynamic, Lua might make a better target for this. Its runtime is very small and a piece of cake to port (it only uses a subset of ANSI C.) It also interfaces with C very cleanly, and if you use LuaJIT, can run nearly as fast as C under good conditions. The virtual machine stores its state in an external structure, so it's thread-safe (unlike Python), and can be separated from the interpreter to make the runtime even lighter. I've already ported it, and plan to use it extensively in my userland, although not in my kernel.
User avatar
Rusky
Member
Member
Posts: 792
Joined: Wed Jan 06, 2010 7:07 pm

Re: a Python based OS

Post by Rusky »

+1 to Lua.

It's awesome to work with, and extremely easy to extend with C or itself.
arming
Member
Member
Posts: 38
Joined: Sat Dec 10, 2011 6:23 am

Re: a Python based OS

Post by arming »

It's more difficult that I have expected :? . After reading your advices, I think that I'm going to continue the mini-kernel in C :mrgreen: .

Thanks!
berkus wrote:
Why not?
Because you're asking stupid questions here, that's why. Just do it.
:roll:
How to create a webpage?
It's a stupid question. Just do it.
arming
Member
Member
Posts: 38
Joined: Sat Dec 10, 2011 6:23 am

Re: a Python based OS

Post by arming »

berkus wrote:You've just earned a position in ignore list. Congratulations!
Thanks! :wink:
ishkabible
Member
Member
Posts: 37
Joined: Wed Jan 05, 2011 7:35 pm

Re: a Python based OS

Post by ishkabible »

I was thinking Lua this whole time too :P then someone finely said it. anyway, you actually have to port LuaJIT to use the correct allocation functions for your OS. for instance, on windows to properly JIT compile you have to use VirtualAlloc and VirtualFree; malloc and free have no guarantee of being executable(although with MinGW it seems to work). that is hardly a big deal though as your only talking about 2, maybe 3, functions plus the ANSI run-time library. still, it seems like a bad idea as you would restrict your OS quite a bit. have you thought about just making python for the shell?
Post Reply