BOOTSECTOR

BOOTSECTOR STRUC

bsJump db 3 dup(?) ;E9 XX XX or EB XX 90

bsOemName db '????????' ;OEM name and version

;Start of BIOS parameter block

bsBytesPerSec dw ? ;bytes per sector

bsSecPerClust db ? ;sectors per cluster

bsResSectors dw ? ;number of reserved sectors

bsFATs db ? ;number of file allocation tables

bsRootDirEnts dw ? ;number of root-directory entries

bsSectors dw ? ;total number of sectors

bsMedia db ? ;media descriptor

bsFATsecs dw ? ;number of sectors per FAT

bsSecPerTrack dw ? ;sectors per track

bsHeads dw ? ;number of heads

bsHiddenSecs dd ? ;number of hidden sectors

bsHugeSectors dd ? ;number of sectors if bsSectors = 0

;End of BIOS parameter block

bsDriveNumber db ? ;drive number (80h)

bsReserved1 db ? ;reserved

bsBootSignature db ? ;extended boot signature (29h)

bsVolumeID dd ? ;volume ID number

bsVolumeLabel db 11 dup(?) ;volume label

bsFileSysType db 8 dup(?) ;file-system type

BOOTSECTOR ENDS

The BOOTSECTOR structure contains information about the disk (or other storage medium) for a particular drive. The structure appears at the beginning of the first sector (the boot, or startup, sector) of the disk.

Fields

bsJump

Contains a jump instruction to the bootstrap routine, which loads the operating system from the drive.

bsOemName

Specifies the name of the original equipment manufacturer (OEM) and the manufacturer's version of MS-DOS.

bsBytesPerSec

Specifies the number of bytes per sector.

bsSecPerClust

Specifies the number of sectors in a cluster. The sectors must be consecutive, and the number must be a power of 2.

bsResSectors

Specifies the number of reserved sectors on the drive, beginning with sector 0. Typically, this value is 1 (for the startup sector), unless the disk-drive manufacturer's software reserves additional sectors.

bsFATs

Specifies the number of file allocation tables (FATs) following the reserved sectors. Most versions of MS-DOS maintain one or more copies of the primary FAT and use the extra copies to recover data on the disk if the first FAT is corrupted.

bsRootDirEnts

Specifies the maximum number of entries in the root directory.

bsSectors

Specifies the number of sectors on the drive. If the size of the drive is greater than 32 MB, this field is zero and the number of sectors is specified by the bsHugeSectors field.

bsMedia

Specifies the media descriptor, a value that identifies the type of media in a drive. Some device drivers use the media descriptor to determine quickly whether the removable medium in a drive has changed. MS-DOS passes the media descriptor to the device driver so that programs can check the media type. Also, the first byte in the FAT is often (but not always) identical to the media descriptor.

Following is a list of the most commonly used media descriptors and their corresponding media:

Value Type of medium

0F0h 3.5-inch, 2 sides, 18 sectors/track (1.44 MB); 3.5-inch, 2 sides, 36 sectors/track (2.88 MB); 5.25-inch, 2 sides, 15 sectors/track (1.2 MB). This value is also used to describe other media types.
0F8h Hard disk, any capacity.
0F9h 3.5-inch, 2 sides, 9 sectors/track, 80 tracks/side (720K); 5.25-inch, 2 sides, 15 sectors/track, 40 tracks/side (1.2 MB).
0FAh 5.25-inch, 1 side, 8 sectors/track, (320K).
0FBh 3.5-inch, 2 sides, 8 sectors/track (640K).
0FCh 5.25-inch, 1 side, 9 sectors/track, 40 tracks/side (180K).
0FDh 5.25-inch, 2 sides, 9 sectors/track, 40 tracks/side (360K). This value is also used for 8-inch disks.
0FEh 5.25-inch, 1 side, 8 sectors/track, 40 tracks/side (160K). This value is also used for 8-inch disks.
0FFh 5.25-inch, 2 sides, 8 sectors/track, 40 tracks/side (320K).

bsFATsecs

Specifies the number of sectors occupied by each FAT.

bsSecPerTrack

Specifies the number of sectors on a single track.

bsHeads

Specifies the number of read/write heads on the drive.

bsHiddenSecs

Specifies the number of hidden sectors on the drive.

bsHugeSectors

Specifies the number of sectors if the bsSectors field is zero. This value supports drives larger than 32 MB.

bsDriveNumber

Specifies whether the drive is the first hard disk drive, in which case the value is 80h; otherwise, the value is 00h. This field is used internally by MS-DOS.

bsReserved1

Reserved; do not use.

bsBootSignature

Specifies the extended boot-signature record. This value is 29h.

bsVolumeID

Specifies the volume serial number.

bsVolumeLabel

Specifies the volume label.

bsFileSysType

Specifies the type of file system, given as an 8-byte ASCII string. This field can be one of the following values:

Name Meaning

FAT12 12-bit FAT
FAT16 16-bit FAT

If the name has fewer than eight characters, space characters (ASCII 20h) fill the remaining bytes in the field.

Comments

The BOOTSECTOR structure shares the first sector with the bootstrap routine and the boot-sector signature. The boot-sector signature, stored in the last two bytes of the sector, must be 0AA55h.