Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Ralf Brown's Interrupt List (Part 1,2) - int 21 - dos 3.2+ - ioctl - generic block device request http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INT 21 - DOS 3.2+ - IOCTL - GENERIC BLOCK DEVICE REQUEST
        AX = 440Dh
        BL = drive number (0=default)
        CH = category code
            08h disk drive
        CL = function
            40h set device parameters
            41h write logical device track
            42h format and verify logical device track
            46h (DOS 4.0) set volume serial number (see also AH=69h)
            47h (DOS 4.0) set access flag
            60h get device parameters
            61h read logical device track
            62h verify logical device track
            66h (DOS 4.0) get volume serial number (see also AH=69h)
            67h (DOS 4.0) get access flag
        DS:DX -> (DOS) parameter block (see below)
        SI:DI -> (OS/2 comp box) parameter block (see below)
Return: CF set on error
           AX = error code (see AH=59h)
        DS:DX -> (OS/2 comp box) data block
Note:   DOS 4.01 seems to ignore the high byte of the number of directory
          entries in the BPB for diskettes.
SeeAlso: AX=440Ch,AH=69h,INT 2F/AX=0802h,INT 2F/AX=122Bh

Format of parameter block for functions 40h, 60h:
Offset  Size    Description
 00h    BYTE    special functions
                bit 0 set if function to use current BPB, clear if Device BIOS
                        Parameter Block field contains new default BPB
                bit 1 set if function to use track layout fields only
                        must be clear if CL=60h
                bit 2 set if all sectors in track same size (should be set)
                bits 3-7 reserved
 01h    BYTE    device type
                00h  320K/360K disk
                01h  1.2M disk
                02h  720K disk
                03h  single-density 8-inch disk
                04h  double-density 8-inch disk
                05h  fixed disk
                06h  tape drive
                07h  1.44M disk
                08h  other type of block device
 02h    WORD    device attributes
                bit 0 set if nonremovable medium
                bit 1 set if door lock supported
                bits 2-15 reserved
 04h    WORD    number of cylinders
 06h    BYTE    media type
                00h 1.2M disk (default)
                01h 320K/360K disk
 07h 31 BYTEs   device BPB (see AH=53h)
 26h    WORD    number of sectors per track (start of track layout field)
 28h  N word pairs: number,size of each sector in track

Format of parameter block for functions 41h, 61h:
Offset  Size    Description
 00h    BYTE    reserved, must be zero
 01h    WORD    number of disk head
 03h    WORD    number of disk cylinder
 05h    WORD    number of first sector to read/write
 07h    WORD    number of sectors
 09h    DWORD   transfer address

Format of parameter block for functions 42h, 62h:
Offset  Size    Description
 00h    BYTE    reserved, must be zero (DOS <3.2)
                  bit 0=0: format/verify track
                        1: format status call (DOS 3.2+)
                  bits 1-7 reserved, must be zero
                on return (DOS 4.0):
                  bit 0: set if specified tracks, sectors/track supported
                  bit 1: set if function not supported by BIOS
                  bit 2: set if specified tracks, sectors/track not supported
                  bit 3: set if no disk in drive
 01h    WORD    number of disk head
 03h    WORD    number of disk cylinder

Format of parameter block for functions 46h, 66h:
Offset  Size    Description
 00h    WORD    info level (00h)
 02h    DWORD   disk serial number (binary)
 06h 11 BYTEs   volume label or "NO NAME    "
 11h  8 BYTEs   filesystem type "FAT12   " or "FAT16   " (CL=66h only)

Format of parameter block for functions 47h, 67h:
Offset  Size    Description
 00h    BYTE    special-function field (must be zero)
 01h    BYTE    disk-access flag, nonzero if access allowed by driver

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson