How to get values for BIOS parameter block in a VBR?

0

I am creating a VBR, which recides on the first sector of a Volume. The VBR must have BIOS Parameter Block if FAT file system is to be implemented. When working on my disk(say), I could manage to find the value for the entries in the VBR(say bpbSectorsPerTrack ). But what if the same VBR is made to run on different system on a different volume? The values differ ri8? How am I supposed to get those values.

In short my questions are as follows :

1) Is it neccessary for the VBR values to be accurate? 2) If so, where can I get those values from?

Thanks

Request : If possible, please answer my other question which I asked another day at "stackoverflow" at https://stackoverflow.com/questions/41226127/how-to-access-the-chs-information-from-the-partition-table-of-mbr?noredirect=1#comment69651023_41226127

Im badly in need for answers.

Panther Coder

Posted 2016-12-20T17:00:13.443

Reputation: 133

Answers

1

BPB is used for storing metadata about:

  1. The geometry of the device.
  2. The position of the FS structures.

The first is relevant only for floppies.
HDDs have a fixed geometry, you can take those value from you disk BPB or simply format a USB pen driver.
Those values are the same for every device.

Note well, 4KiB sector drivers are starting to appear in the market.
So now HDDs have variable geometry too.
Finding if a device support 4KiB sectors is beyond the scope of this answer (look at the ATA/ATAPI8 specification).

The second is actually defined only for NTFS and FAT file system.
There is nothing special to do here, during the creation of the FS you know where the relevant structures are written on the disk and you create the BPB accordingly.
Wikipedia already does a great job at explaining the values of the fields and which ones can be set to zero in non-relevant contexts.


BPB is mostly used by Microsoft technologies, Unix for example uses a different scheme.

Margaret Bloom

Posted 2016-12-20T17:00:13.443

Reputation: 1 258