Changeset 276 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers
- Timestamp:
- Feb 28, 2012, 2:21:03 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r258 r276 41 41 ;-------------------------------------------------------------------- 42 42 AH9h_InitializeDriveForUse: 43 push si 43 44 push cx 44 45 … … 63 64 ; Initialize CHS parameters if LBA is not used 64 65 call InitializeDeviceParameters 65 jc SHORT . RecalibrateDrive66 jc SHORT .SetWriteCache 66 67 and BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nINITPRMS 68 69 ; Enable or Disable Write Cache 70 .SetWriteCache: 71 ;call SetWriteCache 67 72 68 73 ; Recalibrate drive by seeking to cylinder 0 … … 80 85 .ReturnNotSuccessfull: 81 86 pop cx 87 pop si 82 88 ret 83 89 … … 110 116 111 117 ;-------------------------------------------------------------------- 118 ; SetWriteCache 119 ; Parameters: 120 ; DS:DI: Ptr to DPT (in RAMVARS segment) 121 ; Returns: 122 ; AH: BIOS Error code 123 ; CF: Cleared if succesfull 124 ; Set if any error 125 ; Corrupts registers: 126 ; AL, BX, CX, DX, SI 127 ;-------------------------------------------------------------------- 128 SetWriteCache: 129 call AccessDPT_GetPointerToDRVPARAMStoCSBX 130 mov bl, [cs:bx+DRVPARAMS.wFlags] 131 and bx, BYTE MASK_DRVPARAMS_WRITECACHE 132 jz SHORT ReturnSuccessSinceInitializationNotNeeded ; DEFAULT_WRITE_CACHE 133 mov si, [cs:bx+.rgbWriteCacheCommands] 134 jmp AH23h_SetControllerFeatures 135 136 .rgbWriteCacheCommands: 137 db 0 ; DEFAULT_WRITE_CACHE 138 db FEATURE_DISABLE_WRITE_CACHE ; DISABLE_WRITE_CACHE 139 db FEATURE_ENABLE_WRITE_CACHE ; ENABLE_WRITE_CACHE 140 141 142 ;-------------------------------------------------------------------- 112 143 ; InitializeBlockMode 113 144 ; Parameters: … … 124 155 jz SHORT ReturnSuccessSinceInitializationNotNeeded 125 156 126 mov al, [di+DPT_ATA.bMaxBlock] ; Load max block size, zero AH 157 call AccessDPT_GetPointerToDRVPARAMStoCSBX 158 mov al, 1 ; Disable block mode 159 test BYTE [cs:bx+DRVPARAMS.wFlags], FLG_DRVPARAMS_BLOCKMODE 160 eCMOVNZ al, [di+DPT_ATA.bMaxBlock] ; Load max block size 127 161 jmp AH24h_SetBlockSize 128 162 ReturnSuccessSinceInitializationNotNeeded: 163 xor ah, ah 129 164 ret
Note:
See TracChangeset
for help on using the changeset viewer.