1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Windows XP Boot Process

Discussion in 'Windows XP' started by Paul Norris, 2007/02/21.

  1. 2007/02/21
    Paul Norris

    Paul Norris Inactive Thread Starter

    Joined:
    2006/12/15
    Messages:
    37
    Likes Received:
    0
    Hi,
    I'd like to understand a bit more about the Windows (XP) boot process so am hoping that someone would be kind enough to answer my questions here or perhaps give me a link to an existing source of information.

    I've read a number of documents on this topic (such as http://www.geocities.com/asoke_dasgupta/boot-xp.html) but still don't clearly understand.....

    How does Windows decide which disk partition to boot from ?
    How can you change the boot partition, so that Windows boots from D: instead of C: say.
    What files need to be present in that partition for a successful boot ?
    How are these files created ? How can they be repaired or replaced if damaged ?

    In understanding all this, I'd like to know more about boot sectors, Master Boot Records, the boot loader and boot lists - all of which I've seeen referred to in various documents but not explained in a way that I can fully understand.

    Thanks in advance for your help.

    Paul.
     
  2. 2007/02/21
    surferdude2

    surferdude2 Inactive

    Joined:
    2004/07/04
    Messages:
    4,009
    Likes Received:
    23
    Paul, I took a few liberties to keep it as understandable for us common beings. It goes sorta like this:

    1. The computer is powered up and the BIOS chip takes control. The BIOS checks the memory and other hardware connected as well as any drives connected, based on the settings stored in the CMOS (a chip on the motherboard that contains user changable settings and has battery backup to retain those setting when power is turned off). The CMOS contains a sequencial list of the bootable devices present. The BIOS looks on the first sector of the first device in that sequence for the MBR (Master Boot Record). If not found it proceeds to the other boot devices listed, in sequence. When found, control is passed to the MBR.

    2. The MBR contains the partition information (Partition Table) for the disk as well as a small amount of code called the IPL (Initial Program Loader). The MBR reads the Partition Table into memory and passes control to the IPL. The IPL directs the process to search for a partition marked "Active." It then reads the 1st sector of that partition, which is known as the boot sector. Only one partition can be marked active on any drive. Although not required, it is good practice to always mark an active partition on any drive you install. The boot sector code is normally written when an operating system is installed to a drive or by the drive manufacturers installation software when initially installing the drive so as to make the drive “bootable.“ It defines the system type and passes control to the proper file. That file is the NTLDR in a Windows NT system such as XP. (In Win9x the boot sector code loads the IO.SYS file). (see note 3.)

    3. The NTLDR reads the BOOT.INI file which is located on the root of the primary active drive. If there is more than one operating system available, the BOOT.INI menu will be displayed for a preset period of time to allow for user selection. If no selection is made by the user, the default selection will be used when the time setting expires. If only one operating system is available, the menu will not appear regardless of the preset time value. The boot.ini file tells NTLDR where the Windows system folder is located. NTLDR then loads the NTDETECT.COM file into memory to later assist in hardware detection and passes all the information it has accumulated along to the NTOSKRNL.EXE file and releases control to it.

    4. The NTOSKRNL.EXE file loads the necessary software and hardware drivers to support the system as it is instructed by the registry located in the Windows files.

    Note 1. (If there is no BOOT.INI file present, the system can still boot if XP is installed on the primary partition of the first HDD ( C: ). In that case, the NTLDR will look for the NTDETECT.COM file on the root of the C: drive and assume that Windows is installed on that same drive.)

    Note 2. On a dual boot system with XP and any Win9x system, it is best to install the Win9x system first. Then when you install XP, it will rewrite the boot sector and replace the MSDOS code with the proper code for booting an NT type system. It will also create a file that can substitute for the MSDOS code it has removed from the boot sector and name it msdosdetect.com. That file will be placed on the root of the primary drive and an entry made in the boot.ini file so that the boot process can be given back to the MSDOS system when selected. If instead, you install Win9x after you install XP, it will rewrite the boot sector and XP will no longer be bootable unless you make repairs. The Recovery Console of XP can be used to repair the boot sector by running the "BOOTFIX" command.

    Note 3. In a dual boot situation, if you delete the primary partition it will render the dual boot inoperative. XP requires a primary active partition that can hold the necessary bootloader files in order to be bootable. That means you will always have to have a C: drive with at least the bootloader files files present or else use a different boot media to access the system. A boot floppy or CD will suffice if you construct it properly.



    SD2
     

  3. to hide this advert.

  4. 2007/02/21
    Paul Norris

    Paul Norris Inactive Thread Starter

    Joined:
    2006/12/15
    Messages:
    37
    Likes Received:
    0
    Thanks SD2 for the very quick and helpful reply. You say "Although not required, it is good practice to always mark an active partition on any drive you install" .... do you know how to actually mark an active partition or to change one so that the machine boots from a different partition ?

    Paul.
     
  5. 2007/02/21
    surferdude2

    surferdude2 Inactive

    Joined:
    2004/07/04
    Messages:
    4,009
    Likes Received:
    23
    Yes, you can mark a partition "Active" a number of ways. XP has an applet called DiskManager that will allow you to right-click a drive and set it "active. "

    That does not mean that it will be bootable however, it just means that it is possible to install an OS on it and it will be bootable. It also does not mean that it will be "self bootable" which would require it to be a primary partition on the primary drive.

    In XP, that facility is offered via the boot.ini file. If you have installed multiple systems properly, you will get a menu at boot time that allows you to select which partition you would like to boot. XP can be installed on an inactive partition and still be bootable if there is a primary drive present that contains the necessary bootloader files. Those are NTDETECT.COM, NTLDR, and BOOT.INI, although as noted earlier the boot.ini file can be missing under certain circumstances and the system will still boot.

    There are also 3rd party boot managers that can be used but i don't see the need for them in XP.
     
  6. 2007/02/21
    surferdude2

    surferdude2 Inactive

    Joined:
    2004/07/04
    Messages:
    4,009
    Likes Received:
    23
    I must add, if you have a single working drive with XP installed and install another drive in the computer that also has XP installed, you can edit your boot.ini file to reflect the new system present and allow for dual booting.

    That's why I made the comment about not needing a 3rd party boot manager. You have to do the editing manually but it's no big deal.

    BTW, XP does it for you automatically if you actually install a second system since it will detect the first installation and modify the boot.ini for you.
     
  7. 2007/02/21
    Paul Norris

    Paul Norris Inactive Thread Starter

    Joined:
    2006/12/15
    Messages:
    37
    Likes Received:
    0
    Excellent info, thanks SD2 ! Now, to show my ignorance perhaps.....
    I have a PC with two partitions, C: and D: Both partitions have copies of boot.ini (essentially identical, both pointing to the Windows OS on C: ) and also ntdetect.com and ntldr. When the PC boots it "picks" the boot.ini on the D partition (I can tell this since the OS name label which is displayed is set slightly differently). What determines this choice and how could I change it to boot entirely from the C partition info, leaving me to change/delete the D partition as I see fit.
    Thanks again, Paul
     
  8. 2007/02/21
    surferdude2

    surferdude2 Inactive

    Joined:
    2004/07/04
    Messages:
    4,009
    Likes Received:
    23
    What you are describing flies in the face of the standard set by the programmers. That's a description of corruption or perhaps an intentional re-coding of the NTLDR and I'd be hard pressed to explain it.

    The standard programming will always point to the root of the primary hard drive, which is dubbed the C: drive. Programmers have also elected to call it the system drive. When you boot any other partition, it will be dubbed the boot drive. The system drive cannot be renamed. It will always be the C: drive. The boot drive can be any drive you are able to boot secondary to a system drive.

    That said, when you boot, and eventual control passes to the NTLDR file, it will look for the boot.ini on the root of the C: drive. Being single minded as it is, it will not look on any other drive for it. If it's doing that on your system, that's quite an abboration.

    I'll venture that you can rename the boot.ini file on your D: drive and your system will boot just fine. It's not necessary to have but one copy of the boot.ini file and located as I have said, on the root of the Primary drive.

    I don't want you to experiment and inadvertantly render your system unbootable so if you decide to test what I have said, first create a boot floppy or boot CD that you can use for booting the system even when it has no bootloader files of its own. You may have such already but if not, I can supply them:

    XP Boot Floppy Creator

    XP Boot CD iso image

    Those are both good to have for emergencies when the bootloaders become corrupt or the MBR is damaged.

    To create the floppy, just double click the download and follow the screen directions. It will format and create the floppy for you.

    For the CD, depending on your burner software, you can double click it and it will copy the iso image to your blank CD. It contains a boot.ini with the same configuration as the floppy so either one operates the same.
     
    Last edited: 2007/02/21
  9. 2007/02/21
    Paul Norris

    Paul Norris Inactive Thread Starter

    Joined:
    2006/12/15
    Messages:
    37
    Likes Received:
    0
    Thanks again SD2. I'm not sure I'm brave enough to try renaming the boot.ini on the D: drive - guess I might just leave things alone since its working ok. However, the boot floppy and CD look very useful and I'll certainly save those away for a rainy day !
    Regards, Paul.
     
  10. 2007/02/21
    surferdude2

    surferdude2 Inactive

    Joined:
    2004/07/04
    Messages:
    4,009
    Likes Received:
    23
    There is much to be said for leaving things alone if they are working. :)

    However, it is also nice to have a second OS copy to experiment with if you are of that mindset. It beats the text books in many areas! I just love to jump in with my hip boots on and choke the system into submission at times. :D I get answers thereby that aren't available anywhere else. Sometimes I don't like them but they're answers none the less.

    All the best.
     
  11. 2007/02/21
    Paul Norris

    Paul Norris Inactive Thread Starter

    Joined:
    2006/12/15
    Messages:
    37
    Likes Received:
    0
    one further thought on this... is it possible that I ,might have caused the machine to boot from D: when I used the "FIXBOOT" command in the recovery console to rebuild the boot sector after a disk problem. Its just possible I might have typed "FIXBOOT D:" when I meant to type "FIXBOOT C:" .... would this then result in the machine booting from the D: partition ? And, if so, could I rectify it by going back into the recovery console and typing "FIXBOOT C:"
    Thanks, Paul
     
  12. 2007/02/21
    surferdude2

    surferdude2 Inactive

    Joined:
    2004/07/04
    Messages:
    4,009
    Likes Received:
    23
    I would say that's probably how it happened unless you have used some 3rd party boot manager at some time.

    I think running fixboot C: would be one way of returning it to normal. You may also need to run bootcfg to assist you in rewriting the boot.ini file. I prefer to do that manually since MS makes it seem much harder. For a full listing of all Recovery Console commands look here.

    While we're hot on this, I'll link you to a much better description of the boot process since mine is somewhat limited.

    Excellent boot process outline for XP
     
    Last edited: 2007/02/21
  13. 2007/02/21
    Paul Norris

    Paul Norris Inactive Thread Starter

    Joined:
    2006/12/15
    Messages:
    37
    Likes Received:
    0
    That's great, thanks again for all your help SD2.
     
  14. 2007/02/21
    surferdude2

    surferdude2 Inactive

    Joined:
    2004/07/04
    Messages:
    4,009
    Likes Received:
    23
    It was my pleasure Paul. I'll throw in another useful freebie that may prove useful to you and others that find themselves shut of Windows for various reasons and need to edit the boot.ini file from a command prompt. Many OEM machines have no install CD nor any way to invoke the Recovery Console so editing the boot.ini can be a problem on those rigs.

    The answer is BootIniEdit. It's just one more useful tool for your emergency toolbox. When run it will create a floppy with the necessary files to allow you to boot into a menu that will allow selection of the boot.ini file on any drive detected and let you edit it. Very handy at times. Of course you could create a CD with the image of the floppy it creates for use on rigs with no floppy drive.

    With this tool you can create your own boot.ini file on the fly without any worry about mucking it up and not being able to get back in. Cool deal, what?
     
  15. 2007/02/22
    Paul Norris

    Paul Norris Inactive Thread Starter

    Joined:
    2006/12/15
    Messages:
    37
    Likes Received:
    0
    Hi SD2,
    Thanks for that extra utility BootIniEdit.exe. It sounds very useful - only problem is I don't have a floppy drive and the utility won't run without one. Is there any chance you could post an ISO image someplace so that I could burn it straight to CD please ?
    Regards, paul
     
  16. 2007/02/22
    surferdude2

    surferdude2 Inactive

    Joined:
    2004/07/04
    Messages:
    4,009
    Likes Received:
    23
  17. 2007/02/22
    Paul Norris

    Paul Norris Inactive Thread Starter

    Joined:
    2006/12/15
    Messages:
    37
    Likes Received:
    0
    great, thanks very much !
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.