Changeset 148 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
- Timestamp:
- Mar 19, 2011, 8:09:41 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r84 r148 1 ; File name : AH9h_HInit.asm 2 ; Project name : IDE BIOS 3 ; Created date : 9.12.2007 4 ; Last update : 14.1.2011 5 ; Author : Tomi Tilli, 6 ; : Krister Nordvall (optimizations) 1 ; Project name : XTIDE Universal BIOS 7 2 ; Description : Int 13h function AH=9h, Initialize Drive Parameters. 8 3 … … 15 10 ; AH9h_HandlerForInitializeDriveParameters 16 11 ; Parameters: 17 ; AH: Bios function 9h 18 ; DL: Drive number 19 ; Parameters loaded by Int13h_Jump: 20 ; DS: RAMVARS segment 21 ; Returns: 12 ; DL: Translated Drive number 13 ; DS:DI: Ptr to DPT (in RAMVARS segment) 14 ; SS:BP: Ptr to INTPACK 15 ; Returns with INTPACK in SS:BP: 22 16 ; AH: Int 13h return status 23 17 ; CF: 0 if succesfull, 1 if error 24 ; IF: 125 ; Corrupts registers:26 ; Flags27 18 ;-------------------------------------------------------------------- 28 19 ALIGN JUMP_ALIGN 29 20 AH9h_HandlerForInitializeDriveParameters: 30 push dx31 push cx32 push bx33 push ax34 21 %ifndef USE_186 35 22 call AH9h_InitializeDriveForUse 36 jmp Int13h_ PopXRegsAndReturn23 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 37 24 %else 38 push Int13h_ PopXRegsAndReturn25 push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 39 26 ; Fall through to AH9h_InitializeDriveForUse 40 27 %endif … … 46 33 ; AH9h_InitializeDriveForUse 47 34 ; Parameters: 48 ; DL: Drive number 49 ; DS: RAMVARS segment 35 ; DS:DI: Ptr to DPT (in RAMVARS segment) 50 36 ; Returns: 51 ; DS:DI: Ptr to DPT52 37 ; AH: Int 13h return status 53 38 ; CF: 0 if succesfull, 1 if error 54 39 ; Corrupts registers: 55 ; AL, BX 40 ; AL, BX, DX 56 41 ;-------------------------------------------------------------------- 57 42 ALIGN JUMP_ALIGN 58 43 AH9h_InitializeDriveForUse: 59 push dx60 44 push cx 61 45 62 46 ; Try to select drive and wait until ready 63 call FindDPT_ForDriveNumber64 47 or BYTE [di+DPT.bReset], MASK_RESET_ALL ; Everything uninitialized 65 48 call HDrvSel_SelectDriveAndDisableIRQ … … 76 59 .RecalibrateDrive: 77 60 call AH11h_RecalibrateDrive 78 mov dl, [di+DPT.bDrvNum] ; Restore DL79 61 jc SHORT .InitializeBlockMode 80 62 and BYTE [di+DPT.bReset], ~FLG_RESET_nRECALIBRATE 81 63 82 64 ; Initialize block mode transfers 83 ALIGN JUMP_ALIGN84 65 .InitializeBlockMode: 85 66 call AH9h_InitializeBlockMode 86 ;mov dl, [di+DPT.bDrvNum] ; Restore DL87 67 jc SHORT .ReturnNotSuccessfull 88 and BYTE [di+DPT.bReset], ~FLG_RESET_nSETBLOCK 68 and BYTE [di+DPT.bReset], ~FLG_RESET_nSETBLOCK ; Keeps CF clear 89 69 90 70 .ReturnNotSuccessfull: 91 71 pop cx 92 pop dx93 72 ret 94 73 … … 135 114 ; AH9h_InitializeBlockMode 136 115 ; Parameters: 137 ; DL: Drive number138 116 ; DS:DI: Ptr to DPT 139 117 ; Returns:
Note:
See TracChangeset
for help on using the changeset viewer.