Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Hardware

Anatomy of the Linux Boot Process 170

Donna writes "This article discusses detailed similarities and differences involved in booting Linux on an x86-based platform (typically a PC-compatible SBC) and a custom embedded platform based around PowerPC, ARM, and others. It discusses suggested hardware and software designs and highlights the tradeoffs of each. It also describes important design pitfalls and best practices."
This discussion has been archived. No new comments can be posted.

Anatomy of the Linux Boot Process

Comments Filter:
  • by X43B ( 577258 ) on Friday February 11, 2005 @09:00PM (#11648647) Journal
    What I like about Linux is never having to reboot except when it is time for a kernal upgrade. :)
  • by El Cubano ( 631386 ) on Friday February 11, 2005 @09:01PM (#11648651)
    http://seehuhn.de/comp/bootlog.html [seehuhn.de]

    Originally posted on the debian-devel list: http://lists.debian.org/debian-devel/2004/11/msg00 547.html [debian.org]

  • Proof reading? (Score:5, Insightful)

    by FyRE666 ( 263011 ) * on Friday February 11, 2005 @09:01PM (#11648653) Homepage
    They could have at least made sure the arrows on the diagrams were round the right way!
    • They could have at least made sure the arrows on the diagrams were round the right way!

      Glad somebody else noticed that, atleast it was only in the x86 section. I figure the author was trying to research how many readers who click on the link look at the FA and are not part of some Cultural Denial Of Service attack.

      How many of you have clicked on a link just to hurt the server? How many have clicked refresh just to see how long the server stays up?

      Feel free to post anonymously if you're ashamed.

    • Re:Proof reading? (Score:4, Informative)

      by larwe ( 858929 ) on Sunday February 13, 2005 @12:04AM (#11656675)
      Hi, I'm the author of this article series, and I was steered here by my publication contact at IBM (I don't get much time to read /. - right now I'm working at a day job, this article series, my third book and some contract embedded systems engineering). Anyway, I swear to you (and can email you the original PNG!) that *I* got the arrows the right way around. Unfortunately, someone in IBM's graphics department was apparently DUI operating Adobe Illustrator. I don't always get a chance to proof the graphics before an article gets published; and that was the case for this one. I got a bite at the text, but didn't see the massaged graphics until the article hit the web. I've already poked my end of the chain to get that fixed. To people who find the article boring, I've got two comments: a) It's part of a series. I can't assume much about my readership, so I had to spend essentially the entire first three articles doing groundwork to explain what's happening in the system and why, and how to get a functional development environment working on the box. Article #4 starts giving some actual code, and article #5 will start giving some actual circuits. Unfortunately, IBM sets the release schedule, and that means you have to wait a month between episodes. They also set the article length limits, which means I can only put so much in each instalment. b) Not everything in those three articles is obvious to the lay person. Although I didn't have enough space to go into great detail, I tried to communicate some useful information I've learned in practical 32-bit systems implementation (for commercial purposes). Remember that the target audience is primarily people who are accustomed to building x86-based embedded Linux apps, and many of these people will not know or care about much of the infrastructure under their app.
  • by Claire-plus-plus ( 786407 ) on Friday February 11, 2005 @09:05PM (#11648684) Journal
    But I still found that article as boring as hell!
  • Arrows (Score:5, Interesting)

    by Bios_Hakr ( 68586 ) <xptical@gmEEEail.com minus threevowels> on Friday February 11, 2005 @09:09PM (#11648701)
    I really hate to nit-pick, but any editor should have caught that the arrows in the flow chart point the wrong way.

    Anyway, I've often wondered why the OS insists on redetecting hardware when BIOS does it for me already. I've heard that the LinuxBios actually does away with the hardware detect phase; leaving it solely to the kernel.

    If the most popular OSes out there are taking care of HW at the high level, why haven't BIOS makers taken advantage of this to reduce their workload?
    • Re:Arrows (Score:2, Informative)

      by X0563511 ( 793323 )
      Compatibility/fallback?
    • Re:Arrows (Score:5, Insightful)

      by teknomage1 ( 854522 ) on Friday February 11, 2005 @09:16PM (#11648761) Homepage
      Tradition! Seriously though, BIOS code is very old and designed to provide for the least common denominator.
    • Re:Arrows (Score:3, Insightful)

      by Apreche ( 239272 )
      If the most popular OSes out there are taking care of HW at the high level, why haven't BIOS makers taken advantage of this to reduce their workload?

      Because if you buy a motherboard and the BIOS on it makes it so that the computer will only work with Windows XP, server 2k3 and linux kernel 2.4+ people will be pissed. Some people might still want to run DOS, OS/2, Windows 95/98, kernel 2.2, or some other old busted operating system. It's there for that reason. With a linux bios your computer can pretty m
    • Re:Arrows (Score:4, Informative)

      by 0racle ( 667029 ) on Friday February 11, 2005 @09:31PM (#11648864)
      That the OS does it allows older systems to be much more useful. By ignoring whatever crap the BIOS says, my FreeBSD system can use a >8gb drive in a system with motherboard that does not support large drives. However, with a bios still there, the system can be used by a system that relies on it.
    • Re:Arrows (Score:3, Interesting)

      by Anonymous Coward
      On a PCI system, the OS doesn't really "detect" hardware -- at least not in the old Win95 sense of poking registers to figure out what's there.

      The OS just asks the BIOS for a list of PCI ID values, and loads the appropriate drivers for those IDs.
    • One of the reasons for the OS redetecting hardware is that relying on the BIOS is less portable, and sometimes BIOS has limitations which the OS doesn't.
      • One of the reasons for the OS redetecting hardware is that relying on the BIOS is less portable,

        Very true, but very ironic considering that BIOS was supposed to be the magic compatability layer.

    • Re:Arrows (Score:3, Informative)

      by iabervon ( 1971 )
      Basically, the BIOS has to manage the hardware before the OS boots. You can't rely on the OS to find the boot hard drive to load the OS from, or to arrange RAM to run the BIOS, or to interact with the user to configure the BIOS settings to determine what to boot from. This means that the BIOS has to understand the video card somewhat, hard drives, keyboards, mice, USB for some of these, PCI for others, IDE, SCSI, and so forth.

      But it doesn't have to be efficient at any of it, because you're not going to do
    • Anyway, I've often wondered why the OS insists on redetecting hardware when BIOS does it for me already.

      I'm actually glad that it does. We did the TiVo hack, and our bios didn't see the tivo harddrive at all. Luckily, linux saw it just fine and was able to mount it without a problem.
    • I've often wondered why the OS insists on redetecting hardware when BIOS does it for me already

      My BIOS sees that I have one 1GB disk; linux sees that I have a 1GB disk to boot off and a 120GB disk for data -- software is much more flexible than firmware, to the point where I wonder quite why we have the latter...

    • Anyway, I've often wondered why the OS insists on redetecting hardware when BIOS does it for me already.

      Because many BIOSes are crappy, and mis-initialize the hardware. Haven't you ever seen boot messages like "Broken BIOS screwed up ATA PIO mode, fixing..." or something along those lines?

      The BIOS is there so that boot code can print stuff on the screen and find the hard drive to boot the OS. Nothing else. It attempts to initialize hardware but it is not to be trusted.

      If the most popular OSes out the

  • by Anonymous Coward
    what's SBC? Single Box Computer? Server? System? what?
  • by Anonymous Coward


    Like, you know, a monolithic kernel?
  • Linux Boot (Score:2, Interesting)

    by jon855 ( 803537 )
    Now I understand the boot process much better, I always have started at the boot up process and wonder what the hell is Linux doing to my computer, eh, I guess I understand now better in how it boots, I want to see a comparsion between Linux and Windows... newb linux user here loves it but hates ATI support.
    • Re:Linux Boot (Score:3, Insightful)

      by Taladar ( 717494 )
      You got it wrong. Not the Linux Support for ATI is bad but the ATI Support for Linux is.
      • ATI drivers are not so bad. Performance is pretty good really (I dual boot with 98SE and play ET on both). So they're not as easy to install as NVidia's, but hey this is Linux and we don't mind getting our hands dirty. err... well I use Debian so I don't mind. :-)
  • More discussion? (Score:4, Interesting)

    by mistersooreams ( 811324 ) on Friday February 11, 2005 @09:11PM (#11648721) Homepage

    The article makes an interesting read (although the server is getting slow already), but it seems a bit short on commentary. I'm no expert on the low-level systems of Linux, so the bare facts are quite interesting, but I would have been more interested to read a comparison of the merits of the different systems.

    My impression, from the article, is that x86 versions of Linux are carrying quite a lot of legacy (from DOS et al). Does this mean that Linux on other architectures is "better" in any sense? I don't know, but I'd be interested if someone can inform.

    • by Anonymous Coward
      "My impression, from the article, is that x86 versions of Linux are carrying quite a lot of legacy (from DOS et al). Does this mean that Linux on other architectures is "better" in any sense? I don't know, but I'd be interested if someone can inform."

      Once Linux has booted, it should not matter much.

      It is more the overall architecture that is better in the sense that it is "cleaner".

      For example, you don't need an extended/logical partition hack, you can have 32-64 equivalent partitions on a PowerPC with O
  • by saskboy ( 600063 ) on Friday February 11, 2005 @09:12PM (#11648723) Homepage Journal
    I've always found it disconcerting that a verbose boot is given by default. Before Linux goes main stream on the home desktop, the distros ought to slap a plain progress bar with a pretty picture [ie. Windows clouds or logos] and not show verbose details unless something is wrong with the boot, or unusual.
    • Mandrake 10.1 doesn't have verbose as default. It has a boring little progress bar. However, I prefer verbose mode gives me something to read while my computer is booting.
      • After struggling with making my grandparents computer work with the Windows ME "recovery cd" that came with the computer (they didn't tell me I was going to be working on it, and didn't have the best of resources at hand...), I finally decided to just bite the bullet and install Debian and Gnome on it.

        I know, I know, Debian isn't exactly your "grandmother's distribution", but the distro in question is pretty irrelevant once I get to the point.

        Anyway, I set it up so they basically couldn't screw it up.
      • My experience with the Mandrake 10.1 progress bar is that it's really dumb. It will zip up to a point, then spend 95% of the time stuck there, and then zip to the end. They should just go with some simple animation like what Windows XP / OS X does.

        On a somewhat unrelated note, I have also not figured out why Mandrake 10.1 takes far longer to boot up on a much more powerful computer than my Mandrake 10.0 system.
        • by mickwd ( 196449 ) on Saturday February 12, 2005 @08:04AM (#11650970)
          "It will zip up to a point, then spend 95% of the time stuck there, and then zip to the end."

          "On a somewhat unrelated note, I have also not figured out why Mandrake 10.1 takes far longer to boot up on a much more powerful computer than my Mandrake 10.0 system."

          Somewhat unrelated ???!!!

          Why don't you try pressing Escape just before the progress bar gets stuck, and find out which particular part of the boot process is causing all the delay. Mandrake may well be trying to set up some service or some piece of hardware that you don't actually use. If so, you can remove the item in question from you setup configuration. This probably explains why Mandrake 10.1 boots slower than 10.0 for you.

          • Somewhat unrelated ???!!!

            I wish that would work. With the old computer, I would make my choice in LILO, and it would instantly start booting. With the new one, I make my choice in LILO, and get this progress bar accross the bottom of the LILO screen, which inches accross while the computer appears to be doing absolutely nothing, gets stuck almost at the end, sits there a while, then launches into the graphical boot (where ESC does work). That part goes slow but no surprises there.
            • Maybe the kernel is freezing for a while, rather than the startup scripts.

              Just on the off-chance......got a motherboard that supports serial-ATA ? My kernel would hang for 30 seconds trying to detect a (non-existant) second ATA disk. Adding "hdg=noprobe" to the kernel boot line (/boot/grub/menu.lst in my case, maybe something like /etc/lilo.conf in yours) cures this for me.
    • Most mainstream distributions already do this. For example: Fedora Core, Suse, and many others.

      Danial Howard
    • by yamcha666 ( 519244 ) on Friday February 11, 2005 @09:21PM (#11648801)
      The distributions of Linux that are aimed for the main stream home desktop do use some type of a bootsplash.

      The most notable example I can give is Xandros. The booting process shows an animated Xandros logo with very general boot details such as detecting hardware... done, and Loading Kernel ... done.

      The distros that usually don't offer a type of bootsplash by default are aimed for us power users because we want to know what's going on.

    • suse does this by default, not sure about other home distro's as i use gentoo myself.
    • I've always wished Windows would do verbose boot by default! I find nothing more disconcerting than having a Win system hang at boot with nothing but a damn logo to look at!
      • You can press ESC when Windows it loading, at least for the Windows 98 series, and it gives your autoexec and config.sys anyway if you have them set to echo. Windows 2000 and XP booting into safemode have verbose boots.
        • If you press ESC at the wrong time, however, it causes a protection fault and hangs the computer.
          • If you press ESC at the wrong time, however, it causes a protection fault and hangs the computer.

            you've got a problem with your install then. I routinly do that and have never ever had that happen

            • by Anonymous Coward
              Just between where the login screen appears and the end of boot system dies. A little bug. Found it on 2 ghz or faster machines due to the short time of boot.

              You can even do it after pressing ESC. It is simpler to do that way.
              • Just between where the login screen appears and the end of boot system dies. A little bug. Found it on 2 ghz or faster machines due to the short time of boot.

                You can even do it after pressing ESC. It is simpler to do that way.


                I seem to recall Microsoft released a patch to fix that very problem. Though I haven't worked with a "fast" Win9x system for a while now. (where fast is better than a 800Mhz Celeron)

                I always just disabled the splash screens in Win9x anyway, I think using TweakUI.
        • 2000/XP don't really have a verbose boot, just a list of drivers and such being loaded and then an NT4-style info screen (Microsoft Windows Version 5.1 (Build 2600)) if you boot with the /sos switch.
    • by arkhan_jg ( 618674 ) on Friday February 11, 2005 @09:33PM (#11648870)
      most modern distros do now, especially the livecd's and home-user orientated distros, the software that does it is called bootsplash. It relies on you having a graphic card/monitor supported by the frame buffer drivers though, so don't expect it to work on a 486. It comes in two flavours; a high res virtual terminal with a background image, or silent mode which just has a pretty screen and a progress bar until it launches gdm/kdm etc.

      If it's a server/professional workstation, the services boot loader is probably more useful. I'd sure like to have one on windows when I'm trying to troubleshoot a boot problem, without having to use safe mode - especially if the problem doesn't show up in safe mode...
      • Some people don't use the framebuffer drivers because they have a "better" xorg driver and they might be incompatible. So bootsplash doesn't work. What you can use is rhgb. When entering runlevel 5 it loads X ASAP during the boot process and has a special progress screen. When it's time to load XDM/GDM the greeter script kills rhgb but keeps the X session for itself. (This is important because if X went down and then up again, you'd have to sit through two screen blank-outs while the monitor gets re-probed)
      • I haven't tried it yet (am about to), but for Gentoo there is Gensplash [gentoo.org]

        Phillip.
    • by SEE ( 7681 ) on Friday February 11, 2005 @11:11PM (#11649285) Homepage
      Bruce Tognazzini, founder the Apple Human Interface Group and fomer Apple Human Interface Evangelist, disagrees.

      Some might be surprised to learn, however, that not only do I accept the idea of having flashing updates, such as "loading the kernel," I actually embrace it. First, it keeps the user engaged, and an engaged user is a happy user. Second, it informs. Yes, I'm aware that the only kernel most people are aware off is armed with eleven herbs and spices, but that's because no one has ever introduced them to the UNIX/LINUX kernel.


      In ancient times, before there was disk, we all used tape cassettes to store our applications. We could literally hear them as they loaded into the computer over a period of one to three minutes. (Thank heavens today's hard disks are a million times faster so that, for example, Excel can load in only a few microseconds.) One might assume the sound of a loading program would be indistinguishable from random noise, but that proved not the case. Every application and every image had a unique signature. After a while, we could tell if we'd started the wrong program just by the sound of its code.

      Today, few modem users understand handshaking protocols, but they do become used to a familiar pattern of clicks and screeches indicating normal vs. abnormal connections.

      If regular folk can come to "understand" on some level the sound of high-speed binary code, do you think they cannot absorb some lessons from being subjected to new terminology like "kernel," etc.? Such terms so often come to be useful, as when some system software programmer spits out some horrifying message like, "fatal execution of kernel." At least they won't fear their supply of fried chicken is about to be cut off.

      Entertain them. Teach them a little something, even if it seems "way over their heads." At the very least, it will keep them awake and alert.
      • That's an interesting point about keeping the user informed, even if they don't realize it. I suppose it could be more useful for troubleshooting if the last thing to freeze onto the screen is the process that is failing to load completely, but from the computers of long ago, to the modern Windows computer, a boot screen is usually just one screen long, after the POST, and essentially just says [OS] loading ...

        From the Apple ][e, to the Radio Shack Tandys, to MS-DOS 3.3, to Windows 98, these highly sucess
    • funny.... (Score:2, Funny)

      by zogger ( 617870 )
      ...I alway find that is one of the funner things with linux from day one after my first install, even if I haven't a clue what the hell is going on. I just sit there hyp-mo-tized -> LOOKATHERGO! DANGTHASCOOL!

      kinda fun in an admittedly strange way, it's also cool to see how your leet speed reading is, if you can keep up.
    • SuSE (at least 9.x) has this splash window you refer to.
    • Progress bars suck. Inevitably, they jump from 0% to 90% within seconds and then take another 2 minutes to finish the remaining 10%.

      Progress bars are from hell, I can't believe you suggested that.

  • by Anonymous Coward on Friday February 11, 2005 @09:18PM (#11648770)
    Lewin A.R.W. Edwards works for a Fortune 50 company as a wireless security/fire safety device design engineer.

    Time to stop trusting that the arrows if emergency exit signs are right now too?

    • I had the pleasure of visiting Mont Saint Michel [normandy-tourism.org] in France. Most of the signs are written in French, English, and German. One of my friends speaks some German, and he didn't recognize the German translation for exit. He probably just didn't recognize a synonym, but we got a kick out of the idea that the French had labeled the fire exit "Explosives" or some such for the benefit of their German visitors.
  • by LiquidMind ( 150126 ) on Friday February 11, 2005 @09:18PM (#11648772)
    i've noticed on SuSE that it now comes with a boot splash screen (a la Windows loading...). I know that's (somewhat) easily turned off, but really, I don't want my linux to be all fisher-price pretty. give me the rough and unadulterated command lines that are run when it boots up...make it look cool, make it intimidating, give it that matrix-esque feel...make it scare off all the n00bs that think they know everything.
    • The last thing we want to see is more people using Linux.

      Frickin' noobs, eh?
    • In that case, you probably want to use something like Gentoo. SuSE is designed to be a workstation for an average user.
    • I like to tell people that Windows is nice when everything is working the way you expect, but terrible to debug when the unexpected happens, because it's so hard to dig useful information out of the system.

      The same applies to boot splash screens. The verbose screen lets you know exactly where a fault is occurring, so you have some hope of fixing it.

      You also get a much better idea of how far you are from a useful desktop, by seeing the service names. A simple progress meter rarely updates consistently, so it

    • If you don't want "your linux" to be "fisher-price pretty" then "go turn it the hell off in your grub menu.lst". How long does it take you to remove the splash kernel parameter? A lot less time than it does to bitch on slashdot.

      I mean isn't Linux all about choice and configurability?
    • It should be friendly by default, because people who don't want it to be friendly can easily turn it off, but people who want it friendlier wouldn't know how to make it so.
  • by Anonymous Coward on Friday February 11, 2005 @09:21PM (#11648800)
    And here i Present you the BSD boot process

    1) birth
    2) death (confirmed by netcraft)
  • by pchan- ( 118053 ) on Friday February 11, 2005 @09:48PM (#11648941) Journal
    This article glosses over one point that is very critical. That is, in an embedded system, the hardware is known at compile time, as well as all the details of initializing it. On a desktop PC, the hardware configuration is a mystery everytime you boot. Who knows, maybe the user decided to move their network card to a different PCI slot and now it has a different memory address, add a hard drive, remove a sound card, take out half the RAM. This makes the boot process far more complicated. The BIOS method of dealing with this situation is archaeic and painful to use, but it works. That is, you can boot even the dumbest OS (say, DOS, or that memtest86 iso) without having that PS know anything about the hardware.

    Having written a few embedded bootloaders (and modified some others), I will say that booting an embedded device is far far easier than booting a device who's hardware (that is critical to booting) can change between boots.
    • While you're right about the difference, the truth is: when you boot a PC, 99.99% of the time the hardware is identical to what it was the last time.

      So it should be possible to store an HW description into a small flash and boot *fast*, without having to discover hardware, and if the user want to add new critical "cold-plug" hardware (such as boot disk), he would just have to hit Del at the boot, and then a HW discover would be made..

      • Perhaps there could be a BIOS Parameter to switch to "intelligent OS" to get the BIOS to skip Hardware Detection. Making the Boot Process of Linux faster does not yield much if the BIOS takes 10+ seconds to get to the Bootloader.
        • Perhaps there could be a BIOS Parameter to switch to "intelligent OS" to get the BIOS to skip Hardware Detection.

          Actually, it doesn't look like hardware detection is the cause of the big delays in BIOS. LinuxBIOS accomplishes that in a fraction of a second.

          The big delay seems to be truly horrible code, pointless self testing (I'll know the video is bad when I don't see a picture!) no reasonable standards for resource allocation between the many modular componants of BIOS requiring each module to dupl

      • Let's be realistic. 99.99 % if the time means one in 10000 boots, if you boot every day, it would take you close to 30 years before you install new hardware.
  • Stop plagiarizing! (Score:4, Insightful)

    by Osty ( 16825 ) on Friday February 11, 2005 @09:49PM (#11648953)

    From the Slashdot submission:

    This article discusses detailed similarities and differences involved in booting Linux on an x86-based platform (typically a PC-compatible SBC) and a custom embedded platform based around PowerPC, ARM, and others. It discusses suggested hardware and software designs and highlights the tradeoffs of each. It also describes important design pitfalls and best practices.
    And from the actual article:
    This installment of "Migrating from x86 to PowerPC" discusses detailed similarities and differences between booting Linux on an x86-based platform (typically a PC-compatible SBC) and a custom embedded platform based around PowerPC, ARM, and others. It discusses suggested hardware and software designs and highlights the tradeoffs of each. It also describes important design pitfalls and best practices.
    Replacing the string "This installment of "Migrating from x86 to PowerPC"" with "This article" and replacing the word "between" with the phrase "involved in" is not sufficient to serve as summarization in the submitter's own words. Somehow I have a hard time believing that the submitter "Donna" and the article author Lewin Edwards are one and the same person. If I'm wrong, then fine. You can't plagiarize yourself. If I'm correct, then Slashdot's done it again. The article summary isn't an original work by Donna, but a minor modification of the article author's own summary, and should be properly attributed as such.
    • by T-Ranger ( 10520 )
      I dont even think that you could argue that the poster implicitly tried to pass of the summary as his own work. Slashdot summaries of single articles generally dont add anything new (and frequently get it wrong). It is an abstract of the article. Since a well written introduction should itself be an abstract of the rest of the article, what makes a better abstract then a polished intro?
  • by i.r.id10t ( 595143 ) on Friday February 11, 2005 @10:04PM (#11649006)
    Open the office, turn on the computer, walk out of the office, walk across campus to the cafeteria while ogling the young college chicks, get a cup of coffee, walk back, log in, do work.
    • prep and start the coffee drip machine... turn the monitor back on... waggle the mouse... click the reload button on the browser window... that's it... fresh slashdot to read while the coffee's brewing...

      10:02:08 up 218 days, 21:51, 6 users, load average: 0.17, 0.08, 0.07
  • by Iamnoone ( 661656 )
    A couple of other posts refer to this indirectly.
    Bootchart is actually some of the coolest use of graphical display of data I have seen in a while:
    bootchart [bootchart.org]
    Some of the Solaris 10 guys even used it to improve the boot process on new releases of Solaris 10.
    The latest updates (as of a few days ago) continued to streamline the system.
  • ...and why does the PC have to boot in the outdated 16-bit console environment? The PC's strange boot environment forces operating systems to jump through hoops in order to load the kernel. Isn't it time for all PCs to boot in 32-bit flat mode (unprotected, without paging)?

A morsel of genuine history is a thing so rare as to be always valuable. -- Thomas Jefferson

Working...