How Computers Boot Up

The previous post described motherboards and the memory map in Intel computers to set the scene for the initial phases of boot. Booting is an involved, hacky, multi-stage affair - fun stuff. Here’s an outline of the process:

Boot Sequence Outline
An outline of the boot sequence

Things start rolling when you press the power button on the computer (no! do tell!). Once the motherboard is powered up it initializes its own firmware - the chipset and other tidbits - and tries to get the CPU running. If things fail at this point (e.g., the CPU is busted or missing) then you will likely have a system that looks completely dead except for rotating fans. A few motherboards manage to emit beeps for an absent or faulty CPU, but the zombie-with-fans state is the most common scenario based on my experience. Sometimes USB or other devices can cause this to happen: unplugging all non-essential devices is a possible cure for a system that was working and suddenly appears dead like this. You can then single out the culprit device by elimination.

If all is well the CPU starts running. In a multi-processor or multi-core system one CPU is dynamically chosen to be the bootstrap processor (BSP) that runs all of the BIOS and kernel initialization code. The remaining processors, called application processors (AP) at this point, remain halted until later on when they are explicitly activated by the kernel. Intel CPUs have been evolving over the years but they’re fully backwards compatible, so modern CPUs can behave like the original 1978 Intel 8086, which is exactly what they do after power up. In this primitive power up state the processor is in real mode with memory paging disabled. This is like ancient MS-DOS where only 1 MB of memory can be addressed and any code can write to any place in memory - there’s no notion of protection or privilege.

Most registers in the CPU have well-defined values after power up, including the instruction pointer (EIP) which holds the memory address for the instruction being executed by the CPU. Intel CPUs use a hack whereby even though only 1MB of memory can be addressed at power up, a hidden base address (an offset, essentially) is applied to EIP so that the first instruction executed is at address 0xFFFFFFF0 (16 bytes short of the end of 4 gigs of memory and well above one megabyte). This magical address is called the reset vector and is standard for modern Intel CPUs.

The motherboard ensures that the instruction at the reset vector is a jump to the memory location mapped to the BIOS entry point. This jump implicitly clears the hidden base address present at power up. All of these memory locations have the right contents needed by the CPU thanks to the memory map kept by the chipset. They are all mapped to flash memory containing the BIOS since at this point the RAM modules have random crap in them. An example of the relevant memory regions is shown below:

Memory Regions During Boot
Important memory regions during boot

The CPU then starts executing BIOS code, which initializes some of the hardware in the machine. Afterwards the BIOS kicks off the Power-on Self Test (POST) which tests various components in the computer. Lack of a working video card fails the POST and causes the BIOS to halt and emit beeps to let you know what’s wrong, since messages on the screen aren’t an option. A working video card takes us to a stage where the computer looks alive: manufacturer logos are printed, memory starts to be tested, angels blare their horns. Other POST failures, like a missing keyboard, lead to halts with an error message on the screen. The POST involves a mixture of testing and initialization, including sorting out all the resources - interrupts, memory ranges, I/O ports - for PCI devices. Modern BIOSes that follow the Advanced Configuration and Power Interface build a number of data tables that describe the devices in the computer; these tables are later used by the kernel.

After the POST the BIOS wants to boot up an operating system, which must be found somewhere: hard drives, CD-ROM drives, floppy disks, etc. The actual order in which the BIOS seeks a boot device is user configurable. If there is no suitable boot device the BIOS halts with a complaint like “Non-System Disk or Disk Error.” A dead hard drive might present with this symptom. Hopefully this doesn’t happen and the BIOS finds a working disk allowing the boot to proceed.

The BIOS now reads the first 512-byte sector (sector zero) of the hard disk. This is called the Master Boot Record and it normally contains two vital components: a tiny OS-specific bootstrapping program at the start of the MBR followed by a partition table for the disk. The BIOS however does not care about any of this: it simply loads the contents of the MBR into memory location 0×7c00 and jumps to that location to start executing whatever code is in the MBR.

Master Boot Record
Master Boot Record

The specific code in the MBR could be a Windows MBR loader, code from Linux loaders such as LILO or GRUB, or even a virus. In contrast the partition table is standardized: it is a 64-byte area with four 16-byte entries describing how the disk has been divided up (so you can run multiple operating systems or have separate volumes in the same disk). Traditionally Microsoft MBR code takes a look at the partition table, finds the (only) partition marked as active, loads the boot sector for that partition, and runs that code. The boot sector is the first sector of a partition, as opposed to the first sector for the whole disk. If something is wrong with the partition table you would get messages like “Invalid Partition Table” or “Missing Operating System.” This message does not come from the BIOS but rather from the MBR code loaded from disk. Thus the specific message depends on the MBR flavor.

