Ask coding questions

← Back to all posts
How can I make a OS like windows (with python)
KARAMELEK011 (2)

Can you tell me how can I make my own OS with python?

Comments
hotnewtop
MocaCDeveloper (560)

The most, and I mean the absolute most you can achieve with Python when it comes to lower-level ideals, such as creating an OS, is the outline of the terminal it'll have..lol.

There is no real foundation with Python to even be able to start the development of an OS, little alone be able to create a WHOLE OS.

Python is simply, well..too high level for an OS. As I stated before:

The absolute most you can achieve with Python when it comes to lower-level ideals, such as creating an OS, is the outline of the terminal it'll have

That says it all. Python can't access registers like assembly. It can't shift memory, nor can it allocate it. It simply can't align bytes accordingly. Shoot, if you even tried making a simple language in it, that language would be just as slow(if not slower) than Python itself because it's interpreted.

Take it from a guy who writes Assembly, C, Python and Java, and who has also attempted to create an OS. Python is simply just not the way to go. Python is for automation's. Simple servers. Databases etc. Python was not built to withstand the compatibility of creating an OS.

Nevertheless, however, you can dive your nose right into the world of low-level languages and learn some good ol'x86 assembly, with some C mixed into that and oh you know..any other low-level type of language you'll need, because if I do recall correctly(it has been some time, I apologize), you have allot of aligning memory to do before even getting the first little part of an OS going.

I do not mean, by any mean whatsoever, to crush you spirit by this. But an OS is simply an extreme project that anyone who is daring to take must be prepared for months, maybe years, of blood and tears..day after day. An OS is not as simple of a task to be done as you may think. As of right now, you have an OS at the tip of your finger. Now, imagine having to make it from scratch. How do you end up getting colors? How do you even end up powering it up? These are the question you ask yourself when it comes to creating an OS. And believe me, doing this with the low-level languages(pretty much required to make an OS), will cause you blood, sweat and tears all together.

Just look at the OS Linux. It took a few years to create it.(I can't think of how many years it took off the top of my head)

ch1ck3n (1618)

@MocaCDeveloper Wow, you wrote an entire paper

MocaCDeveloper (560)

@ch1ck3n

Indeed. I lean more to the informing side. I like to leave people with the fundamental knowledge they need to the question they asked.

The More You Know lol

JULIODIAZ1 (46)

you need html for the graphics and a language for processing

Theplayer592 (8)

Sorry, but you literally cannot. You need to know Assembly If you want to, you could try to make the kernel, but python's interpreted, so it might be a bit tricky, and your OS will be quite slow. I suggest that if you want to make an OS you should know Assembly, and probably C or C++. You can find most of this info by just doing a quick google, btw.

Coder100 (16985)

try rust
https://os.phil-opp.com/

and no you will not like using python it will make you go insane do not try it unless you are experienced with osdev which clearly you don't appear to be.

MocaCDeveloper (560)

@Coder100

Even if you are familiar with osdev, you would know not to even come near Python when it comes to creating an OS.

And I'd recommend C and Assembly for the fundamentals. There are, of course, other languages that go into the development of an OS, but I cannot recall them off of the top of my head.

Coder100 (16985)

maf
rust better

imagine having to use asm can't relate @MocaCDeveloper

MocaCDeveloper (560)

@Coder100

Well assembly is pretty much needed for an OS.
While Rust may be good, C is preferably the language to use. In the majority of the documentation and step-by-step guides on creating an OS have I only seen C being used(and some assembly)

brokentoken (51)

You should use node and html for creating os's

JacobMcPherson1 (193)

@brokentoken that is literally the worst advice I've ever seen someone give

brokentoken (51)

lol i was being sarcasitict. @JacobMcPherson1

brokentoken (51)

i was thinking we wanted to make online os @JacobMcPherson1

MocaCDeveloper (560)

@brokentoken

In all honesty, any interpreted language is a no go for OS development.

ch1ck3n (1618)

@brokentoken The media went crazy for a couple months when donald trump said that exact same words

Wumi4 (486)

Python is pretty bad in low-level stuff as @SixBeeps and @IntellectualGuy already mention. If you want to make an OS, consider using system languages like Rust, C, or even Assembly. If you need some help, the OSDev Wiki will be handful.

MocaCDeveloper (560)

@Wumi4

Well, C and Assembly are the two main languages required for OS development. Without them, you wouldn't be able to get too far.

SixBeeps (5056)

You can make an OS with Python.
However, that doesn't mean that you should.
General consensus is that OS's require lots of low-level work. Python (in my experience) has terrible support for low-level interfaces. As such, you might need other languages along with Python to get anything working.
Another downfall with Python for this use case is that it is an interpreted language rather than a compiled one. This means that you can't easily stick it into something like a boot sector, as you'd need to also put the interpreter in there somehow.

tl;dr: don't do it, Python's not the best choice.

IntellectualGuy (685)

I don't think you can make an os with python, there are many programming languages that you need.