mosa/MOSA-Project

Add support for Grub 2.06 (latest version) on virtual disk

tgiphil opened this issue · 1 comments

  • Copy bootimage.img to MBR block
  • Patch MBR as necessary
  • Copy diskboot.img to first sector block (in gap partition)
  • Patch first sector as necessary
  • Copy core.img to gap partition

References:

Notes:

  • Build virtual disk using Linux tools and then extract the core.img that was placed in the gap partition created by grub-mkimage
  • Reverse engineer how grub passes blocks between the boot stages
grub-mkimage -v -O i386-pc -d. -p\(hd0,msdos1\)/boot/grub biosdisk part_msdos fat ntfs exfat -o core.img
dd if=boot.img of=/dev/sdb bs=446 count=1
dd if=core.img of=/dev/sdb bs=512 seek=1 # seek=1 skips the first block (MBR)

Closing due to transition to Limine bootloader