Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Hardware

Writing Protected Mode x86 OSes? 14

windex asks: "I've been looking recently for information on writing a OS (OS == kernel) from scratch, mainly as a personal science project. I've been looking for information on how to do this, however the only real information I've found is on developer.intel.com and its mostly in Intel-ese, not English. Does anyone know of a good place to start getting the basics of the x86 architecture?" There are probably plenty of x86 ASM books out there that can serve as a good reference for this project, but what about references that discuss writing the portions of the basic OS (memory management in particular)? If you find this question interesting, you might want to check out a previous topic we've done on multiplatform device drivers.
This discussion has been archived. No new comments can be posted.

Writing Protected Mode x86 OSes?

Comments Filter:
  • by Anonymous Coward
    But freebsd and such are far too developed to look at the concepts and are high developed code. Perhaps saddling up on an early OS project might be the best way to learn. A list of Alternative OS [uidaho.edu]
  • ... and found this:
    http://www.acm.uiuc.edu/sigops/roll_your_own/

    It looked quite useful :)
  • The TUNES project [tunes.org] has an OS Review [tunes.org] page that lists lots of code bases you may want to inspire from. It also provides lots of information on general OS concepts, so that you may produce original OSes, not just yet another toy kernel.

    -- Faré @ TUNES [tunes.org].org

  • Interesting that it is the earlier editions which are very detailed on the inner workings. I wonder if this part of the trend (seen especially in magazines) away from writing for the enthusiast towards consumerism?
  • Barnes&Noble has John Lions' Commentary on Unix for about $35 dollars--this is definitely real operating system code, but is a good deal thinner than more modern codebases (ie: Scott Maxwell's Linux Core Kernel Commentary, which is good)

  • SAMS publishing has a book entitled "Build your own 32-bit Operating System" that was released a few years ago.

    It's been collecting dust on the shelf for a year, but it was well written ... I even got through the first few examples!

    If you want, I can dig up the ISBN for you.
  • The link you provided (the OS FAQ) is one of the most informative I've found yet. Most of what's listed here I've already looked into, I'm playing with the OSKit right now. I was also already planning on looking into GRUB, because I was told it in general worked better, I understand the way LILO works already, but I don't grasp the concept of GRUB (yet), what would be usefull at this point is a programmers comparison of the two diffrent loaders.

    Thanks everyone who's posted so far,

    --- 'dex
  • a great way to code a new kernel is to look at other [freebsd.org], open [kernel.org]-source [openbsd.org] kernels [gnu.org]. Also, learn assembly if you don't know it already. It is a low-level language so you get a feel for the architecture, and the concepts in assembly are definitely needed in kernel development.
  • The new editions are longer and cover a lot more higher leverl stuff, like Windows. But if you look at the older editions, you can start reading all kinds of really low level hardware stuff fairly quickly.
  • You might want to check out. http://www.cs.utah.edu/flux/oskit/ [utah.edu]

    From the home page:-

    The OSKit is a framework and a set of 31 component libraries oriented to operating systems, together with extensive documentation. By providing in a modular way not only most of the infrastructure "grunge" needed by an OS, but also many higher-level components, the OSKit's goal is to lower the barrier to entry to OS R&D and to lower its costs. The OSKit makes it vastly easier to create a new OS, port an existing OS to the x86 (or in the future, to other architectures supported by the OSkit), or enhance an OS to support a wider range of devices, file system formats, executable formats, or network services. The OSKit also works well for constructing OS-related programs, such as boot loaders or OS-level servers atop a microkernel.

    I haven't used it so I cannot comment personally on its usefulness, but there does seem to be some interesting projects using it.

  • These are some books that I found relevent. I didn't include anythin specifically about asm, since the question seemed to ask about OS design more than the language.

    The FreeDOS Kernel [fatbrain.com] is a book about the way the GNU FreeDOS Kernel is designed.

    Of course, you can just skip the book and look at code. You can get a free Unix source license for some older stuff at SCO [sco.com] (not x86) or just download [kernel.org] a Linux kernel (for the x86)

    One of my favourite books about OS design: Inside the IBM PC, by Peter Norton. It's been through many, many editions, and some of the older ones are very detailed about the inner workings of DOS.

    Just in general, look at used book stores or the library. You can find some very interesting old books. I seem to remember an old book put out by MS Press, Inside OS/2 or some such, that was pretty good.

  • by XoXus ( 12014 ) on Wednesday June 21, 2000 @06:44PM (#984928)
    The best thing I found was to ignore trying to make the bootloader and the code to get into protected mode. Instead, use GRUB (look on freshmeat) to load your kernel.

    I'd definitely recommend checking out the OS FAQ:

    Here [mega-tokyo.com]

Software production is assumed to be a line function, but it is run like a staff function. -- Paul Licker

Working...