Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average
Thread Closed 


How are operating systems made? filter_list
Author
Message
How are operating systems made? #1
I have always wondered how operating systems are made. Are they made using some programming language like other application softwares or is their some special process to make it?
Folow me on My YouTube Channel if you're into art.


RE: How are operating systems made? #2
It must contain really huge codes.. Anyways, thanks a lot for the info..
Folow me on My YouTube Channel if you're into art.


RE: How are operating systems made? #3
Well it's possible to use C/C++ for OS development, but you most definitely also need assembler knowledge, in fact, large portions of OS are done in assembly, because some things can't be even done in standard C/C++, especially if you want to have highest performance possible.

The exact process depends on what kind of OS do you want and how will it be structures, but often there's heavy use of abstraction, as in most aspects of the computing, because it makes everything much more simple.

In fact, I don't think that OS development is really hard, it's quite simple (well relatively) if you think about it, but rather tedious and time consuming, since you have to do a lot of things.

It can be compared to composing it from layers, where each layer above doesn't need to care about the inner workings of the layer below, it simply utilizes its services.

You usually need to develop a kernel - central part of an operating system, that provides basic communication with the hardware. It will provide access to various devices (including harddrive), schedule processor time for applications (if you have multitasking OS) as well as assign memory (for example by creating memory segments) and all the other low level stuff, it will also often interact with drivers for communication with specific devices.

The exact tasks that kernel has to do depends on the type of kernel you want. You can have very simple small kernel with a few functions and you either decide that you don't need advanced functionality or you implement it in the layers above the kernel, or you can have very complex kernel with tons of functions. Of course, there's a lot of variations between these two extremes.

Once you have kernel done, you don't have to care about how you have to communicate with the hardware (what control signals need to be generated and such). You simply tell the kernel you want to access data at the harddrive at given address and it will care of the rest and return you the result, or you'll ask it to draw something on screen and such or you can ask it to start a new process.

Now you can construct another layer, which doesn't have to care how exactly you communicate with the hardware and how you utilize it - you just call some kernel functions to do some task and it will care of the rest. So now you can write more code, usually something that will use the hardware to communicate with the user - get input and show some output. You can split this into many parts too.

For example you can write a code that will take care of drawing more complex stuff on the screen, like some shapes and bitmaps, then you an provide yet another library which will use these shapes to draw controls, windows, buttons and stuff and it will provide this functionality to the other code: various programs you can run.

The important thing is, that thanks to this abstraction, the applications don't have to care how to communicate with the hardware, or even how to draw stuff - they simply ask the system library to draw some window with some buttons and text. This library will then generate commands to draw simple shapes that will compose these windows, buttons and other stuff. Then this library will interact with kernel and tell it to draw stuff and the kernel will generate appropriate command codes for the graphic card for example.

Of course, there's tons of things you need to have and it all depends on what kind of OS you're making, so it's difficult to explain it generally.

However, like I said, it's not that difficult, assuming you have understanding of hardware, assembly and programming. Then you simply follow various specifications how to interact with hardware and you build your OS upon that.


What's important to mention is booting in environments, where you need to boot the OS first (for example MCU chips can run the code as soon as they're powered up). You need to refer to specifications too.

On computers, when computer starts, processor starts executing a program called BIOS, which will perform some basic tests on the hardware and then it will initiate booting according to the configuration. Usually, it will load a small code stored on the beginning of the hard drive, called MBR, it contains information about partitions and can also contain up to 446 bytes of a code. There you can store a very small code (a few dozen instructions). This is usually sufficient to write a very tiny program, that will load a larger piece of data from the harddrive to the memory - for example some bootloader program, which can be larger - the small code in the MBR can contain some kind of loop that will simply read larger portion of data - more complex program.

Once it loads this program (basically series of instructions) into the memory, it will jump to this code and the processor will start executing it. This code can then perform more complex operations - initialize hardware, load your kernel and some other basic system code into the memory and prepare everything needed for the execution of this kernel. Once it's done, it will transfer the control to the kernel and the kernel will start working now, performing the operations needed to run the OS and start interacting with the user. The kernel then usually runs in a loop indefinitely - until you shut down your computer. It can load (or delete) more code from the memory as needed - as you launch various programs.

But like I said, this all depends on the kind of OS you want and there's a whole range of them, for various purposes and architectures and even the same types can be programmed in different ways. However I hope that this brief explanation made some things more clear to you, it's rather complex and wide topic.

It might help to understand how the processor actually works, so I recommend my recently published article How processor, assembly and programming languages work for dummies
I love creativity and creating, I love science and rational thought, I am an open atheist and avid self-learner.


RE: How are operating systems made? #4
(08-25-2011, 06:44 PM)The 7th Sage Wrote: Yes Most Operating systems are coded in languages such as C and/or C++ I would say its one of the toughest level programming. Because not only do you need to know how an OS works but you have to develop the architecture. Of course there are professional teams that do the job. You are developing an environment that runs services, manages applications, optimizes services, schedules timings, etc, etc, etc and interacting with the hardware too.

In short trum it is a good knowledge.


1010011001111010010010101
0110G10H10O101S010T10101
1010100010100100101001001



RE: How are operating systems made? #5
i have always wondered how os are made, i even trying making my own linux distro didn't go well Wink


RE: How are operating systems made? #6
Well there's a huge difference between making a Linux Distribution and your own OS from the scratch.

If you make a Linux distribution, you just put together many parts made by other people, you have kernel, userspace software, drivers and all that is already created, so it doesn't take that much effort to combine it together in a way you want, but it's not really your OS.

However, if you wanted to really make your own OS, you would have to create these parts together, starting from kernel, some simple bootloader and then add more code to it, that would add functionality and allow it to interact with the user, basically like I described in my post above.
I love creativity and creating, I love science and rational thought, I am an open atheist and avid self-learner.








Users browsing this thread: 1 Guest(s)