OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Nov 23, 2020 7:04 pm

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
User avatar

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

_________________
Working on NexBoot, a simple and lightweight GRUB replacement. and NexKe, a stable and fast microkernel. Part of the Nexware Project.


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

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

_________________
https://wiki.osdev.org/User:PeterX


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

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

_________________
Working on NexBoot, a simple and lightweight GRUB replacement. and NexKe, a stable and fast microkernel. Part of the Nexware Project.


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 2 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