Fox Y2K Logo
FAT System Guide
FOXy2K
Contents

Home

FAT System Guide

The DOS Zone

My Software

 

The Boot Sector

Use this information only if you agree to the terms in my Disclaimer

    The boot sector (also called the boot record) is the very first sector on a disk it has two important functions, the first one is to load in your operating system (I'm going to ignore that since it's not relevant for this) and secondly it tells us all kinds of useful(?) information about the disk that its on. A FAT32 boot sector is actually more than one sector long, three to be precise, so I don't see how it can accurately be called a boot sector, the boot record is probably a more accurate term.

Two important things that are stored in the boot sector are the size of each sector (analogous to size of each piece of paper in a notepad), usually 512 bytes (characters in layman's terms) and the total number of sectors (how many bits of paper). With this information we can tell how much data the disk will hold.
For instance a 1.44MB 3 1/2" disk has 2,880 sectors, with 512 bytes in each sector. There are 1024 bytes in a kilobyte and 1024 kilobytes in a megabyte byte, so 2880 sectors multiplied by 512 bytes means 1440KB or 1.406MB. Now as you may know these disks do not store 1.406MB of data, the maximum you can get is 1.38MB the remaining space is used for the file system.

The boot sector also supplies information on where to find the FAT's and root directory, you'll find out what these are later if you don't already know. Other information that the boot sector holds include:

  • The name of the operating system that formatted it.
  • Sectors per cluster, you'll find out about this when you get to the data area section.
  • The maximum number of root directory entries you can have for the disk (this is explained later).
  • The volume name, this is what is displayed when you type "VOL" at a DOS prompt or what is shown in "My Computer" for Windows users. (the volume name can also be stored in the root directory.)
  • The serial number.

The boot sector is vital to be able to read the disk if this goes the operating system will not know what type/size disk it is dealing with, because of this fact the FAT32 file system stores a copy of the boot sector.

That's it for the none technical area so go on to the next section if you don't want in depth technical details if you do then keep reading.

Go Back To Previous Section.Procede To Next Section.

 

Technical Information on the Boot Sector.

If you look below you'll see a layout of the boot sector, along with other information that you'll need, this data and more is also provided in the
Quick Reference section.

The first thing you'll need to decide is how you are going to read the sectors, I'm not discussing that here because I've devoted a whole section to it later on. But if you are going to use the standard BIOS functions then you'll want to know the number of sectors per track and the total number of heads/sides, my advice is to use the fields that give this information rather than use the media descriptor byte.

The next thing that you'll need to find out is where the first FAT is located, the reserved sectors field can be used for that.

Moving on to the root directory, with FAT12/FAT16 disks you can locate it's starting location by using the "Reserved sectors", "Number of FAT's" and "Sectors per FAT" fields. The root directory starts immediately after the last FAT. With FAT32 the root directory is treated in the same way as a sub-directory would be treated, it's starting cluster is given in the in the boot sector at offset 2Ch.

You will also need to determine whether the disk is FAT32,FAT16 or FAT12, you will probably be thinking of using the "File system ID" field, do not the correct method will be described in the File Allocation Tables section.

Below you will find information on the boot record and related data, depending on how much you already know it may be advisable to go through the following sections first then come back here (or to the Quick Reference area) later.

All the data is all in Intel byte order, little endian.

You can use these links to quickly locate items that are of interest.

FAT12/FAT16 Boot Sector/Boot Record Layout.
FAT12/Fat16 Extended BPB.
FAT32 Boot Sector/Boot Record Layout.
File System Information Sector.
Media Descriptor Byte.

 

FAT12/FAT16 Boot Sector/Boot Record Layout.
The data contained in the boot sector after the OEM name string is referred to as the BIOS parameter block or BPB.
OffsetLengthField
00h3Machine code for jump over the data.
03h8OEM name string (of OS which formatted the disk).
0Bh2Bytes per sector, nearly always 512 but can be 1024,2048 or 4096.
0Dh1Sectors per cluster, valid number are: 1,2,4,8,16,32,64 and 128, but a cluster size larger than 32K should not occur.
0Eh2Reserved sectors (number of sectors before the first FAT including the boot sector), usually 1.
10h1Number of FAT's (nearly always 2).
11h2Maximum number of root directory entries.
13h2Total number of sectors (for small disks only, if the disk is too big this is set to 0 and offset 20h is used instead).
15h1Media descriptor byte, pretty meaningless now (see below).
16h2Sectors per FAT.
18h2Sectors per track.
1Ah2Total number of heads/sides.
1Ch4Number of hidden sectors (those preceding the boot sector).
20h4Total number of sectors for large disks.
24h26Either extended BPB (see below) or machine code.
3Eh448Machine code.
1FEh2Boot Signature AA55h.
Back to links

 

FAT12/Fat16 Extended BPB.
The Extended BIOS parameter block is not present prior to DOS 4.0 formatted disks.
Offset
Length (in bytes)
Field
24h1Physical drive number (BIOS system ie 80h is first HDD, 00h is first FDD).
25h1Current head (not used for this but WinNT stores two flags here).
26h1Signature (must be 28h or 29h to be recognised by NT).
27h4The serial number, the serial number is stored in reverse order and is the hex representation of the bytes stored here.
2Bh11Volume label.
36h8File system ID. "FAT12", "FAT16" or "FAT  ".
Back to links

 

FAT32 Boot Sector/Boot Record Layout.
The data contained in the boot sector after the OEM name string is referred to as the BIOS parameter block or BPB.
OffsetLengthField
00h3Machine code for jump over the data.
03h8OEM name string (of OS which formatted the disk).
0Bh2Bytes per sector, nearly always 512 but can be 1024,2048 or 4096.
0Dh1Sectors per cluster, valid number are: 1,2,4,8,16,32,64 and 128, but a cluster size larger than 32K should not occur.
0Eh2Reserved sectors (number of sectors before the first FAT including the boot sector), usually 32.
10h1Number of FAT's (nearly always 2).
11h2Maximum number of root directory entries.
13h20.
15h1Media descriptor byte, pretty meaningless now (see below).
16h20.
18h2Sectors per track.
1Ah2Total number of heads/sides.
1Ch4Number of hidden sectors (those preceding the boot sector).
20h4Total number of sectors.
24h4FAT32 sectors per FAT.
28h2If bit 7 is clear then all FAT's are updated other wise bits 0-3 give the current active FAT, all other bits are reserved.
2Ah2High byte is major revision number, low byte is minor revision number, currently both are 0.
2Ch4Root directory starting cluster.
30h2File system information sector.
32h2If non-zero this gives the sector which holds a copy of the boot record, usually 6.
34h12Reserved, set to 0.
40h1Physical drive number (BIOS system ie 80h is first HDD, 00h is first FDD)
41h1Reserved.
42h1Signature (must be 28h or 29h to be recognised by NT).
43h4The serial number, the serial number is stored in reverse order and is the hex representation of the bytes stored here.
47h11Volume label.
52h8File system ID "FAT32 ".
5Ah8Machine code.
1FEh2Boot Signature AA55h.
Back to links

 

File System Information Sector.
OffsetLengthField
0h4Leading Signature 41615252h.
4h480Reserved, set to 0.
1E4h4FSI structure signature 61417272h.
1E8h4Contains the last known count of free clusters, if this is equal to FFFFFFFFh then the count is unknown.
1ECh4Cluster number at which you should begin a search for a free cluster, if this is equal to FFFFFFFFh then the field has not been set.
1F0h12Reserved, set to 0.
1FCh4Trailing Signature AA550000h.
Back to links

 

Media Descriptor Byte.
The Media descriptor byte is meaningless because of the duplications, F0h for example.
ByteType of diskSectorsHeadsTracksCapacity
FFh5 1/4"8240320KB
FEh5 1/4"8140160KB
FDh5 1/4"9240360KB
FCh5 1/4"9140180KB
FBhboth9280640KB
FAhboth9180320KB
F9h5 1/4"152801200KB
F9h3 1/2"9280720KB
F0h3 1/2"18 2801440KB
F0h3 1/2"36 2802880KB
F8hhard diskNANANANA
Back to links
Copyright © Jonathan Fox 2000-2002.