forked from LoopZ/TheList
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathINT 214402 ATA Software Programming Interface ATASPI INTERFACE.txt
More file actions
202 lines (189 loc) · 6.55 KB
/
INT 214402 ATA Software Programming Interface ATASPI INTERFACE.txt
File metadata and controls
202 lines (189 loc) · 6.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
--------------------------------------------------------------------------------
Unique ID: 214402
Category: d disk I/O enhancements
Flag: n/a
--------------------------------------------------------------------------------
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 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
SeeAlso: AX=4402h"ASPI",INT 4F/AX=0081h,INT 4F/AX=0082h,PORT 01F0h-01F7h"HDC 1"
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 *);
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 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 #04138)
---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
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 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 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 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: 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 *);
SeeAlso: #90003
Format of Future Domain controller unique parameters:
Offset Size Description (Table 04138)
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)
SeeAlso: #90003