1 | ; Project name : XTIDE Universal BIOS
|
---|
2 | ; Description : Int 13h function AH=11h, Recalibrate.
|
---|
3 |
|
---|
4 | ;
|
---|
5 | ; XTIDE Universal BIOS and Associated Tools
|
---|
6 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
|
---|
7 | ;
|
---|
8 | ; This program is free software; you can redistribute it and/or modify
|
---|
9 | ; it under the terms of the GNU General Public License as published by
|
---|
10 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
11 | ; (at your option) any later version.
|
---|
12 | ;
|
---|
13 | ; This program is distributed in the hope that it will be useful,
|
---|
14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | ; GNU General Public License for more details.
|
---|
17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
18 | ;
|
---|
19 |
|
---|
20 | ; Section containing code
|
---|
21 | SECTION .text
|
---|
22 |
|
---|
23 | ;--------------------------------------------------------------------
|
---|
24 | ; Int 13h function AH=11h, Recalibrate.
|
---|
25 | ;
|
---|
26 | ; AH11h_HandlerForRecalibrate
|
---|
27 | ; Parameters:
|
---|
28 | ; DL: Translated Drive number
|
---|
29 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
30 | ; SS:BP: Ptr to IDEREGS_AND_INTPACK
|
---|
31 | ; Returns with INTPACK:
|
---|
32 | ; AH: BIOS Error code
|
---|
33 | ; CF: 0 if successful, 1 if error
|
---|
34 | ;--------------------------------------------------------------------
|
---|
35 | AH11h_HandlerForRecalibrate:
|
---|
36 | %ifndef USE_186
|
---|
37 | call AH11h_RecalibrateDrive
|
---|
38 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|
39 | %else
|
---|
40 | push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|
41 | ; Fall to AH11h_RecalibrateDrive
|
---|
42 | %endif
|
---|
43 |
|
---|
44 |
|
---|
45 | ;--------------------------------------------------------------------
|
---|
46 | ; AH11h_HRecalibrate
|
---|
47 | ; Parameters:
|
---|
48 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
49 | ; SS:BP: Ptr to IDEREGS_AND_INTPACK
|
---|
50 | ; Returns:
|
---|
51 | ; AH: BIOS Error code
|
---|
52 | ; CF: 0 if successful, 1 if error
|
---|
53 | ; Corrupts registers:
|
---|
54 | ; AL, BX, CX, DX
|
---|
55 | ;--------------------------------------------------------------------
|
---|
56 | AH11h_RecalibrateDrive:
|
---|
57 | ; Recalibrate command is optional, vendor specific and not even
|
---|
58 | ; supported on later ATA-standards. Let's do seek instead.
|
---|
59 | mov cx, 1 ; Seek to Cylinder 0, Sector 1
|
---|
60 | xor dh, dh ; Head 0
|
---|
61 | jmp AHCh_SeekToCylinder
|
---|