Good Bootloader
Good Bootloader
Is it possible to write a bootloader that inits pmode, uses a FS, and loads the kernel without a stage2 ? If so.. anyone have some source?
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Good Bootloader
you can write a bootloader with limited fat12 support, which is able to find an image with a compiled-in name in the root directory and loads this to memory prior to doing all the pmode stuff.
but it is better to split it up: in a second stage loader, you 're able to do much more initialization stuff.
but it is better to split it up: in a second stage loader, you 're able to do much more initialization stuff.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Good Bootloader
FAT support and pmode initialization seems much for just 512 bytes, imho ... moreover, you'll end with very little space for error messages, etc. If i were you, i would go for a second stage, located in some reserved space (see struct ext2_super_block.s_r_blocks_count or the reserved sectors count in FAT bootsector (in Bios Parameter Bloc, iirc) )
Re:Good Bootloader
It's possible to support any file system and protected mode initialisation if you hard-code a block list in your boot loader. I believe this is the way LILO works.
Re:Good Bootloader
yeah coz each time you rebuild the kernel, you need to reapply lilo so it knows where the kernel is to load it from!
but then, if you move / alter grubs stage2, you get the same effect iirc.
but then, if you move / alter grubs stage2, you get the same effect iirc.
-- Stu --
Re:Good Bootloader
The sucky thing about block lists is that it falls apart of the kernel is changed or moved. For example, GRUB uses block lists to load its stage2 file, but everytime I defrag the drive, the stage2 file gets moved and GRUB refuses to boot. Have to manually fix it every time. Not exactly a friendly method.Tim Robinson wrote: It's possible to support any file system and protected mode initialisation if you hard-code a block list in your boot loader. I believe this is the way LILO works.
Only alternative I can think of is installing a custom bootsector for whatever filesystem your OS is installed on, which does nothing but traverse the FS and find the stage2 using the BIOS. Not much room for anything else, but at least its stable.
Re:Good Bootloader
Nairou, if you set the system attribute on your stage2 file it wont get moved by defrag.
Hope that helps.
In response to the subject I have to agree with _mark(). I dont think it's posible to write a good bootloader of that nature unless you use multiple stages like GRUB
Hope that helps.
In response to the subject I have to agree with _mark(). I dont think it's posible to write a good bootloader of that nature unless you use multiple stages like GRUB