Building Your Own Operating System?
sonictooth asks: "I have dreams of writing a toy operating system, as I know some people have already done in college. Unfortunately, I don't have that opportunity. I was wondering what books (as there are so many) and methods people [have used], either in college or on their own. Amazon is littered with books from varying authors, Tanenbaum in particular, and there are both positive and negative reviews of his books. Does anyone recommend a simple book to walk you through the early stages, and then explain the more complex theories later on."
Slashdot needs more items like this! Reminds me of the pre-SCO days...
I did this years ago. Had a quick boot floppy with a dumb OS that did almost nothing. But it was still cool "just for fun."
h p
As I suggested, google is your friend.
Google gives you this first: http://mega-tokyo.com/osfaq2/.
And this might be good for FS (Fat12) http://www.free2code.net/tutorials/other/20/os1.p
I used that book. I would mod you up but no modding and posting. :( I made a mini "OS" which just went to PM, switched tasks, and did a little screen writing before going back to DOS. It wasn't a real OS but rather a program that uses PM. ButI learned all I needed to know from kindergarten, er that book. And I still have it.
Why don't you guys have friends or journals?
Why? What experience do you gain from this? I only ask because every other tutorial or FAQ, that I have come across, strongly advises you not to do this-- especially as the first step.
Win a signed Stephen Carpenter ESP Guitar from the Deftones: http://def-tag.com/?r=0008781
If you're writing a toy OS to learn the upper level OS concepts, then you're probably better off writing your 'OS' as an app that runs on top of your favorite existing OS. But if you're doing it to learn more about low level programming and the hardware/firmware you're running on, the bootloader is at least a portion you can get done before loosing interest, and it teaches its own lessons.
Also, if all you want is a baby utility OS/program, you can bootstrap the entire program into memory from a floppy (or bootable CD) bootsector, run it, and be done with it.
Lessons learned:
I write code.
It checks your tool chain, takes about 4 hours (assuming you know assembly, but not the machine's boot process), it gives you ground from which to start other stuff, it let's you say you're building 'from the ground up', and it gives you confidence by doing something easy.
I've had this sig for three days.
I really enjoyed Tanenbaum's Operating Systems: Design and Implementation. The whole book is basically a tour of Minix with lots of OS theory along the way. It's very *NIX oriented - signals and system calls etc, but there's some discussion of other ways of doing things.
/james
The nice thing about Minix is it's very easy to make sweeping changes to the OS, recompile the kernel, and see what happens, and the book helps explain how it all works.
You may want to read an article in Linux Gazette:
So You Wanna Create Your Own x86 Operating System?
There are also plenty of nice Z80 emulators. That way you don't need to reboot a machine every time and you have easier code stepping capabilities.
"Obviously you'll miss the lectures"
How come? There's nothing preventing you from walking in to the lecture hall and listening to the prof give his lecture. People do this at my school all the time, it's called auditing. Some of my crazy friends even do the assignments, or help groups with their group work, even if they aren't enrolled in the course!