Int 13H [PS/2] Function 1AH (26) Format ESDI drive

Initializes disk sector and track address fields on a drive attached to the ESDI Fixed Disk Drive Adapter/A.

Call with:

AH = 1AH

AL = relative block address (RBA) defect table count

0 if no RBA table

>0 if RBA table used

CL = format modifier bits

Bit(s) Significance (if set)

0 ignore primary defect map

1 ignore secondary defect map

2 update secondary defect map (see Notes)

3 perform extended surface analysis

4 generate periodic interrupt (see Notes)

5—7 reserved (must be 0)

DL = drive

80H—FFH fixed disk

ES:BX = segment:offset of RBA table

Returns:

If function successful

Carry flag = clear

AH = 00H

If function unsuccessful

Carry flag = set

AH = status (see Int 13H Function 01H)

Notes:

This operation is sometimes called a "low level format" and prepares the disk for physical read/write operations at the sector level. The drive must be subsequently partitioned with the FDISK command and then given a "high level format" with the FORMAT command to install a file system.

If bit 4 of register CL is set, Int 15H is called with AH = 0FH and AL = phase code after each cylinder is formatted or analyzed. The phase code is defined as:

0 = reserved 1 = surface analysis 2 = formatting

See also Int 15H Function 0FH.

If bit 2 of register CL is set, the drive's secondary defect map is updated to reflect errors found during surface analysis. If both bit 2 and bit 1 are set, the secondary defect map is replaced.

For an extended surface analysis, the disk should first be formatted by calling this function with bit 3 cleared, then analyzed by calling this function with bit 3 set.