Page 1 of 1

Some important questions ab't bootloaders

Posted: Tue Jul 04, 2006 11:33 am
by yonami
Hi all.

I have a some questions (important for all of us) about bootloaders.

For first, which format I should to use as Extended Bootloader - bin or aout?
Main Bootloader in MBR is reading 512 sectors, so I think it should be bin exec format with a zeros to fill last sector. Good I think?

Second is a question about GDT in MBR bootloader. Where to implement GDT? Will be better if GDT is implemented in MBR bootloader, or maybe if in Extended?

And last question about booting from floppy and hard disk differences. Sectors reading is a same code for disk, and floppy?

Thanks :twisted:

Re: Some important questions ab't bootloaders

Posted: Tue Jul 04, 2006 6:20 pm
by AndrewAPrice
yonami wrote:Hi all.
Hi!
yonami wrote:which format I should to use as Extended Bootloader - bin or aout?
Bin is easier to load and results in smaller file size. To load a.out files, just skip reading the header at the begining on the file. I don't see any disadvantages of either, but if you're tight for space then go for a flat binary.
yonami wrote:Main Bootloader in MBR is reading 512 sectors, so I think it should be bin exec format with a zeros to fill last sector. Good I think?
Sure! A lot of bootloaders do that.. Get your assembler to fill the remaining space with NOP's.
yonami wrote:Where to implement GDT? Will be better if GDT is implemented in MBR bootloader, or maybe if in Extended?
I load my kernel in real mode and load the GDT there.
yonami wrote:And last question about booting from floppy and hard disk differences. Sectors reading is a same code for disk, and floppy?
Yeah! Some hard drives use non-normal sector sizes.. But I think there's a 99% chance that you're safe in predicting that a harddrive sector is 512 bytes in size. I know for a fact that optical disc sectors are 2KBytes.
yonami wrote: Thanks
You're welcome!
yonami wrote: :twisted:
\:D/

Posted: Thu Jul 06, 2006 3:15 am
by yonami
Thanks :D