Boot loading has gotten more sophisticated and flexible over time. The Linux boot loaders Lilo and GRUB can handle a wide variety of operating systems, file systems, and boot configurations. Their MBR code does not necessarily follow the “boot the active partition” approach described above. But functionally the process goes like this:

  1. The MBR itself contains the first stage of the boot loader. GRUB calls this stage 1.
  2. Due to its tiny size, the code in the MBR does just enough to load another sector from disk that contains additional boostrap code. This sector might be the boot sector for a partition, but could also be a sector that was hard-coded into the MBR code when the MBR was installed.
  3. The MBR code plus code loaded in step 2 then read a file containing the second stage of the boot loader. In GRUB this is GRUB Stage 2, and in Windows Server this is c:\NTLDR. If step 2 fails in Windows you’d get a message like “NTLDR is missing”. The stage 2 code then reads a boot configuration file (e.g., grub.conf in GRUB, boot.ini in Windows). It then presents boot choices to the user or simply goes ahead in a single-boot system.
  4. At this point the boot loader code needs to fire up a kernel. It must know enough about file systems to read the kernel from the boot partition. In Linux this means reading a file like “vmlinuz-2.6.22-14-server” containing the kernel, loading the file into memory and jumping to the kernel bootstrap code. In Windows Server 2003 some of the kernel start-up code is separate from the kernel image itself and is actually embedded into NTLDR. After performing several initializations, NTDLR loads the kernel image from file c:\Windows\System32\ntoskrnl.exe and, just as GRUB does, jumps to the kernel entry point.

There’s a complication worth mentioning (aka, I told you this thing is hacky). The image for a current Linux kernel, even compressed, does not fit into the 640K of RAM available in real mode. My vanilla Ubuntu kernel is 1.7 MB compressed. Yet the boot loader must run in real mode in order to call the BIOS routines for reading from the disk, since the kernel is clearly not available at that point. The solution is the venerable unreal mode. This is not a true processor mode (I wish the engineers at Intel were allowed to have fun like that), but rather a technique where a program switches back and forth between real mode and protected mode in order to access memory above 1MB while still using the BIOS. If you read GRUB source code, you’ll see these transitions all over the place (look under stage2/ for calls to real_to_prot and prot_to_real). At the end of this sticky process the loader has stuffed the kernel in memory, by hook or by crook, but it leaves the processor in real mode when it’s done.

We’re now at the jump from “Boot Loader” to “Early Kernel Initialization” as shown in the first diagram. That’s when things heat up as the kernel starts to unfold and set things in motion. The next post will be a guided tour through the Linux Kernel initialization with links to sources at the Linux Cross Reference. I can’t do the same for Windows ;) but I’ll point out the highlights.

[Update: cleared up discussion of NTLDR.]

Comments

102 Responses to “How Computers Boot Up”

  1. meneame.net on June 7th, 2008 3:25 pm

    Cómo inician las computadoras [Eng]…

    Excelente artículo para conocer la secuencia de arranque de una computadora. Y sí, el primer paso es encenderla. Visto en caballe.cat/wp/2008/06/07/com-arrenquen-els-ordinadors/…

  2. Pádraig Brady on June 8th, 2008 2:54 pm

    Nice article thanks. For a grub centric bootup description see:
    http://www.pixelbeat.org/docs/disk/

  3. Brian L on June 9th, 2008 4:46 pm

    I’m a programmer in high school, have done work with successively lower-level programming (mostly Java, C, and then assembly) but this is a great article to give a really good sense of the technical specifics that happen on startup. Thank you.

  4. Gustavo Duarte on June 9th, 2008 5:23 pm

    @Pádraig: Thanks for the link, that’s a great reference for GRUB.

    @Brian: Thank you for reading. That’s cool that you’re getting into the lower level stuff. Experience with lower-level programming makes a big difference in how effectively you design, troubleshoot, and think about software. Regardless of what you end up doing, I think it’s pretty useful stuff, not to mention it’s a lot of fun.

    Let me know if I can help out in any way with regards to questions or book recommendations or whatever. I’ve been working 60+ hours these past few weeks, but I try to reply to the comments as often as possible.

  5. Eric on June 10th, 2008 9:20 pm

    Thanks Gustavo,

    I’m not sure I can see the fun in low-level programming, maybe I’m not wired that way?

    However your post and the previous one are really excellent for internals-phobic like me. Great job!

    Eric.

  6. diN0bot on June 11th, 2008 12:13 am

    yo,
    cool post. i’m wondering about cache states surrounding reboots. ad hoc experimentation seems to show that caches are fickle. this probably depends on what kind of disk and system caches one has hardware-wise, but i was wondering if, nonetheless, you could shed some light on what gets cleared when. wrt caches, are rebooting versus reading a file > max ram comparable?
    thanks,
    diN0.

  7. Booting - Booting, Boot monitor « CK Wong’s Microscopic Universe on June 11th, 2008 1:00 am

    [...] How Computers Boot Up [...]

  8. web design company on June 11th, 2008 1:09 am

    I find this flow chart very interesting. Being something of a noob or an intermediate geek depending on how you look at how I can manipulate a machine, but my question is this: Can you link me to a similar flow chart for an AMD (64-Turion) computer. I’d like to compare the two and try to see if I can gleen some information that might be useful for me in the future. Tnx….j

  9. pligg.com on June 11th, 2008 2:46 am

    How Computers Boot Up…

    The previous post described motherboards and the memory map in Intel computers to set the scene for the initial phases of boot. Booting is an involved, hacky, multi-stage affair - fun stuff. Here’s an outline of the process:…

  10. Stuza on June 11th, 2008 5:00 am

    Your soo right when you say learning assembler is a good basis for an IT role/job.

    Many years ago I ventuered into assembler, first on the c64 then the amiga. At first i wrote viri and cracked games but then grew up and moved onto more worth while causes. This did however give me a massive advantage over most candidates at job interviews as you had a rough idea of what/how things were accomplished at lower levels irrespective of platform or manufacturer.

    If you want a job in IT, spend a few months learning assembler, its worth it ten fold over even though you may never do any in your job - i now help test and build airport baggage IT systems!

    p.s. my websites been done by my gf so don’t blame me hehe

  11. neso on June 11th, 2008 5:28 am

    very nice! brings me back in times of ol’ dos and debug.com…

  12. Richard on June 11th, 2008 5:45 am

    Wow. This is a great series of articles. I can’t wait for the next installment :). All of a sudden those opaque error messages are starting to make more sense!

  13. How computers boot up « Utkarsh on June 11th, 2008 6:29 am

    [...] computers boot up Found an excellent article explaining how the computers boot [...]

  14. Manu Kumar on June 11th, 2008 6:35 am

    How does one correct the ‘Checksum error’? I am a novice which is why I continue with ‘default settings’. I have WindowsXP (SP2) installed on a PC (Pentium III, 500MHz processing power of CPU, 378MB SD-R memory).

    Other system details of my PC are as follows:

    1.Motherboard OEM — Biostar Microtech Corp.
    2.Board Model — BIOSTAR Group M6TWG
    3.BIOS Version — Award Modular BIOS v6.00PG
    4.Chipset Vendor — Intel Corporation
    5.Chipset — 82810 810 Chipset Memory Controller Hub
    6.Southbridge Vendor — Intel Corporation
    7.Southbridge — 82801AA 8xx Chipset LPC Interface Bridge
    8.DMI/SMBIOS Version — 2.2

    To be honest, I don’t what the above details mean but I can get into the BIOS settings but I don’t know the setting values that are the correct values for my system.

    Any help would be gratefully accepted.
    Thanks and regards.
    Manu Kumar

  15. How computers boot | richardholden.info on June 11th, 2008 6:50 am

    [...] if it is occasionally too technical for me to fully understand, I still found this description of what happens when a computer is turned on and boots up interesting, probably because I like to [...]

  16. mschaef on June 11th, 2008 7:01 am

    Wonderful post, and a very nice explanation.

  17. John t Howard on June 11th, 2008 7:22 am

    Wow, what an informative post. I had no idea there was so much involved in my PC starting up! Cool stuff.

    JT
    http://www.FireMe.To/udi

  18. Surf-it-Out « Maharajan on June 11th, 2008 8:08 am

    [...] Boot Process [...]

  19. dclayton on June 11th, 2008 9:12 am

    BIOS? Isn’t that the thing that old computers used to manage the motherboard, memory, processor, and hard drives?

  20. andrewl on June 11th, 2008 9:17 am

    Your N-sector disk diagram has sectors 0, … , N-1 , N for a total of N+1 sectors.

  21. [FAQ] How Computers Boot Up - Overclock.net - Overclocking.net on June 11th, 2008 10:17 am

    [...] this little guide on reddit. It goes into more detail than others that I’ve seen on the interwebs Link __________________ BIG BROTHERWe apologize for the inconvenience IS [...]

  22. Curious Cat Science and Engineering Blog » How Computers Boot Up on June 11th, 2008 10:52 am

    [...] How Computers Boot Up Things start rolling when you press the power button on the computer (no! do tell!). Once the motherboard is powered up it initializes its own firmware - the chipset and other tidbits - and tries to get the CPU running. If things fail at this point (e.g., the CPU is busted or missing) then you will likely have a system that looks completely dead except for rotating fans. A few motherboards manage to emit beeps for an absent or faulty CPU, but the zombie-with-fans state is the most common scenario based on my experience. Sometimes USB or other devices can cause this to happen: unplugging all non-essential devices is a possible cure for a system that was working and suddenly appears dead like this. You can then single out the culprit device by elimination. [...]

  23. DrumGit, Curtis Cunningham’s blog. / links for 2008-06-12 on June 11th, 2008 8:36 pm

    [...] How Computers Boot Up : Gustavo Duarte (tags: computer boot bios) [...]

  24. links for 2008-06-12 « Mandarine on June 11th, 2008 10:37 pm

    [...] How Computers Boot Up (tags: tutorial linux learning) [...]

  25. Gustavo Duarte on June 12th, 2008 3:13 am

    @Eric: thanks! Regarding the low level stuff, that’s interesting, there are definitely people that far prefer algorithms and languages to the “machine” bits and bytes stuff. I checked out your blog, I really like Skiena’s book too - awesome book. You seem to be an algorithms / languages guy :)

    In school I did Math for my major, so I really enjoy the conceptual, hardware-free parts of the playground too. But I’m sort of in the middle - I love kernels and OSes as well. So I dunno, jack of all trades master of none for me I guess. thanks for stopping by.

    @dino: that’s a good question. Which caches are you thinking about? You should check out the Intel manuals (there are links to them in the previous) post, they explain some of the CPU caching behavior wrt to booting.

    But these are just the processor caches. There are of course the kernel caches (the page cache), hard drive controller caches (which might be 8 MB or 16MB of stuff, depending on the hardware).

    Reading a very large file for example might jack up the kernel’s page cache and the hard drive cache, but might leave a lot of caches intact like TLBs and processor L1/L2 cache potentially - after all you’re going through a lot of data but the code is in a tight loop.

    @j: For the stuff covered here, they’d be identical as far as I know. Internally there major differences in the CPU arch between Intel and AMD, but to an “external observer” they behave very much alike.

    @Stuza: I notice big differences too in people who have a decent idea of the overall system and those who don’t. Especially when it comes to troubleshooting, perf work, and fixing complex bugs - there are things that people take days to do that somebody comfortable with lower level stuff might solve in minutes. I did some cracking too back in day, man I loved that stuff, it was like solving puzzles. :)

    @neso: thanks. I too have some fond memories of DOS times.

    @Richard: thanks for the kind words - I’m glad you liked the posts. It’s great to hear from folks who enjoyed them.

    @Manu: that sounds like a CMOS checksum error right? There is a battery that keeps the CMOS configurations while your computer is powered off. Usually checksum errors happen when this battery loses its juice, and the computer starts to lose CMOS configurations when you turn it off. Then when it wakes up the configs are gone, and that’s when you get this error. Changing the battery is the most common solution afaik, and it’s a cheap thing to do.

    I don’t actually work with PC repair stuff though, so this is my guess based on my own past experience.

    @mschaef, @John: thanks!

    @dclayton: that’s right. In MS-DOS days the BIOS was used by applications and MS-DOS itself. Nowadays once the kernel takes over, the BIOS is out.

    @andrewl: thanks for catching it. HAH. So much for my math degree - not to mention doing an off-by-one in an internals post that got reddited. hehe. Anyhow, I’ll fix it, good catch.

  26. TiTi on June 12th, 2008 3:19 pm

    “The BIOS now reads the first 512-byte sector (sector zero) of the hard disk.” -> Which one if you have severals ?

    In fact WHERE is the MBR, physically speaking :
    -In the first drive on the primary connector ?
    -On the disk or inside a memory chip ?

  27. Faisal Iqbal on June 14th, 2008 2:57 pm

    A very nice article indeed You seem to be the internals guy. Btw can you suggest a bit more detailed reading on it, specifically with regard to Real Mode and the Reset Vector thing. I can’t seem to understand everything about them like why the intel processors jump to reset vector at all, or what if you don’t have 4 GB memory [yeah may sounds noob :p]

  28. Keith Brown on June 14th, 2008 8:19 pm

    Wow, I love your articles. “Stumbled upon” this one and read a bunch more on your site. Keep ‘em coming! Our interests are very much aligned, although apparently you manage to make a living at software, while for me it’s only a hobby. Yes, I’m a language dabbler… I used to run my own server too, but I don’t have the bandwidth you do. Heavy sigh. I’m also a licensed pilot and air traffic controller, so your comparison of aviation safety to software security was fascinating.

  29. Gustavo Duarte on June 16th, 2008 4:38 am

    I apologize for the delayed replies, I’m delivering a project tomorrow and hence have been working intensely.

    @TiTi: the MBR _is_ on the disk, absolutely. It’s written on disk platters like any other data, it’s completely part of the disk. As to which disk you boot, you get to configure that in the BIOS. It’s usually configured on a disk-bus basis, such as “Boot the IDE Master on IDE channel 0″ or “Boot the disk in SATA 1″.

    @Faisal: I’m very ignorant, I just like this stuff for a hobby. You should think of the reset vector thing as a protocol. Intel sells all these CPUs, and they need to behave in a certain way for people to stick them in various devices. So Intel says, “OK, listen, when the CPU fires up, it’ll try to read memory at place XYZ and execute whatever it finds there.” Then the hardware guys can say: “Ah ok. Then whenever I build something - motherboard, satellite, whatever - that uses Intel, I know that what I need to do to keep the CPU happy is feed it XYZ”.

    You should read my post on the chipset though at http://duartes.org/gustavo/blog/post/motherboard-chipsets-memory-map
    That should clarify why you don’t actually need 4 gigs of RAM.

    @Keith: that’s cool, thanks for the kind words :) I am hoping to get my pilot license at some point as well, maybe next year as right now I don’t have _any_ time for it. And I hope to have a better writing schedule once I’m done with my current death-march project at work.

  30. 3HeadedMonkey on June 17th, 2008 12:28 am

    That’s a really great description, makes it all really clear. I wish you were around when I was studying computer science.

  31. Trevor on June 18th, 2008 8:03 am

    Gustavo-

    I just wanted to Thank You for the great articles, I thoroughly enjoyed the info which satisfied some long-time curiosities I’ve had and shed some light on processes I never understood. This info will really help next time I build a PC and have to troubleshoot those infamous motherboard beeps.

    Keep up the good work!

  32. Gustavo Duarte on June 18th, 2008 2:25 pm

    @3HeadedMonkey: did you get your handle off of Monkey Island, the LucasArts game? :) Anyhow, thanks for reading.

    @Trevor: you’re very welcome!

  33. Joel Thomas on June 20th, 2008 10:51 pm

    Great writeup and information.

  34. Miguel Santos on June 21st, 2008 4:23 pm

    É muito bom encontrar este tipo de informção de forma simples e bem explicada como no seu artigo. Está de parabens.

  35. JohnPaul on June 21st, 2008 4:55 pm

    Gustavo: Very interesting explanation. I am glad I found a group of people that acknowledges the importance of lower level in the computer world, unlike what I call the “Windows generation” people that have NO idea what really happens behind a nice looking GUI.
    Anyways, my question is, is there a link or maybe you know the answer Gustavo, about when does exactly a PC obtain its IP address for the purpose of connecting to the Internet?

  36. The Kernel Boot Process : Gustavo Duarte on June 23rd, 2008 2:31 am

    [...] previous post explained how computers boot up right up to the point where the boot loader, after stuffing the kernel image into memory, is about [...]

  37. Tom Amoth on June 24th, 2008 10:22 am

    I am making a comment on the following statement:
    2. Due to its tiny size, the code in the MBR does just enough to load another sector from disk that
    contains additional boostrap code. This sector might be the boot sector for a partition, but
    could also be a sector that was hard-coded into the MBR code when the MBR was installed.

    This statement at least puts on the appearance of implying the single-sector
    MBR is too tiny to do more than read a single record from another part of the HD–which is quite inaccurate. Boot code uses interrupt 13(hex) to read the HD; this command can read up to 127 sectors at a time just as easily as one sector. This interrupt is among many described in the book,
    ‘The Undocumented PC’ which gives comprehensive information on how to use such features–unlike, say, Peter Norton’s ‘Inside the IBM PC’ which merely lists the kinds of things int13 can do but doesn’t tell what to load in what registers. A 512-byte sector is ample space to include the partition table, code to search said table, and error messages.
    One thing the DOS/Windows MBR code does immediately is to move itself
    to location 0×3C00 so a boot from a partition can be loaded into 7C00.

  38. pligg.com on June 25th, 2008 6:10 am

    How Computers Boot Up…

    Explains x86 boot sequence…

  39. JSchmidt on June 25th, 2008 12:15 pm

    Ref: JohnPaul #35

    Umm… I only know Windows - but I doubt IP is from boot in linux

    A computer determines it’s IP address well after boot. It is determined in user-code, through one of the Services. Depending on whether you have a live connection (Cable, DSL) or not, your IP is determined right away, or later when you attempt to connect (dialup).

    There are two main types of IP address ‘getting’.
    Static IPs are … static … meaning that they don’t change and they don’t have to be searched for. These are assigned manually by “your network administrator” (yeah right.) However, dynamic IPs are determined from your ISP or router (whichever comes first). This is through the DHCP service, so if you use static IPs, you shouldn’t need this service. However, if your computer locks on Assigning IP Address… then check to see if this service is disabled.

    Windows accesses the internet through a Default Gateway which is the IP address of your router inside your network (something like 192.168.0.1), or the IP address of your ISP (dialup). Names such as “google.com” are resolved into IP addresses through DNS servers, which are either provided by your ISP and manually entered, or automatically. Check services DNS Client and/or DHCP for these type of errors.

  40. siva on June 27th, 2008 2:55 pm

    This article was quite detailed and elaborate!
    I am amazed at how you have managed to keep it simple enough to understand and yet explain all the basic features. Kudos!

    -Siva!

  41. JohnPaul on June 29th, 2008 7:56 am

    JSchmidt#39.
    Thank you for the information. It makes sense that for dynamic assignment, it is a (Windows) service during the boot process that initiates the process of obtaining the IP address.

    Note to Gustavo: Congrats again for setting up this site the way you did!!

  42. Sonny on June 30th, 2008 11:05 am

    As a person interestd in computers and how to save the data. I find this information very interestng and easy to follow.

    Thanks for writing it

  43. Gustavo Duarte on July 1st, 2008 10:19 am

    @JohnPaul: sorry I didn’t get to your question in time. I am planning some posts on network stuff though.

    Thank you all for the feedback!

  44. Justin Blanton | How computers boot up on July 2nd, 2008 12:57 am

    [...] How computers boot up. [...]

  45. Vatsa on July 6th, 2008 10:26 pm

    Very nice article, I am a software engineer working in the industry for more than 4 years, ashamed to say that i hardly knew whats happening during bootup.

    Nice overview article, thnx for this!!

  46. Linkdump: Teorija kategorija, kako radi kernel… by Nikola Plejić on July 7th, 2008 4:13 am

    [...] Chipsets and the Memory Map, How Computers Boot Up i The Kernel Boot Process Za one koje zanima kako računala rade iznutra, Gustavo Duarte je napisao [...]

  47. The Kernel Boot Process « Vietwow’s Weblog on July 8th, 2008 8:08 am

    [...] by vietwow on July 8, 2008 The previous post explained how computers boot up right up to the point where the boot loader, after stuffing the kernel image into memory, is about [...]

  48. How Computers Boot Up « Vietwow’s Weblog on July 8th, 2008 8:20 am
  49. The Annotated colorForth1 MASM Listing, part 2. at ColorForth Community Blog on July 8th, 2008 9:55 pm
  50. Gustavo Duarte on July 9th, 2008 5:07 am

    @Vatsa: thank you.

  51. Khan Md Ashraf on July 14th, 2008 6:15 am

    “If things fail at this point (e.g., the CPU is busted or missing) then you will likely have a system that looks completely dead except for rotating fans. A few motherboards manage to emit beeps for an absent or faulty CPU, but the zombie-with-fans state is the most common scenario based on my experience.”
    In my experience out here in the south of India is the same if the connector edge of the RAM modules are coated (dirty). Shining (with a pencil eraser) the connector edge of the RAM (if it has not failed) can get the machine to boot up from a state as above. It should be ensured that removing, cleaning and reinserting the RAM module be done with the power cable to the PC removed. If you are in a low discharge environment then ensure that you have or grounded yourself. Avoid holding/touching the RAM module connector edges.

  52. Gustavo Duarte on July 15th, 2008 12:39 am

    @Khan: that’s right, this matches my experience as well. Missing RAM == zombie state. I’ll edit to include this, thanks for pointing it out.

  53. Regular (S)expressions :: Entries :: linkz on July 16th, 2008 1:33 am

    [...] boot process; http://duartes.org/gustavo/blog/post/kernel-boot-process The previous post explained how computers boot up right up to the point where the boot loader, after stuffing the kernel image into memory, is about [...]

  54. Alfredo Reino » Archivo del Blog » Cómo arrancan los ordenadores on July 16th, 2008 8:04 am

    [...] How computers boot up [...]

  55. Jason on July 16th, 2008 5:59 pm

    How (Intel Bios Based) Computers Boot Up

  56. Alex Ionescu on July 16th, 2008 11:59 pm

    It’s worth nothing that Vista’s boot process is different, since NTLDR is gone. You’ve also not touched on ntdetect.com which is used on 32-bit Windows to query the BIOS for non-PnP devices. Finally, note that in Windows, the switch to protected mode is done as one of the first steps in NTLDR, so there’s almost no code that runs in Real Mode, except ntdetect.com which is called through a special identity-mapped jump.

    Also, EFI radically changes all this (ie: on Windows 64-bit and Intel Macs).

  57. Kilian Hekhuis on July 17th, 2008 1:43 am

    Unreal mode is not “a technique where a program switches back and forth between real mode and protected mode”, as is aptly described in the linked Wikipedia article. It’s a technique that allows accessing memory above one megabyte when on realmode. It is set up by switching to protected mode and back, once. Not ‘back and forth’. One could go back and forth between rm and pm to fill memory above 1MB though (loading below 1MB, switch to pm, copy to above 1MB, etc.).

  58. Gustavo Duarte on July 17th, 2008 1:57 am

    @Alex: wow, thanks for stopping by. I’m planning on doing a post centered around the Windows boot and go into more detail. Maybe I’ll send you a draft to review if you’ve got time. The EFI stuff had to stay out due to space. It’s a tough format, blog posts.

    @Kilian: right, this memory fill is exactly what is happening here. I’ll fix the language so it’s not misleading.

  59. Weblog of Quests » Computer booting process on July 17th, 2008 7:30 am

    [...] How computers boot up [...]

  60. Luke on July 20th, 2008 8:18 am

    Part of the multiboot spec (which Linux does not conform to BTW) states that when GRUB jumps to the kernel entry point the machine (PC’s in this case) will be in protected mode already.

  61. tsood on July 24th, 2008 3:24 am

    nice post . u make it soo easy to understand

  62. john donaghan on July 28th, 2008 8:12 pm

    Interesting!

  63. Memory Translation and Segmentation : Gustavo Duarte on August 13th, 2008 12:19 am

    [...] real mode, such as during early boot, the segment selector is a 16-bit number specifying the physical memory address for the start of a [...]

  64. Abdo on August 25th, 2008 4:30 am

    Very nice article. Thanks for sharing.

  65. Andy on August 26th, 2008 2:07 am

    Hey there Gustavo and the rest. I have this irritating problem: my PC just won’t boot. Specs: 1.6Ghz, 20 Gb 128 Mb. Mercury motherboard PVCL3266M-L V3OA.
    The message I get is: No boot device. When I get to the CMOS settings there are not detected drives (including the CD ROM). I read somewhere that I needed Raid and SATA controller drivers but I just don’t know where to download them and how to install them in this ‘dead’ machine of mine. Another thing, How can one create a rescue disk from the using a windows 2000 operating system? Even in XP? Am a newbie so please don’t bruise my brain with jargon.

  66. Gustavo Duarte on August 28th, 2008 1:11 am

    @Andy: By the time you’re in the BIOS, there are no 3rd party drivers loaded or anything like that. All of the code running in the BIOS is hard-coded is stored in your motherboard, and it should be able to detect all the devices in the computer.

    Did this happen all of a sudden? You might want to check the cables that connect the devices to the motherboard (gray IDE cables). Did anything change on the computer?

    Sorry, it’s hard to troubleshoot remotely and I’m very pressed for time lately.

  67. Xero on September 6th, 2008 10:15 am

    Thank you Gustavo for such interesting information. You present it in a way that is easy to understand.

  68. ELIAS DA SILVA on September 12th, 2008 1:00 pm

    me passe esse artigo em portugues,???

  69. gxfan on September 22nd, 2008 9:06 pm

    好文章啊,非常感谢。

  70. Anand on October 19th, 2008 4:50 am

    Hi Gustavo Duarte,
    Why not BIOS have functionality of MBR(stage1 and stage2 or bootloader)?
    I am thinking OS writer should not have to worry about MBR code…BIOS will handle these task of bootloader.

    I know i am wrong…..plz tell me Why i am wrong?

    Thanks,
    Anand :)

  71. Confluence: Booting on October 27th, 2008 1:10 am

    Booting - Further reading…

    Booting Further reading How Computers Boot Up…

  72. rasisa on October 28th, 2008 4:25 pm

    i really enjoy this note but i need more to upgrade myself with it until then see youi

  73. mw » Blog Archive » x86 hardware/software boot process in detail on November 3rd, 2008 7:29 pm

    [...] BIOS initialization, and loading of the MBR [...]

  74. akallam on November 22nd, 2008 6:33 pm

    hi Gustav very nice article,
    but one i didn’t understand is,above memory mapping diagram 4GB memory,(is that BIOS ROM or RAM??).what is jump instruction??

  75. noobie on December 7th, 2008 4:12 am

    Hi Gustavo,

    Excellent site!! Superb explanation of the chipsets and the boot process (I have read only these two so far, I’m sure i’ll enjoy the others too..).

    One question though… you mention: “the partition table is standardized: it is a 64-byte area with four 16-byte entries describing how the disk has been divided up ”
    Does this mean a maximum of 4 partitions can exist on a disk. This would mean a max of 4 OSes can be installed on a disk? Is this correct?

  76. Gustavo Duarte on December 7th, 2008 1:52 pm

    @noobie: good catch ;) You’re right that if only ’standard’ partitions were used, the disk would indeed be limited to 4 partitions and, realistically, 4 OSes.

    However, people came up with the idea of an extended partition. You can mark one of the 4 partitions in the MBR as an extended partition, which tells the OS that it should look for ANOTHER partition table to describe the extended partition. These can be daisy chained so that you can create an infinite number of partitions, subject only to drive space.

  77. noobie on December 7th, 2008 10:15 pm

    Got it, thanks a lot Gustavo! Your posts are great, I wonder why more books are not as interesting as your! Do keep posting more UNIX/Linux Internals stuff!

    Thanks,
    noobie

  78. nani on December 9th, 2008 7:38 am

    how to booting proccess in clearly please….sir/mam

  79. Few Links browsed and liked to explore… « It’s Alright!! on January 2nd, 2009 12:41 pm

    [...] How Computers Boot Up - is nicely presented as much as needed to knowMotherboard Chipsets and Memory Map [...]

  80. Ya-tou & me » Blog Archive » Memory Translation and Segmentation on February 19th, 2009 1:47 am

    [...] real mode, such as during early boot, the segment selector is a 16-bit number specifying the physical memory address for the start of a [...]

  81. Ya-tou & me » Blog Archive » The Kernel Boot Process on February 19th, 2009 1:48 am

    [...] previous post explained how computers boot up right up to the point where the boot loader, after stuffing the kernel image into memory, is about [...]

  82. The Kernel Boot Process « Linux Admin Blog on February 19th, 2009 6:36 am

    [...] Kernel Boot Process The previous post explained how computers boot up right up to the point where the boot loader, after stuffing the kernel image into memory, is about [...]

  83. juan torres on February 19th, 2009 7:52 pm

    My computer boot when start, its there anything I can do remove that and get window to stars? or that computer its history.

  84. Mayank K. Kothari on March 6th, 2009 11:31 pm

    Hi Gustavo
    Great essay on BIOS. However, I am truly frustrated to see that whereas I can tweak BIOS under Linux and Mac OS without any problem but I cannot do it so easily under the Windows OS. Why can I not boot Windows from an USB device, is an understatement of the cabal. On the other hand, this is a blessing in disguise. The illegal monopolist is under my boycott.

  85. Dheeraj Nambiar on April 1st, 2009 9:55 pm

    Dear sir,
    It’s an Excellent essay about the booting process.It has a great information about the system boot features.Expecting more.

  86. Roshin Joseph on April 1st, 2009 10:08 pm

    It is very useful to students & i liked it for it’s siple language&simplicity

  87. MMF on April 7th, 2009 10:49 am

    Thanks a lot

  88. pradeep on April 28th, 2009 9:01 am

    Hi i want to how system starts when power is on…in detail..in steps…

  89. manas on May 6th, 2009 2:57 pm

    Thank you sooooooo much!!!!!!!!!!!!!!!!!!!!

    This was very helpful!…could not find such an article anywhere else on the web.

  90. Electrical Future on May 7th, 2009 12:25 am

    Thank you for the great article ! Exactly what I needed to understand and get me started on programming an OS (Of course these are the words of an OS nooblet)

  91. SSEMAKULA WYCLIFE on May 8th, 2009 11:27 am

    great can any body help me with some good tutalials of Adobe.

  92. Tagz | "How Computers Boot Up : Gustavo Duarte" | Comments on May 16th, 2009 9:53 am

    [...] [upmod] [downmod] How Computers Boot Up : Gustavo Duarte (duartes.org) 1 points posted 11 months, 1 week ago by SixSixSix tags imported howto hardware [...]

  93. Tomasz on August 13th, 2009 12:59 pm

    Hello!
    Gustavo all Your artciles are so great !!!

    I have only one question, which i can’t understand from long time:
    Why BIOS functions can’t be accessible from Protected Mode?
    It means - i know Real Mode has completely different addressing (and much more, and beside BIOS functions wouldn’t be usefull for modern OSes) - but why BIOS manufactures didn’t do something additional like “BIOS functions for Protected Mode”?
    Is there something about Protected Mode, that makes BIOS completely unpossible?
    (sorry for my poor grammar)

  94. The Happy Living Blog » How Computers Boot Up on October 2nd, 2009 5:53 am

    [...] inside’ etc etc). Anyways I did some online searching and found this great post on How Computers Boot Up. It helped me to reformat my pc and now things are [...]

  95. Mike on October 16th, 2009 12:27 pm

    Gustavo, Can I have an your opinion. When I boot my server 2003 machine, right after POST, I get “Event Log Full” error in RED on my screen and the boot process halts until I press a key. Any thoughts on what might be causing this. thank you,

  96. Karthik on October 29th, 2009 10:28 am

    Hi,

    Here the “important memory regions during boot” refers to 4 GB of memory. Shall I know which memory it is ? RAM ? if so 4 GB is assumed ? or ROM ?

    Thx in advance

  97. Utkarsh Shigihalli » Blog Archive » How computers boot up on November 10th, 2009 3:18 am

    [...] an excellent article explaining how the computers boot [...]

  98. MARTA on November 23rd, 2009 1:29 pm

    I’m studying It Essentials (Cisco). Your article has helped me a lot. Thanks.

  99. Interesting Reading… – The Blogs at HowStuffWorks on January 11th, 2010 11:12 am

    [...] How Computers Boot Up – “Booting is an involved, hacky, multi-stage affair – fun stuff. Here’s an outline of the process…” [...]

  100. Abdul on January 30th, 2010 6:24 am

    I have 2 questions:

    (1) The first instruction to be executed by a CPU after the reset is 0Xfffffff0. That is 16 bytes short of 4G. What happens when the physically installed RAM is say just 1 G?

    (2) Who puts that jump instruction at the address 0Xffffff0?

    Thanks,

  101. Natarajan on February 10th, 2010 3:18 am

    Hi Abdul,

    Here is the ans for ur query

    1. Basically the address which [F000:FFFF0] CPU looks to execute after reset is a Memory Mapped Address - Its not a physical address. So How much physical memory you installed on system doesn’t affect reset vector address.
    In fact during this time memory is not yet initialized so system does even know whether you have 1GB RAM or 4GB RAM.

    2.Chipset vendor needs to provide this detail.

  102. gaurav on March 5th, 2010 10:23 am

    HI dear

    there is good info about this n i m a Bsc-it engineers as well as MCSE certified Your article has helped me a lot thanx………

Leave a Reply