[3] | 1 | ; File name : AH11h_HRecal.asm
|
---|
| 2 | ; Project name : IDE BIOS
|
---|
| 3 | ; Created date : 28.9.2007
|
---|
[84] | 4 | ; Last update : 14.1.2011
|
---|
| 5 | ; Author : Tomi Tilli,
|
---|
| 6 | ; : Krister Nordvall (optimizations)
|
---|
[3] | 7 | ; Description : Int 13h function AH=11h, Recalibrate.
|
---|
| 8 |
|
---|
| 9 | ; Section containing code
|
---|
| 10 | SECTION .text
|
---|
| 11 |
|
---|
| 12 | ;--------------------------------------------------------------------
|
---|
| 13 | ; Int 13h function AH=11h, Recalibrate.
|
---|
| 14 | ;
|
---|
| 15 | ; AH11h_HandlerForRecalibrate
|
---|
| 16 | ; Parameters:
|
---|
| 17 | ; AH: Bios function 11h
|
---|
| 18 | ; DL: Drive number
|
---|
| 19 | ; Parameters loaded by Int13h_Jump:
|
---|
| 20 | ; DS: RAMVARS segment
|
---|
| 21 | ; Returns:
|
---|
| 22 | ; AH: BIOS Error code
|
---|
| 23 | ; CF: 0 if succesfull, 1 if error
|
---|
| 24 | ; IF: 1
|
---|
| 25 | ; Corrupts registers:
|
---|
| 26 | ; Flags
|
---|
| 27 | ;--------------------------------------------------------------------
|
---|
| 28 | ALIGN JUMP_ALIGN
|
---|
| 29 | AH11h_HandlerForRecalibrate:
|
---|
| 30 | push dx
|
---|
| 31 | push cx
|
---|
| 32 | push bx
|
---|
| 33 | push ax
|
---|
[84] | 34 | %ifndef USE_186
|
---|
[3] | 35 | call AH11h_RecalibrateDrive
|
---|
| 36 | jmp Int13h_PopXRegsAndReturn
|
---|
[84] | 37 | %else
|
---|
| 38 | push Int13h_PopXRegsAndReturn
|
---|
| 39 | ; Fall through to AH11h_RecalibrateDrive
|
---|
| 40 | %endif
|
---|
[3] | 41 |
|
---|
| 42 |
|
---|
| 43 | ;--------------------------------------------------------------------
|
---|
| 44 | ; Int 13h function AH=11h, Recalibrate.
|
---|
| 45 | ;
|
---|
| 46 | ; AH11h_HRecalibrate
|
---|
| 47 | ; Parameters:
|
---|
| 48 | ; DL: Drive number
|
---|
| 49 | ; DS: RAMVARS segment
|
---|
| 50 | ; Returns:
|
---|
| 51 | ; DS:DI: Ptr to DPT
|
---|
| 52 | ; AH: BIOS Error code
|
---|
| 53 | ; CF: 0 if succesfull, 1 if error
|
---|
| 54 | ; Corrupts registers:
|
---|
| 55 | ; AL, BX, CX, DX
|
---|
| 56 | ;--------------------------------------------------------------------
|
---|
| 57 | ALIGN JUMP_ALIGN
|
---|
| 58 | AH11h_RecalibrateDrive:
|
---|
| 59 | ; Recalibrate command is optional, vendor specific and not even
|
---|
| 60 | ; supported on later ATA-standards. Let's do seek instead.
|
---|
| 61 | mov cx, 1 ; Seek to Cylinder 0, Sector 1
|
---|
| 62 | xor dh, dh ; Head 0
|
---|
[28] | 63 | jmp AHCh_SeekToCylinder
|
---|