Int 21/AX=4402h

lup.gif ldown.gif Interrups Categories Contents

rbline.gif

ATA Software Programming Interface (ATASPI) - INTERFACE

AX = 4402h
BX = file handle for device "$ATAMGR$"
CX = 0004h (size of buffer in bytes)
DS:DX -> buffer for result (see #90000), set to zeros before call

Return:
CF clear if successful AX = 0004h CF set on error AX = error code (01h,05h,06h,0Dh) (see #01680 at AH=59h/BX=0000h)

Notes: ATASPI is an API to control IDE, EIDE, and ATAPI devices, proposed by Future Domain; there's at least one driver in existence which

conforms to this specification:
ATASPI16.SYS by Future Domain. (see #90002) on the stack and the caller must clean up the stack. Future Domain ATASPI16.SYS v2.2 performs ATASPI calls using INT 4Fh interface instead of this INT 21/4402h interface and itself supports both interfaces

See Also: AX=4402h"ASPI" - INT 4F/AX=0081h - INT 4F/AX=0082h - PORT 01F0h-01F7h"

Format of ATASPI IOCTL result: Offset Size Description (Table 90000) 00h DWORD ATASPI entry point address

(Table 90001) Call ATASPI entry point with:.

STACK:
DWORD -> ATA Request Block (ARB) (see #90003)

Notes: Caller must clean up the stack. The large-model C declaration is void (*entry)(ARB_Struct *);

See Also: #90000

(Table 90002) Values for ATASPI command code: 00h ATA controller inquiry 01h get ATA device type 02h execute ATA I/O 03h abort ATA request 04h reset ATA device 05h set ATA controller parameter 06h get ATA disk drive information

See Also: #90003

Format of ATA Request Block (ARB): Offset Size Description (Table 90003) 00h BYTE command code (see #90002) 01h BYTE (ret) status (see #90004) 02h BYTE ATA controller number 03h BYTE request flags (see #90005) 04h DWORD reserved (0) ---request 00h--- 08h BYTE (ret) total number of ATA controllers valid only if ATA controller number = 0FFh 09h BYTE reserved (0) 0Ah 16 BYTEs (ret) ATA manager ID 1Ah 16 BYTEs (ret) ATA controller ID 2Ah 16 BYTEs (ret) controller unique parameters (see #90010) ---request 01h--- 08h BYTE device ID (00h = master, 01h = slave) 09h BYTE reserved (0) 0Ah BYTE (ret) peripheral device type (see #90007) ---request 02h--- 08h BYTE device ID 09h BYTE reserved (0) 0Ah DWORD data transfer length (ret) residual byte length 0Eh BYTE sense allocation length (N) 0Fh DWORD data buffer pointer 13h DWORD reserved (0) 17h BYTE ACB length (M) for Task File requests must be set to 07h, for ATAPI Packet requests must match the number of bytes in the packet 18h BYTE (ret) ATA controller status (see #90006) 19h BYTE (ret) device status value of the error register, 00h if no error (see #P0512) 1Ah DWORD post routine address (see #90009) 1Eh WORD data transfer block size (in bytes) number of data bytes to transfer per hardware interrupt for Task File requests; number of data bytes host prefers to transfer per hardware interrupt for ATAPI Packet commands 20h 32 BYTEs reserved for ATASPI workspace 40h M BYTEs ATA/ATAPI command block (ACB) contains AT Task File Structure (see #90008) if bit 2 of the request flags is set, ATAPI packet (see #03236,#03237,#03238) if bit 2 is cleared 40h+M N BYTEs sense allocation area ---request 03h--- 08h DWORD address of ARB to be aborted ---request 04h--- 08h BYTE device ID 09h 15 BYTEs reserved (0) 18h BYTE (ret) ATA controller status (see #90006) 19h BYTE (ret) device status 1Ah DWORD post routine address (see #90009) 1Eh 34 BYTEs reserved for ATASPI workspace ---request 05h--- 08h 16 BYTEs controller unique parameters (vendor unique) ---request 06h--- 08h BYTE device ID 09h BYTE reserved (0) 0Ah BYTE (ret) drive flags (see #01461) 0Bh BYTE (ret) INT 13h drive 0Ch BYTE (ret) preferred head translation 0Dh BYTE (ret) preferred sector translation 0Eh 10 BYTEs reserved (0)

(Table 90004) Values for ATASPI request status: 00h request in progress 01h request completed without error 02h request aborted by host 04h request completed with error 80h invalid request 81h invalid ATA controller number 82h ATA device not installed 83h ATA controller/device busy

Note: If ATASPI ever returns 83h as the status, it is the responsibility of the driver/applications to re-send the request at a later time

See Also: #90003

Bitfields for request flags: Bit(s) Description (Table 90005) 7 reserved (0) 6 "ByteXfer". =0 use word transfer mode. =1 use byte transfer mode 5 (ATAPI device) DSC unavailable action (DUA). =0 queue the request and service it when DSC bit is set. =1 return with status 83h 4-3 direction. 00 direction determined by device. 01 data in. 10 data out. 11 no data transfer 2 request type. =0 ATAPI Packet Command. =1 AT Task File Structure 1 reserved (0) 0 "Post". =0 disable posting. =1 enable posting

See Also: #90003

(Table 90006) Values for ATA controller status: 00h no error 11h device not present 12h data overrun/underrun

See Also: #90003

(Table 90007) Values for peripheral device type: 00h direct-access device (e.g. magnetic disk) 01h tape device (QIC-121 SCSI Architectural Model) 02h-04h reserved 05h CD-ROM device 06h reserved 07h optical memory device (e.g. some optical disks) 08h-0Bh reserved 0Ch tape device (Cost Sensitive Architectural Model) 0Dh-1Eh reserved 1Fh unknown or no device type 80h non-ATAPI device

See Also: #90003

Format of AT Task File Structure: Offset Size Description (Table 90008) 00h features register 01h sector count register 02h cylinder LSB register 04h cylinder MSB register 05h device/head register (see #P0513) 06h command register (see #P0515)

See Also: #90005

(Table 90009) Values ATASPI post function is called with:.

STACK:
DWORD -> ARB (see #90003) which completed. Interrupts disabled

Return:
EBP, EBX, ESI, EDI must be preserved interrupts disabled

Notes: The post function may issue any ATASPI function except an abort; it should complete as quickly as possible. The large-model C declaration is void (*post)(ARB_Struct *);

See Also: #90003

Format of Future Domain controller unique parameters: Offset Size Description (Table 90010) 00h WORD controller features 02h WORD controller main I/O port 04h WORD controller alternate I/O port 06h BYTE controller IRQ 07h BYTE ??? (00h or 01h) 08h BYTE ??? (00h or 01h) 09h 7 BYTEs reserved (0)

See Also: #90003

Category: Disk I/O Enhancements - Int 21h - A

rbline.gif

lup.gif ldown.gif Interrups Categories Contents