Can i Create My Own OS
Hello Guys, Today, a thought crossed my mind: “What if I had my own operating system?” I began my research and discovered that operating systems are typically written in the C programming language. However, I’m well-versed in Python. So, the question arises: Can I create my own operating system using Python?
|
No. What would run the Python code? You'd have to write some sort of special purpose Python interpreter and compile it to executable, then get the UEFI firmware to hand control off to it. How would you do low-level device IO and graphics with Python? Lots of teams have tried to write their own OSs, many have failed. It's a massive task.
|
Quote:
At the other end of the scale, much simpler systems set a much lower bar. I designed something around a microcontroller in 2001 and the program that made it function was the "OS." |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Yes. You have got a lot of no, here is a yes. Although you cannot write a full OS in python (as it was explained), but you can implement an emulator in python, which will mimic an OS.
But would be better to start with a simple thing, not an OS, let's say with a terminal. Later you can improve it to do more and more (and will look like an OS). As it was mentioned it is a massive task. |
You might also look at a "unikernel" for your project. If not directly applicable, it might provide some ideas.
|
One person can realistically write about 0.1% of the code in a modern OS.
One needs to choose those areas carefully, and of course, leverage the work of a thousand helpers. Ed |
You CAN write your own OS, but not in an interpreted language. You would need a Python compiler that outputs static native runtime executables without dependencies. And even then there may issues.
Before C most OS code was in assembler, and that is still an option. (See Kolibri/KolibriOS as an example.) Some current projects are leaning on RUST. One I know went back to Pascal because of the structure, protections, and assembler collusion features supporting multi-level coding. You might see if you can find a copy of the dragon book (Compiler Construction) and create your own compiler, but that project is likely to take longer than just learning to RUST. Either way, there is a learning curve and a lot of time involved. Not a quick decision... |
This seems to be a FAQ that web-searching would find lots of ideas.
To me, LFS, gentoo & mll seem like using bash to 'assemble' a linux(= just the kernel) 'distro'! Might depend on what parts/functions of an OS interest you the most. |
Quote:
On the other hand, it would be a lot less work! |
|
If you wanted to fix screensavers turning off the monitor, ask yourself what you would check? I don't know to what extent you're following other threads, but there's interesting things going on thaqt give an insight to the issues you can face building a distro.
https://www.linuxquestions.org/quest...on-4175735987/ https://www.linuxquestions.org/quest...nt-4175735916/ Various people have had various issues around screensavers,suspend/hibernate/power-off behaviour and as you see, elogind & polkit have been fingered. Although in my case, something else seems involved also. How logical is that? My point is: There's a very real chance of you ending up with all your programs sitting up and running, but your efforts being nowhere near release status because subtle config imperfections are making life hell. The standard out there now is high. Most distros have decades of experience, miles of scripts and special purpose utilities. Or else, they have someone behind them who has assimilated such experience. |
All times are GMT -5. The time now is 01:28 PM. |