Page 1 of 1

bootsector and bootloader

Posted: Sat Mar 15, 2008 12:55 pm
by kc1
Hi im having trouble figuring out the difference between a bootsector and bootloader, but what i think it is that the bootsector is in the first sector of secondary storage and is loaded first and then the bootsector can load a bootloader ?. Because isn't the bootsector used to load a bootloader like grub?

Posted: Sat Mar 15, 2008 1:31 pm
by Brynet-Inc
The first sector on a hard drive typically contains some initialization code and a partition table. (The MBR.)

Floppy drives, don't have a partition table.. so 510 bytes is available.

Most people write something basic that loads & executes their kernel, but others load a second stage boot program that either:

A) Loads a kernel that's on a file system.
B) Presents users with a menu capable of "chain loading" the first sector within a partition. (VBR)

Either way, boot loaders come in many shapes and sizes.. ;)

Someone correct me if I'm wrong.. 8)

Posted: Sat Mar 15, 2008 2:02 pm
by kc1
so if i were using GRUB as a bootloader, the data held in the boot sector would load GRUB then?

Posted: Sat Mar 15, 2008 2:27 pm
by Brynet-Inc
kc1 wrote:so if i were using GRUB as a bootloader, the data held in the boot sector would load GRUB then?
That depends on how it was installed on the drive, grub has a stage1 & stage2 loader.

I don't know enough about grub, but I'll assume it overwrites the executable code within the MBR preserving the partition table.

Anyone here know more about grub?

Posted: Sat Mar 15, 2008 4:46 pm
by nekros
A bootloader is just a program that is capable of loading a kernel or maybe another program that will load a kernel. Where it is all depends on what size it is and what device you are loading from. This could be pretty much anywhere, the bootsector is just something that gets everything running.

That is how I see it at least. :D

Posted: Sat Mar 15, 2008 5:15 pm
by Combuster
The bootsector is just that first sector of a floppy or partition that is loaded and executed. It normally contains the bootloader, or part of it.