bootsector and bootloader

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
kc1
Posts: 3
Joined: Sat Mar 15, 2008 12:48 pm

bootsector and bootloader

Post 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?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
kc1
Posts: 3
Joined: Sat Mar 15, 2008 12:48 pm

Post by kc1 »

so if i were using GRUB as a bootloader, the data held in the boot sector would load GRUB then?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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?
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
nekros
Member
Member
Posts: 391
Joined: Wed Mar 05, 2008 9:10 pm
Contact:

Post 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
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply