From 9f5d89440e5219d9aef61461cc3ac6a90baccc9c Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sat, 29 Dec 2018 00:40:00 -0500 Subject: Copy correct number of bytes for floppy BPB The Bios Parameter Block (BPB) is 51 bytes, not 52. As-is, the first byte of executable code from the floppy image boot record is copied along with the BPB to boot.img; this extra byte isn't harmful to leave in since execution begins at offset 0x63+2 rather than 0x3C+2, but is a little messy. --- projects/grub/grub-helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'projects') diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper index 3a74095f..ce874070 100755 --- a/projects/grub/grub-helper +++ b/projects/grub/grub-helper @@ -278,7 +278,7 @@ grub_floppy_image_make_bootable() { local oem_name='\x4C\x49\x42\x52\x45\x20\x20\x20' # write $floppyimg Bios Parameter Block to $bootimg first - dd if="$floppyimg" of="$bootimg" bs=1 skip=11 seek=11 count=52 conv=notrunc + dd if="$floppyimg" of="$bootimg" bs=1 skip=11 seek=11 count=51 conv=notrunc dd if=<(printf "$oem_name") of="$bootimg" bs=1 seek=3 conv=notrunc dd if=/dev/zero of="$floppyimg" count=1 conv=notrunc dd if="$bootimg" of="$floppyimg" conv=notrunc -- cgit v1.2.3-70-g09d2