Slashdot Mirror


A Look At Bootstrapping

markmcb writes "OmniNerd posted an interesting article on the often-overlooked process of bootstrapping. The author does a nice job of showing how to take an x86 system from BIOS to OS once it's powered on. A complete set of commented code is provided and explained in the article."

5 of 30 comments (clear)

  1. x86 is a fossil by kyouteki · · Score: 3, Insightful

    All this article says to me is how old and convoluted the x86 architecture is. I mean, all these memory restrictions and limits, all there for the sake of backwards compatibility. And we've just kept building on the same platform, so there's no way out.

    --
    A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
    1. Re:x86 is a fossil by Anonymous Coward · · Score: 5, Insightful

      Old it is. Convoluted? Is that such a simple asm program that's giving you headaches? That's REALLY REALLY simple stuff for anyone who's ever done asm at all (on x86). Plain 386 instructions, nothing 32bit (no "db 66" or e?x registers even). No interrupt handlers, no direct I/O to the hardware, etc. If you find this complex, it just goes to say you've never coded asm, perhaps on any platform (I've coded in asm on several - motorola, PICs, Atmels, etc - and all programs were typically more complicated than this little "bootloader"). I find it's one of the easiest platforms when it comes down to machine code, coding things like a simple PLC emulator (that runs ladder) in asm, interfaced over the parallel port is pretty much trivial (did that in a weekend as a teen, just for fun). Extensive documentation was easy to find (schematic of the XT boards - whose chips were easy to understand and control, ralf brown's interrupt list, etc). Interfacing was easy too, just throw a 8255 on a "blank" ISA card and you were pretty much set (24 IOs at TTL level), although PICs have changed this whole thing quite a bit. I still miss these days - I loved coding in asm. Those were the best days of my life (as a geek/programmer/computer hobbyist), things just aren't the same anymore, and programming lacks that little something...

      We're "stuck" on x86 mostly by choice - backward compatibility is a great thing. You can buy a dual core high end machine and install anything from say, dos 3.3 to XP (and every version between) and most of it will run just fine (and other OS'es). That's very important to a lot of people. Decent hardware for the platform is quite cheap really, readily avaialble virtually everywhere, and you can get parts that fits your needs no matter what (slow or fast, be it a CPU, video card or whatever). You can assemble what you exactly need. There's tons of reasons to stay on x86, I can't see myself switching to something else anytime soon.

    2. Re:x86 is a fossil by stevey · · Score: 3, Insightful

      And yet despite the fact that there are lots of existing bootloaders out there (lilo, grub, chos, etc) and writing a new one is fairly simple nearly every week there will be a new post asking for help in writing a bootloader on alt.os.development.

      I can only assume it is because people first start writing an operating system by coding the bootloader. Still given the number of people who have problems with that it is no wonder that few actually write something functional.

  2. I agree with the other guy by Kawahee · · Score: 3, Insightful

    Finally! A /. article just for me! I've written an OS before, a small one. It didn't do much. But I didn't understand shit about the ASM involved, or even why 0x700h or whatever was the correct place to put the stack. So kudos to /.. Kudos.

    --
    I'll subscribe to Slashdot when I see a month without a dupe, a typo, or an article the "editors" didn't read.
  3. Re:Meh, why not just look at LinuxBIOS? by Anonymous Coward · · Score: 1, Insightful

    Why not look at LinuxBIOS? Perhaps because it is totally irrelevant? It is a replacement of traditional proprietary BIOS systems, not a tutorial on the post-BIOS x86 bootstrapping process. I know this is Slashdot and that anything with Tux is free moderation, but Jesus Christ, this has NO relevance whatsoever.