[SOLVED] Chainloading EXT2 VBR from GRUB2: Invalid signature
Posted: Fri May 23, 2014 8:19 am
My OS kernel is loaded by a three-stage bootloader. The first stage, called stage1, is located in the MBR and is solely responsible for loading the VBR off the active partition. The VBR, or stage2, is filesystem-specific and contains just enough filesystem code to load the next stage, stage3. stage3 is much more complex, almost like a mini-kernel. It uses protected mode and paging, has a basic heap and physical memory allocator, and can load higher-half ELF binaries. Anyway, stage2 is designed so that it can either be loaded by an MBR (either stage1 or something else) or chainloaded from something like GRUB2. This is valuable in a dual-boot environment, since I don't need to overwrite the MBR to boot the kernel.
Currently, the only supported stage2 is for EXT2 filesystems. So when testing on real hardware, I write stage2 to the first 2 sectors of the partition (reserved area for VBRs) and then put stage3 on the filesystem. I added an entry to my GRUB2 configuration file to chainload this partition, but when I attempt to do so, I get an "Invalid signature. Press any key to continue..." error from GRUB2. My configuration entry for my OS is posted below. I'm completely lost with this error, and would be grateful for any help. All of my bootloader stages work in Bochs, but I'd like them to run on real hardware too.
Currently, the only supported stage2 is for EXT2 filesystems. So when testing on real hardware, I write stage2 to the first 2 sectors of the partition (reserved area for VBRs) and then put stage3 on the filesystem. I added an entry to my GRUB2 configuration file to chainload this partition, but when I attempt to do so, I get an "Invalid signature. Press any key to continue..." error from GRUB2. My configuration entry for my OS is posted below. I'm completely lost with this error, and would be grateful for any help. All of my bootloader stages work in Bochs, but I'd like them to run on real hardware too.
Code: Select all
menuentry "DarkSide OS" {
insmod ext2
insmod chain
set root='(hd0,msdos3)'
chainloader +1
}