Web defza.com

Operating System

In the first semester of this year, we did a small project where we had to make a simple operating system. Including memory management, processes and IPC. (e.g. cs314)

It was interesting, and gives you an idea of what your operating system is REALLY doing.

It was done in the C language. (Basically a nice wrapper for machine language code, ASM)

Overview

CPU
A computer can literally only run one thing at a time on its CPU. Either a process/program is running, or the kernel is running. It’s linear as a ruler.

There’s a piece of hardware called the interrupt controller which literally sends a interrupt signal to the CPT to tell it when it must stop running the process and switch back to the kernel. Without it, the kernel would never run as nothing can stop a process except the interrupt.
The kernel then schedules the next process to run or whatever it wants to do.

Memory
Memory is just a clean slate when you start the computer.
The kernel must literally keep track of the free memory. The method you use is entirely up to you.

Booting
There are some standards which define what hardware manufacturers should all agree upon so that everyone’s motherboard is more or less compatible.

So, a certain sector on the disk is read at startup. Put your operating system code there, and it will run from that point. You have to code exactly what must be done from there on in.

General

One thing I learnt is that you can usually find the best information about a topic on universities‘ web sites. The subjects/modules websites that is.

Because plainly, noone cares enough to put their knowledge out on the web. So the stuff you find is usually half baked.

Also, the good stuff is in books. Paper and ink books. We used Operating System Concepts, Silberschatz, Galvin and Gagne.

Your own os?

Write your own operating system tutorial? Well… not something that is taken on very often! It’s really a non-trivial matter, because you have to really make sure everything works. Never mind the fact that you have to code each platform (32bit, 64bit, PowerPC, etc) seperately! And write drivers for each kind of hardware out there, if you want other people to use it.

Makes you respect your operating system for running.

If you really want to code something cool, your coding energy is better spent on anything else but your own operating system. Not saying that’s its impossible, it is quite possible, but just not always useful!
You will learn a lot from it, that’s for sure.

Also, writing a custom operating system is sometimes essential for certain applications.

Some random links I collected about OS dev

http://visopsys.org/osdev/ – This little page is the beginning of a collection of source code, information, and links related to general Operating Systems’ Development on the Web.

http://www.aros.org/documentation/developers/links.php

http://mega-tokyo.com/osfaq2/
– This is the “write your own Operating System” OS-FAQ .

http://www.osdever.net/index.php

http://gaztek.sourceforge.net/osdev/Welcome to my OS Development page, this site is for people looking into developing their own operating system. I would just like to give you a few guide lines for you to help you in your OS development before I present the actual resources. You should write you kernel in C, the compiler you should use is GCC and you should develop your OS under GNU/Linux. That is what I recommend because it will make your life a hell of a lot easier.

http://my.execpc.com/~geezer/johnfine/

http://www.osdcom.info/

http://www.ganssle.com/articles.htm – embedded operating systems

http://www.openembedded.org/

Bootstrap loader
http://www.omninerd.com/2005/11/05/articles/40
+ links