Slashdot Mirror


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."

4 of 102 comments (clear)

  1. Amiga RKMs by Mr.+Darl+McBride · · Score: 5, Informative
    Get your hands on the Amiga ROM Kernel Manuals -- both "Libraries and Devices" and "Includes and Autodocs." I&A has the headers for most everything, and the libraries explain the workings pretty well. The Amiga OS was very simple and elegant. Understanding the base (ignore the GUI) will be enlightening.

    Now, these books don't make for a how-to, and you don't get the source for the core OS with them, but if you start by learning the exec interface, then look over the exec headers, you'll quickly develop a thorough understanding of a simple multitasking kernel. From there, you can glom onto the basic device library with the library book, then the headers again, and repeat for the trackdisk library. Jump into console and other libraries as your interest dictates. Don't worry about learning these things in a linear fashion -- going with your interest first is critical for learning something as complex and intricately interconnected as the workings of an OS.

    After seeing how some of these work together, if you've got your head on straight with C, implementing your own equivalent on the PC should be easy. Grab MS-DOS, which leaves protected mode entirely open to you, and build your own system on top of that. No need to start with your own bootstrapper if you can do it with a little DOS code. That way you have BIOS services for the parts you haven't written yet, and can replace bits a little at a time as your interest dictates. Make a simple OS shell first, using mostly wrappers, then drill down until it's time to start making your own device drivers.

    From here, I went on to acquire the IP rights behind UNIX and develop from there, but you can take your own route.

    ~Darl

  2. Here's a list for ya.. by QuantumG · · Score: 5, Informative
    • Learn asm
    • Get used to rebooting your machine or figure out how to get Bochs to compile with the debugger enabled
    • Write a bootloader (I know Grub rocks, but you need the experience)
    • Write a keyboard driver
    • Write a video driver
    • Write a scheduler
    • Write a shell
    • Write a filesystem driver
    • Write a network driver
    • Try to port gcc to your OS
    • Write yet another revolutionary GUI
    • Write everything else

    • Congratulations you've got yet another monolithic kernel based hobby OS that no-one is interested in but you.

      If you want something remotely interesting, try seperating as much of that junk in the kernel as you can into userland. Pentiums now have system calls that are 5 to 10 times faster than they used to be. Think about writing applications that communicate using shared memory pages. If one app writes a page and then instructs the kernel to map that page into another process, the kernel can do that rediculously fast. That's 4k (or more if you're using bigger pages) that has transfered from one process to another in the space of a single system call.

    --
    How we know is more important than what we know.
  3. Re:One good source by Otter · · Score: 5, Informative
    None of this is really an answer to his question, which is for a text that walks you through the basic concepts -- but one of the annotated Linux kernel texts, similar to the classic Lion's Commentary on Unix is a lot closer to what he wants than telling him to read a tarball.

    But, again, he really just wants to know what the best college-level textbook is.

  4. Richard Burgess's "Developing Your Own 32-Bit OS" by mosel-saar-ruwer · · Score: 5, Informative

    Richard Burgess's "Developing Your Own 32-Bit Operating System":
    http://www.amazon.com/exec/obidos/ASIN/0672306557/

    http://www.accu.org/bookreviews/public/reviews/d/d 000481.htm

    http://www.sensorypublishing.com/mmurtl.html

    Used to be published by SAMS, but they no longer list it. Now available as an online download.