0

From http://www.ibm.com/developerworks/library/l-bootload/index.html

Boot loaders are usually configured in one of two ways: either as a primary boot loader or as a secondary boot loader.

Primary boot loaders are where the first stage of the boot loader is installed on the MBR (per the previous description).

Secondary boot loaders are where the first stage of the boot loader is installed onto a bootable partition.

A separate boot loader must then be installed into the MBR and configured to pass control to the secondary boot loader.

Should "first" in "Secondary boot loaders are where the first stage of the boot loader is installed onto a bootable partition" be "second" instead?

Where is the secondary boot loader stored? Not in MBR where the primary boot loader is stored?

What is "a separate boot loader" in the last sentence? Is it the primary or secondary boot loader?

is the primary boot loader the same concept as the initial program loader (IPL, mentioned in the same link)?

Due to the very small amount of data the BIOS can access, most boot loaders load in two stages. In the first stage of the boot, the BIOS loads a part of the boot loader known as the initial program loader, or IPL. The IPL interrogates the partition table and subsequently is able to load data wherever it may exist on the various media. This action is used initially to locate the second stage boot loader, which holds the remainder of the loader. The second stage boot loader is the real meat of the boot loader; many consider it the only real part of the boot loader. This contains the more disk-intensive parts of the loader, such as user interfaces and kernel loaders. These user interfaces can range from a simple command line to the all-singing, all-dancing GUIs.

Thanks!

3

There is an ambiguity in that text actually. Primary boot loader doesn't mean the first stage of a boot loader, and secondary boot loader doesn't mean the second stage of a boot loader.

First stage of a boot loader is the program resides in MBR data which holds partition information and capability to handle very basic disk I/O operations those cannot accomplish to fully load the O.S since MBR boot loader code size is limited to 448-bytes for standart MBR records (lower for spesific O.S implementations, since partition table holds 4*16-Bytes)

First stage of the boot loader's job is to simply load the second stage which now nows the O.S spesifics and it has much more code space. As far as I remember, NTFS second boot loader has 16 512-bytes sectors to load O.S kernel, 8-KBytes.

Primary and secondary terms come in where there are multiple O.S.es to choose to boot. Each O.S has its boot loader that has first and second stages, each boot loader should start from stage one since the primary boot laoder in MBR shouldn't be expected to know about spesifics of the second stages in every boot loader.

Second stages are stored on the beginning of the partition itself which is called VBR, Volume Boot Record.

When there is one O.S to boot, MBR program (IPL) is the first stage and VBR program is the second stage. When there are multiple O.Ss, MBR program becomes the first stage of the primary boot loader, that stage know there are some code in some partition which is second stage to fully load the whole menu and options, and loads it. That second stage knows about the partitions which has VBR, and continues with VBR, now VBR became secondary boot loader.

Yes, I said "each boot loader should start from stage one since the primary boot laoder in MBR shouldn't be expected to know about spesifics of the second stages in every boot loader.". It is why VBR code also has MBR code in itself, too. Windows VBR codes have it.

  • In my laptop, Windows and ubuntu were installed one after another on different partitions of the hard drive. When I installed Ubuntu, I installed GRUB as the boot loader. So are the boot loaders for both Ubuntu and Windows GRUB? – Ben Jan 26 '14 at 2:50
  • No, you primaryly have GRUB. GRUB reads windows's and ubuntu's VBR. Then it loads the selected VBR as secondary boot loader. – The_aLiEn Jan 26 '14 at 2:53
  • Thanks! Is my following understanding correct? (1) Each OS has its own boot loader. The one for ubuntu is GRUB, and what is the boot loader for Windows 7? (2) The first stage of GRUB is installed in the MBR of the drive, so GRUB is the primary boot loader, and the boot loader of Windows 7 is the secondary boot loader. The second stage of GRUB is stored in the VBR of the Ubuntu partition, and the boot loader (including both its first and second stages) of Windows 7 is stored in the VBR of the Windows partition. – Ben Jan 26 '14 at 3:51
  • (4) When booting Ubuntu, the first stage of GRUB in the MBR will load the second stage of GRUB in the VBR of Ubuntu partition. When booting Windows, the first stage of GRUB in the MBR will load the first stage of the boot loader of Windows stored in the VBR of the Windows partition, which in turned loads the second stage of the boot loader of Windows stored in the same VBR? – Ben Jan 26 '14 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.