INT 21 - CD-ROM device driver - IOCTL INPUT                                     
	AX = 4402h
	BX = file handle referencing character device for CD-ROM driver
	CX = number of bytes to read
	DS:DX -> control block (see #01449)
Return: CF clear if successful
	    AX = number of bytes actually read
	CF set on error
	    AX = error code (01h,05h,06h,0Dh) (see #01680 at AH=59h/BX=0000h)
Notes:	the data returned depends on the first byte of the control block
	  (two bytes for functions 01h/07h/0Bh, see #01449); the remainder of
	  the control block is filled by the driver
	some device drivers support several subunits (that is more than one
	  drive) but it is not possible to distinguish between them with this
	  function; use INT 2F/AX=1510h or INT 2F/AX=0802h instead
	under Windows95, the "mscd$$$$" device cannot be opened so you cannot
	  obtain the handle required by this function: use INT 2F/AX=1510h
	  or INT 2F/AX=0802h instead
SeeAlso: AX=4403h"CD-ROM",INT 2F/AX=0802h,INT 2F/AX=1510h


(Table 01448)
Values for CD-ROM data being requested:
 00h	device driver header address
 01h	drive head location
 02h	reserved
 03h	error statistics
 04h	audio channel info
 05h	raw drive bytes (uninterpreted and device-specific)
 06h	device status
 07h	sector size
 08h	volume size
 09h	media change status
 0Ah	audio disk info
 0Bh	audio track info
 0Ch	audio Q-Channel info
 0Dh	audio sub-channel info
 0Eh	UPC code
 0Fh	audio status info


Format of CD-ROM control block:
Offset	Size	Description	(Table 01449)
 00h	BYTE	data being requested (see #01448)
---function 00h---
 01h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	device driver header address (see also AH=52h,#01646)
---function 01h---
 01h	BYTE	(call) addressing mode
		00h HSG
		01h Red Book
 02h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	current location of drive's head
		logical sector number in HSG mode
		frame/second/minute/unused in Red Book mode
		(HSG sector = minute * 4500 + second * 75 + frame - 150)
---function 03h---
 01h  N BYTEs	undefined as of 5 Aug 88 specification
---function 04h---
 01h	BYTE	input channel (0-3) for output channel 0
 02h	BYTE	volume for output channel 0
 03h	BYTE	input channel (0-3) for output channel 1
 04h	BYTE	volume for output channel 1
 05h	BYTE	input channel (0-3) for output channel 2
 06h	BYTE	volume for output channel 2
 07h	BYTE	input channel (0-3) for output channel 3
 08h	BYTE	volume for output channel 3
Notes:	output channels 0 and 1 are left and right, 2 and 3 are left prime and
	  right prime; a volume of 00h is off
	the default setting is for each input channel to be assigned to the
	  same-numbered output channel at full (FFh) volume
---function 05h---
 01h	BYTE	number of bytes read
 02h 128 BYTEs	buffer for drive bytes
---function 06h---
 01h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	device parameters (see #01450)
---function 07h---
 01h	BYTE	(call) read mode
		00h cooked
		01h raw
 02h	WORD	(return) sector size in bytes
---function 08h---
 01h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	volume size in sectors
BUGS:	Aztech device driver v1.10 and v1.27 (at least) return the last sector
	  number, i.e. total number of sectors - 1
	Windows95 returns the total number of sectors + 150 (see the Red Book
	  to HSG conversion formula at function 01h to understand why this
	  happens)
---function 09h---
 01h	BYTE	media change status
		00h don't know
		01h media unchanged
		FFh media has been changed
---function 0Ah---
 01h	BYTE	lowest audio track number
 02h	BYTE	highest audio track number
 03h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	start address of lead-out track (Red Book format)
--function 0Bh---
 01h	BYTE	(call) track number
 02h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	starting point of track (Red Book format)
 06h	BYTE	track control info
		bits 15,14,12: track type (notice: bits not contiguous!)
			000 two audio channels, no pre-emphasis
			001 two audio channels with pre-emphasis
			010 data track
			100 four audio channels, no pre-emphasis
			101 four audio channels with pre-emphasis
			other reserved
		bit 13: digital copy permitted
---function 0Ch---
 01h	BYTE	CONTROL and ADR byte (as received from drive)
 02h	BYTE	track number
 03h	BYTE	point or index
 04h	BYTE	minute	\
 05h	BYTE	second	 > running time within track
 06h	BYTE	frame	/
 07h	BYTE	zero
 08h	BYTE	"AMIN" or "PMIN"     \
 09h	BYTE	"ASEC" or "PSEC"      > running time on disk
 0Ah	BYTE	"AFRAME" or "PFRAME" /
---function 0Dh---
 01h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	starting frame address (Red Book format)
 05h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	transfer address
 09h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	number of sectors to read
Note:	copies 96 bytes of sub-channel info per sector into buffer
---function 0Eh---
 01h	BYTE	CONTROL and ADR byte
 02h  7 BYTEs	UPC/EAN code (13 BCD(Binary Coded Decimal) A method of data storage where two decimal digits are stored in each byte, one in the upper four bits and the other in the lower four bits.  Since only the values 0 through 9 are used in each half of a byte, BCD values can be read as decimal numbers on a hexadecimal display of memory or a file. digits,low-order nybble of last byte is 0)
 09h	BYTE	zero
 0Ah	BYTE	"AFRAME"
---function 0Fh---
 ??? documentation not yet available
 01h	WORD	pause status (0000h not paused, 0001h paused)
 03h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	audio play start address
 07h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	??? audio play length or end address


Bitfields for CD-ROM device parameters:
Bit(s)	Description	(Table 01450)
 0	door open
 1	door unlocked
 2	supports raw reading in addition to cooked
 3	writable
 4	can play audio/video tracks
 5	supports interleaving
 6	reserved
 7	supports prefetch requests
 8	supports audio channel control
 9	supports Red Book addressing in addition to HSG
 10	audio is playing
 11	no disk in drive
 12	supports R-W subchannels
                                                                                

INT 21 - Advanced SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. Programming Interface (ASPI) - INTERFACE
	AX = 4402h
	BX = file handle for device "SCSIMGR$"
	CX = 0004h or 0005h (refer to notes below)
	DS:DX -> buffer for result (see #01452), set to zeros before call
Return: CF clear if successful
	    AX = 0004h or 0005h (refer to notes below)
	CF set on error
	    AX = error code (01h,05h,06h,0Dh) (see #01680 at AH=59h/BX=0000h)
Notes:	the variant of the call requesting five bytes is an UNDOCUMENTED
	  extension supported by Adaptec's ASPI2DOS.SYS, ASPI4DOS.SYS, and
	  ASPI7DOS.SYS; if made of a host manager which does not support the
	  variant, only four bytes will be returned.  If the variant is
	  supported, Adaptec's WINASPI.DLLsee Dynamic Link Library assumes that the host manager is
	  an "advanced" one which operates in either real or protected mode
	  (and thus does not require a DPMIsee DOS Protected-Mode Interface INT 31/AX=0301h call to be invoked
	  from protected mode).	 Support of the five-byte variant also appears
	  to imply that an advanced ASPI host manager uses no temporary
	  storage space except the SRB (see #01454) and the stack, and that it
	  is fully reentrant.
	if called with a standard request for four bytes, even Adaptec's
	  advanced drivers return only the requested four bytes containing the
	  ASPI entry point address
	the function address is called with the address of a SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. Request
	  Block (see #01454) on the stack and the caller must clean up the
	  stack
SeeAlso: AX=440Ch"ASPITAPE",INT 11/AH=FFh"WD7000"


Format of ASPI IOCTL result:
Offset	Size	Description	(Table 01452)
 00h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	function address
 04h	BYTE	number of SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. host adapters supported by host manager


(Table 01453)
Values for ASPI request number:
 00h	"HA_INQ"	host adapter inquiry / extended host adapter inquiry
 01h	"GET_TYPE"	get device type
 02h	"EXEC_SIO"	execute SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. I/O
 03h	"ABORT_SRB"	abort SRB
 04h	"RESET_DEV"	reset SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. device
 05h	"SET_HAPRMS"	set host adapter parameters
 06h	get disk drive information
 7Fh	(Adaptec) get ASPI manager info?
Note:	request 7Fh is supported by all the Adaptec's DOS ASPI managers:
	  ASPI2DOS.SYS (for AHA-152x), ASPI4DOS.SYS (for AHA-154x/164x),
	  ASPI7DOS.SYS (for AIC-77xx), and ASPI8DOS.SYS (for AIC-78xx)


Format of SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. Request Block (64 bytes):
Offset	Size	Description	(Table 01454)
 00h	BYTE	request number (see #01453)
 01h	BYTE	request status (see #01455)
 02h	BYTE	host adapter ID
 03h	BYTE	request flags (see #01456)
 04h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	reserved (0)
---request 00h---
 08h	BYTE	(ret) number of host adapters
 09h	BYTE	(ret) target adapter ID
 0Ah 16 BYTEs	(ret) SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. manager ID
 1Ah 16 BYTEs	(ret) host adapter ID
 2Ah 16 BYTEs	(ret) host adapter-unique parameters (see #90010,#90011)
---extended request 00h---
 04h  2 BYTEs	(call) extended request signature 55h AAh
		(ret) if extended request supported, reply AAh 55h
 06h	WORD	(call) length of extended buffer at offset 3Ah
		(ret) number of bytes returned in extended buffer
 08h	BYTE	(ret) number of host adapters
 09h	BYTE	(ret) target adapter ID
 0Ah 16 BYTEs	(ret) SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. manager ID
 1Ah 16 BYTEs	(ret) host adapter ID
 2Ah 16 BYTEs	(ret) host adapter-unique parameters
 3Ah  N BYTEs	extended buffer
		3Ah	WORD	features (see #01457)
		3Ch	WORD	maximum scatter/gather list length
		3Eh	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	maximum SCIS data transfer size (0 = unlimited)
---request 01h---
 08h	BYTE	target ID
 09h	BYTE	logical unit number
 0Ah	BYTE	(ret) device type (see #01460)
---request 02h---
 08h	BYTE	target ID
 09h	BYTE	logical unit number
 0Ah	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	data allocation length
		(ret) residual byte length (if supported and requested)
 0Eh	BYTE	sense allocation length
 0Fh	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	data buffer pointer
 13h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	next request pointer (for linking)
 17h	BYTE	CDB length
 18h	BYTE	(ret) host adapter status (see #01454)
 19h	BYTE	(ret) target status (see #01459)
 1Ah	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	post routine address (see #01466)
 1Eh	WORD	real mode Post DS
 20h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	SRB pointer
 24h	WORD	reserved
 26h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	SRB physical address
 2Ah 22 BYTEs	SCSIMGR$ workspace
 40h  N BYTEs	CCB, including sense data (20-24 bytes)
---request 03h---
 08h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	address of SRB to abort
---request 04h---
 08h	BYTE	target ID
 09h	BYTE	logical unit number
 0Ah 14 BYTEs	reserved
 18h	BYTE	(ret) host adapter status (see #01458)
 19h	BYTE	(ret) target status (see #01459)
 1Ah	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	post routine address
 1Eh 34 BYTEs	workspace
---request 05h---
 08h 16 BYTEs	host adapter-unique parameters
---request 06h---
 08h	BYTE	target ID
 09h	BYTE	logical unit number
 0Ah	BYTE	disk drive flags (see #01461)
 0Bh	BYTE	INT 13h drive number
 0Ch	BYTE	preferred head number translation
 0Dh	BYTE	preferred sector size translation
 0Eh 10 BYTEs	reserved
---request 7Fh---
 08h	WORD	base I/O port address
 0Ah	BYTE	number of I/O ports used
 0Bh	BYTE	??? (01h returned for AHA-152x)
 0Ch	BYTE	interrupt level
 0Dh	BYTE	DMAsee Direct Memory Access channel
 0Eh	BYTE	(ASPI7DOS.SYS) EISA(Enhanced Industry-Standard Architecture) A 32-bit superset of the IBMInternational Busiuness Machines ATIBM PC AT's expansion bus (which is now known as the ISA or Industry-Standard Architecture bus). slot  number
		(ASPI8DOS.SYS) PCI device number
 0Fh	BYTE	bits 7-1: reserved (0)
		bit 0: (AHA-152x) ???
 10h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	ASPI entry point address
 14h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	previous ASPI entry point address
 18h	WORD	offset to "ASPI request dispatcher" procedure
 1Ah	WORD	offset to "interrupt handler" procedure
 1Ch	WORD	offset to some procedure
 1Eh	WORD	offset to some procedure
 20h	WORD	offset to host adapter data
 22h	BYTE	??? (apparently always 02h)
 23h	BYTE	reserved??? (0)
 24h	BYTE	(ASPI8DOS.SYS) PCI bus number?
 25h  11 BYTEs	reserved??? (0)
SeeAlso: #01462


(Table 01455)
Values for ASPI request status:
 00h	not done yet
 01h	completed successfully
 02h	aborted by host
 04h	SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. I/O error
 80h	invalid
 81h	no adapter
 82h	no device attached
 else	status
SeeAlso: #01454


Bitfields for ASPI request flags:
Bit(s)	Description	(Table 01456)
 0	posting enabled
 1	linking enabled
 2	residual byte length reported in Data Allocation Length field
 3	transfer from SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. target to host
 4	transfer from host to SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. target
 5	scatter/gather
 7-6	reserved
Note:	no data is transferred if both bits 3 and 4 are set; if neither is
	  set, the direction is determined by the SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. command
SeeAlso: #01454


Bitfields for ASPI extended features:
Bit(s)	Description	(Table 01457)
 0	scatter/gather supported
 1	residual byte length reported
 2	Wide SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. 16 host adapter
 3	Wide SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. 32 host adapter
 15-4	reserved
SeeAlso: #01454


(Table 01458)
Values for host adapter status:
 00h	no error detected
 11h	select timeout
 12h	data overrun
 13h	bus error
 14h	bus failure


(Table 01459)
Values for target status:
 00h	no status
 02h	sense data stored in SRB
 08h	target busy
 18h	reservation error


(Table 01460)
Values for device type:
 00h	disk drive
 01h	tape drive (streamer)
 02h	printer
 03h	processor
 04h	WORM drive
 05h	CD-ROM drive
 06h	scanner
 07h	optical drive
 08h	autochanger
 09h	communications device


(Table 01461)
Values for disk drive flags:
 00h	no INT 13 access
 01h	INT 13 with DOS access
 02h	INT 13 without DOS access
 03h	invalid flags


Format of CCB:
Offset	Size	Description	(Table 01462)
 00h	BYTE	command code (see #01463)
 01h	BYTE	flags
		bits 4-0: vary by function
		bits 7-5: logical unit number
 02h	BYTE	"adr_1"
 03h	BYTE	"adr_0"
 04h	BYTE	length
 05h	BYTE	control
	...
 06h/0Ah 14 BYTEs buffer for sense data (see #01464)
SeeAlso: #01454


(Table 01463)
Values for CCB command code:
 00h	test unit ready
 01h	rewind
 03h	request sense data
 05h	get block size limits
 08h	Group 0 read
 0Ah	Group 0 write
 10h	write file marks
 11h	SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. Space (set position?)
 12h	SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. Inquire
 15h	set mode information
 16h	reserve SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. device
 17h	release SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. device
 19h	erase
 1Ah	request mode information
 1Bh	load/unload media
 1Dh	request target self-check
 24h	set window parameters
 25h	get window parameters
 28h	Group 1 read
 2Ah	Group 1 write
 31h	document feeder control
 34h	get scan data status
---vendor-specific commands---
 D3h	get document feeder status
 D4h	set document feeder mode


Format of sense data:
Offset	Size	Description	(Table 01464)
 00h	BYTE	error code (bit 7 set if valid)
 01h	BYTE	segment number
 02h	BYTE	sense key
		bit 6: EOM
		bit 5: ILI
		bits 0-3: sense key (see #01465)
 03h  4 BYTEs	information bytes
 07h	BYTE	additional sense length (0Ah)
 08h  4 BYTEs	command-specific information
 0Ch	BYTE	additional sense code
 0Dh	BYTE	additional sense code qualifier
 0Eh	BYTE	field replaceable unit code
 0Fh  3 BYTEs	sense key specific bytes


(Table 01465)
Values for sense key:
 00h	no sense data
 02h	SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. unit not ready
 03h	media error
 04h	unrecoverable hardware error
 05h	illegal parameter in CDB
 06h	target has been reset
 0Bh	target aborted command


(Table 01466)
Values ASPI post function is called with:
	STACK:	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address. -> SRB (see #01454) which completed
	interrupts disabled
Return: EBP, EBX, ESI, EDI must be preserved
	interrupts disabled
Note:	the post function may issue any ASPI function except an abort; it
	  should complete as quickly as possible


Format of ASPI2DOS.SYS v3.65 host adapter unique parameters:
Offset	Size	Description	(Table 90010)
 00h	WORD	reserved? (0)
 02h	WORD	reserved? (0)
 04h	WORD	base I/O port address
 06h	BYTE	interrupt level
 07h  9 BYTEs	reserved  (0)
SeeAlso: #90011,#01454


Format of ASPI4DOS.SYS v3.35 host adapter unique parameters:
Offset	Size	Description	(Table 90011)
 00h	WORD	offset to "ASPI request dispatcher" procedure
 02h	WORD	offset to "interrupt handler" procedure
 04h 12 BYTEs	reserved  (0)
SeeAlso: #90010,#01454
                                                                                

INT 21 - 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(Application Program[ming] Interface) The defined set of calls which a program may make to interact with or request services of the operating system or environment under which it is running.  Because the inputs and outputs of the calls are well-defined, a program using the API can continue using the identical calls even if the internal organization of the program providing the API changes. to control IDE(Integrated Drive Electronics) A type of disk drive interface which essentially extends the PCIBM PC's expansion bus all the way to the drive and places the drive controller on the disk drive itself.	 See also ESDI., 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
SeeAlso: AX=4402h"ASPI",INT 4F/AX=0081h,INT 4F/AX=0082h,PORTIBM PC Portable (uses same BIOS as XT) 01F0h-01F7h"HDC1"


Format of ATASPI IOCTL result:
Offset	Size	Description	(Table 90000)
 00h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	ATASPI entry point address


(Table 90001)
Call ATASPI entry point with:
	STACK:	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address. -> ATA Request Block (ARB) (see #90003)
Notes:	caller must clean up the stack
	the large-model C declaration is
	  void (*entry)(ARB_Struct *);
SeeAlso: #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
SeeAlso: #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	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	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	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	data  transfer length
		(ret) residual byte length
 0Eh	BYTE	sense allocation length (N)
 0Fh	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	data  buffer pointer
 13h	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	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	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	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 ATIBM PC 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	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	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	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address.	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
SeeAlso: #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 ATIBM PC AT Task File Structure
 1	reserved (0)
 0	"Post"
	=0 disable posting
	=1 enable  posting
SeeAlso: #90003


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


(Table 90007)
Values for peripheral device type:
 00h	direct-access device (e.g. magnetic disk)
 01h	tape device (QIC-121 SCSI(Small Computer Systems Interface) A system-independent expansion bus typically used to connect hard disks, tape drives, and CD-ROMs to a computer.	A host adapter connects the SCSI bus to the computer's own bus.  See also ESDI, IDE. 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
SeeAlso: #90003


Format of ATIBM PC 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)
SeeAlso: #90005


(Table 90009)
Values ATASPI post function is called with:
	STACK:	DWORDDoubleword; four bytes.	 Commonly used to hold a 32-bit segment:offset or selector:offset address. -> 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 *);
SeeAlso: #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(Interrupt ReQuest) A hardware line connected to the interrupt controller chip which signals that a CPU interrupt should be generated.
 07h	BYTE	??? (00h or 01h)
 08h	BYTE	??? (00h or 01h)
 09h  7 BYTEs	reserved (0)
SeeAlso: #90003