Learning OS programming?

10 points by iimushka ↗ HN
Hi Guys. I am a freshman in Computer Science and wanna specialize in OS. if i wait for university to teach me,it would take 2 or more. By now i only know about C programming at some rate. My question is what do i have to learn to understand and write my own OS(at least like sipmle linux-s),and in which order that is the best ? and some good books & refs on these. What i need is clear path for beginning, whatever it takes i`ll learn anyway :)

for example, c-->algorithms-->assembly&machine-->kernel.....etc tnx iimushka

14 comments

[ 1.7 ms ] story [ 41.7 ms ] thread
I'd recommend writing a toy operating system, there are many tutorials online. That will give you a good start. I wrote a small x86 kernel many years ago following online tutorials. It's great fun. You'll learn a lot from doing.

Since you are at university ask around for a professor that teaches or is an expert in Operating Systems and seek his advice. That's why [s]he is there.

I highly recommend "Operating Systems: Design & Implementation" by Tanenbaum. It is a very clear book dealing with a lot of design and implementation details of operating systems. It has an in depth discussion of the Minix source and design decisions made. Now Minix does not have such a large user base as Linux, but in my kernel hacking experience in both Minix and Linux so far the Minix sources are far more pleasant to hack on.
I once wrote a brainfuck interpreter in assembler which would run at boot time. It's Turing completeness closer to the machine.

But the internet already thought of that and crazier things: http://www.masella.name/technical/BF-CPU.pdf

<> Find out which operating system the OS class at your university uses, waaaay back in the day it was AT&T Unix, then there was Minix, these days it's usually a flavor of Linux or BSD. Find the web page for the class that has the build instructions for it and follow those. Get all the source code together and compile and run it. Now make some simple change like altering a boot string to say "Yay I did this." Don't use on of the pre-built VMWare images that just require you to type "make". Download the source code, download GCC and figure out all the configuration stuff needed to build the whole OS. Learn a little bit about each of the tools involved but stay focused on building and running whatever OS it is. Once you get that far pick one of the easy early exercises like modifying the memory manager or playing with the process scheduling algorithms. Doing all that should give you a pretty good idea if you want to really specialize in OS's and you will do very well when you do take that class.
I'm a big fan of http://www1.idc.ac.il/tecs/ (The Elements of Computing Systems) It takes you from logic gates all the way up, showing just enough at each level to give you a real view into what's going on there.

I think once you've got through this book, you'll have a great base for anywhere you want to go, including OS programming.

Don't learn C, learn assembly and take a few ee courses. Learn about new and interesting operating systems written in type safe languages. Linux, FreeBSD and friends while practical are all based on ideas from the 1970's and IMO are bound to die out within the next 20 years.
Check out minix3.org it is a small os you can read (source code) and play with.