DEVICEPARAMS

DEVICEPARAMS STRUC

dpSpecFunc db ? ;special functions

dpDevType db ? ;device type

dpDevAttr dw ? ;device attributes

dpCylinders dw ? ;number of cylinders

dpMediaType db ? ;media type

;Start of BIOS parameter block (BPB)

dpBytesPerSec dw ? ;bytes per sector

dpSecPerClust db ? ;sectors per cluster

dpResSectors dw ? ;number of reserved sectors

dpFATs db ? ;number of file allocation tables

dpRootDirEnts dw ? ;number of root-directory entries

dpSectors dw ? ;total number of sectors

dpMedia db ? ;media descriptor

dpFATsecs dw ? ;number of sectors per FAT

dpSecPerTrack dw ? ;sectors per track

dpHeads dw ? ;number of heads

dpHiddenSecs dd ? ;number of hidden sectors

dpHugeSectors dd ? ;number of sectors if dpSectors = 0

;End of BIOS parameter block (BPB)

DEVICEPARAMS ENDS

The DEVICEPARAMS structure contains device parameters for the medium in a given logical drive.

Fields

dpSpecFunc

Specifies the special function or functions to be carried out by Set Device Parameters (Interrupt 21h Function 440Dh Minor Code 40h). This field can contain some combination of the following values:

Bit Meaning

0 0 = Use the fields dpBytesPerSec through dpHugeSectors to set the default BIOS parameter block (BPB) for this device.
  1 = Use the device BPB for all subsequent Build BPB requests.
1 0 = Read all fields.
  1 = Ignore all fields, but read the TRACKLAYOUT structure appended to the end of the structure.
2 0 = Do not use.
  1 = The sectors in the track are all the same size, and the sector numbers are in the range 1 through the total number of sectors on the track. This bit should always be set.

All other bits are reserved and must be zero.

dpDevType

Specifies the device type. This field can be one of the following values:

Value Meaning

00h 320/360K
01h 1.2 MB
02h 720K
03h 8-inch, single-density
04h 8-inch, double-density
05h Hard disk
06h Tape drive
07h 1.44 MB
08h Read/write optical
09h 2.88 MB

dpDevAttr

Specifies device attributes. This field can contain some combination of the following values:

Bit Meaning

0 0 = The medium is removable.
  1 = The medium is not removable.
1 0 = Disk change-line is not supported (no door-lock support).
  1 = Disk change-line is supported (door-lock support).

All other bits are reserved and must be zero.

dpCylinders

Specifies the maximum number of cylinders that the physical device can support. This information is set by the device.

dpMediaType

Specifies which medium the drive currently accepts (for drives that accept more than one media type). For a 1.2-MB drive, if bit 0 is clear, it indicates that the drive accepts quad-density, 1.2-MB disks (the default media type); if bit 0 is set, the drive accepts double-density, 320/360K disks.

dpBytesPerSec

Specifies the number of bytes per sector.

dpSecPerClust

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

dpResSectors

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.

dpFATs

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.

dpRootDirEnts

Specifies the maximum number of entries in the root directory.

dpSectors

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

dpMedia

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).

dpFATsecs

Specifies the number of sectors occupied by each FAT.

dpSecPerTrack

Specifies the number of sectors on a single track.

dpHeads

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

dpHiddenSecs

Specifies the number of hidden sectors on the drive.

dpHugeSectors

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

See Also

Interrupt 21h Function 440Dh Minor Code 60h Get Device Parameters
Interrupt 21h Function 440Dh Minor Code 40h Set Device Parameters