Page 1 of 1
Boot sector on a hard drive
Posted: Fri May 22, 2020 10:37 am
by nexos
Hello,
I was wondering how you go about implementing a hard drive bootsector with FAT32. How would you put the BIOS parameter block on disk? How do you format it?
Thank you for your help
Re: Boot sector on a hard drive
Posted: Fri May 22, 2020 10:53 am
by PeterX
nexos wrote:Hello,
I was wondering how you go about implementing a hard drive bootsector with FAT32. How would you put the BIOS parameter block on disk? How do you format it?
Thank you for your help
Why not let your favorite tool (like parted etc.) format the partition. And when you write code to the partition's bootsector, skip the BPB.
Something like this:
Code: Select all
dd if=bb.bin of=/dev/sda1 bs=1 count=3
dd if=bb.bin of=/dev/sda1 bs=1 seek=96 skip=96
Note that I don't guarantee that 96 is correct, because there are several versions of BPB around (with different size).
Greetings
Peter
Re: Boot sector on a hard drive
Posted: Fri May 22, 2020 11:45 am
by nexos
Ok Thank you! That makes perfect sense.