I want to create an OS!!!
I want to create an OS!!!
Hello friends I want to start developing a kernel, an operating system
What languages do you recommend?
It will be possible with Python?
What languages do you recommend?
It will be possible with Python?
Chente Davila
Developer
Developer
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: I want to create an OS!!!
You will need to learn C, and you probably want to read the Introduction on the wiki too.
At your level of experience, it's wise to just learn C (and write some applications for your favourite OS before making one), and leave the thinking about Python for a much later date.
At your level of experience, it's wise to just learn C (and write some applications for your favourite OS before making one), and leave the thinking about Python for a much later date.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: I want to create an OS!!!
Not without a great deal of both C and difficulty.
Try something for me - run
Every system call you see (and there will be many) is a component of the runtime you would need to implement, in C, before you can run a Python script that does literally nothing on bare metal.
The alternative might be perhaps to write a full Python compiler that outputs machine code, but this will also most likely be written in C, and will still require you to write a runtime for each target system.
The fundamental issue is that Python is an interpreted and very high-level language. An operating system is by nature a very low-level concept. There's just too many layers between Python and the bare metal.
Try something for me - run
Code: Select all
$ strace python
>>> exit(0)
The alternative might be perhaps to write a full Python compiler that outputs machine code, but this will also most likely be written in C, and will still require you to write a runtime for each target system.
The fundamental issue is that Python is an interpreted and very high-level language. An operating system is by nature a very low-level concept. There's just too many layers between Python and the bare metal.
Re: I want to create an OS!!!
Mmm but im trying develop in C# y most powerful
Chente Davila
Developer
Developer
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: I want to create an OS!!!
Similarly, C# also depends on a runtime (even Singularity, the 'C#' OS, has both assembly and C code).
Re: I want to create an OS!!!
Mmmm then is possible? But implementing a interpreter ?
Chente Davila
Developer
Developer
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: I want to create an OS!!!
The bottom line is this: The lowest layer of your OS must run on bare metal and must thus end up as machine code. Whether this layer is an interpreter, a compiler, or the kernel proper, you either need to find tools that generate this mechine code from the higher-level languages you require, or implement them yourself. Note that regardless of the choices you make, some knowledge of assembly is imperative.
Generally speaking, I would say that these days C is inadequate for pretty anything other than embedded programming on resource-scarce environments, where no better alternatives exist. However, if you don't have too much experience in software development, you should definitely stick to C for a while (a) because there exist an abundance of learning materials on C applied to OS development, and (b) because your first project will likely be unambitious enough that the preparations for using higher-level languages will not be worth it---tools for use with C are readily available.
The choice of which programming languages to use is not specific to OS development. You should ask yourself the same question regardless of the software system you plan on developing. The best way to come up with an answer is to learn languages that are different enough from each other that you will expand your intellectual toolbox; you should learn which language paradigms and features are valuable under which situations (e.g., Should you use functional or procedural programming? What features of OOP, if any, do you need? What are the design goals of different exception handling mechanisms? How important is maintainability?). In fact, this will even help improve your understanding of and abilities in the languages you already know.
Generally speaking, I would say that these days C is inadequate for pretty anything other than embedded programming on resource-scarce environments, where no better alternatives exist. However, if you don't have too much experience in software development, you should definitely stick to C for a while (a) because there exist an abundance of learning materials on C applied to OS development, and (b) because your first project will likely be unambitious enough that the preparations for using higher-level languages will not be worth it---tools for use with C are readily available.
The choice of which programming languages to use is not specific to OS development. You should ask yourself the same question regardless of the software system you plan on developing. The best way to come up with an answer is to learn languages that are different enough from each other that you will expand your intellectual toolbox; you should learn which language paradigms and features are valuable under which situations (e.g., Should you use functional or procedural programming? What features of OOP, if any, do you need? What are the design goals of different exception handling mechanisms? How important is maintainability?). In fact, this will even help improve your understanding of and abilities in the languages you already know.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: I want to create an OS!!!
Glad to see a new OSdev! I wouldn't recommend python, you need to at least know assembly for a basic kernel. But once you can change directories and run programs you could port python to your os and run python code on it as programs. If you need some basic assembly code the tutorials in the wiki will have a good start in an assembly kernel with one command that would get you to a couple of commands but not the big stuff. You also have to realize making an operating system is the hardest thing you could do on a computer, it is probably like making 10 completely different mmorpg's at the same time.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: I want to create an OS!!!
Not to overgeneralize, but operating systems are definitely not the most difficult thing one can program, regardless of what we advertise on the wiki. Conceptually, they are quite simple. What makes them difficult is that they are actually formed of many subprojects (e.g., boot loaders, file systems, device driver interfaces, device drivers, network stacks, linkers, loaders, memory managers, schedulers, user interfaces, interprocess communication, power management, etc.). Not only must all these subprojects be executed correctly, but they also require integration. As you may already know, managing complexity is one of the most important skills an engineer must develop. Otherwise, the bigger the project, the bigger the mess. And by mess, I mean anything from bloat to halting projects or even loss of human life).
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: I want to create an OS!!!
It would (IMO) be easier to learn C and write it in C than write in python... C is an awesome language, I am sure you will not regret it if you learn it.chentedev wrote:No can do in python? : (
Currently developing Lithium OS (LiOS).
Recursive paging saves lives.
"I want to change the world, but they won't give me the source code."
Recursive paging saves lives.
"I want to change the world, but they won't give me the source code."
Re: I want to create an OS!!!
C is by far the most widely used language in operating systems development; mostly because it was designed for that very purpose. You can't use Python, unless you can find a compiler for it - and probably not even then. Modula and its derivatives have been used.
It is also unlikely that you could get by without knowing any assembly language; although you might at least be able to get started without that if you used an "off the shelf" boot loader.
It is also unlikely that you could get by without knowing any assembly language; although you might at least be able to get started without that if you used an "off the shelf" boot loader.
Re: I want to create an OS!!!
"Loss of human life!?!?!?" Please, don't scare me, I'm quitting OS development right now.Love4Boobies wrote:Not to overgeneralize, but operating systems are definitely not the most difficult thing one can program, regardless of what we advertise on the wiki. Conceptually, they are quite simple. What makes them difficult is that they are actually formed of many subprojects (e.g., boot loaders, file systems, device driver interfaces, device drivers, network stacks, linkers, loaders, memory managers, schedulers, user interfaces, interprocess communication, power management, etc.). Not only must all these subprojects be executed correctly, but they also require integration. As you may already know, managing complexity is one of the most important skills an engineer must develop. Otherwise, the bigger the project, the bigger the mess. And by mess, I mean anything from bloat to halting projects or even loss of human life).