OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 9:43 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Boot sector on a hard drive
PostPosted: Fri May 22, 2020 10:37 am 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
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

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: Boot sector on a hard drive
PostPosted: Fri May 22, 2020 10:53 am 
Offline
Member
Member

Joined: Fri Nov 22, 2019 5:46 am
Posts: 590
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:
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


Top
 Profile  
 
 Post subject: Re: Boot sector on a hard drive
PostPosted: Fri May 22, 2020 11:45 am 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Ok Thank you! That makes perfect sense.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group