Changeset 410 in xtideuniversalbios
- Timestamp:
- Apr 26, 2012, 1:46:54 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/DeviceIDE.inc
r400 r410 34 34 TIMEOUT_DRDY EQU TIMEOUT_MOTOR_STARTUP 35 35 %else 36 TIMEOUT_BSY EQU (2 000/55) ; 2000 ms37 TIMEOUT_DRDY EQU (2 000/55) ; 2000 ms36 TIMEOUT_BSY EQU (2500/55) ; 2500 ms 37 TIMEOUT_DRDY EQU (2500/55) ; 2500 ms 38 38 %endif 39 39 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm
r400 r410 47 47 .DetectPowerManagementSupport: 48 48 test BYTE [es:si+ATA6.wSetSup82], A6_wSetSup82_POWERMAN 49 jz .NoPowerManagementSupport49 jz SHORT .NoPowerManagementSupport 50 50 or BYTE [di+DPT.bFlagsHigh], FLGH_DPT_POWER_MANAGEMENT_SUPPORTED 51 51 .NoPowerManagementSupport: 52 52 %endif ; MODULE_FEATURE_SETS 53 54 55 ;-------------------------------------------------------------------- 56 ; .StoreDeviceType 57 ; Parameters: 58 ; DS:DI: Ptr to Disk Parameter Table 59 ; CS:BP: Ptr to IDEVARS for the controller 60 ; Returns: 61 ; Nothing 62 ; Corrupts registers: 63 ; AL 64 ;-------------------------------------------------------------------- 65 .StoreDeviceType: 66 call IdeDPT_StoreDeviceTypeFromIdevarsInCSBPtoDPTinDSDI 67 53 68 54 69 ;-------------------------------------------------------------------- … … 63 78 .StoreBlockMode: 64 79 mov BYTE [di+DPT_ATA.bBlockSize], 1 80 65 81 66 82 %ifdef MODULE_ADVANCED_ATA … … 81 97 mov [di+DPT_ADVANCED_ATA.bPioMode], al 82 98 or [di+DPT.bFlagsHigh], ah 99 83 100 84 101 ;-------------------------------------------------------------------- … … 111 128 .ChangeTo32bitDevice: 112 129 mov BYTE [di+DPT_ATA.bDevice], DEVICE_32BIT_ATA 130 .NoAdvancedControllerDetected: 131 %endif ; MODULE_ADVANCED_ATA 113 132 114 .NoAdvancedControllerDetected:115 ; Fall to IdeDPT_StoreDeviceTypeFromIdevarsInCSBPtoDPTinDSDI116 133 117 %endif ; MODULE_ADVANCED_ATA 134 ; End DPT 135 clc 136 ret 118 137 119 138 … … 131 150 mov al, [cs:bp+IDEVARS.bDevice] 132 151 mov [di+DPT_ATA.bDevice], al 133 ; End DPT134 clc135 152 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r400 r410 20 20 ; Section containing code 21 21 SECTION .text 22 23 ;-------------------------------------------------------------------- 24 ; STORE_ERROR_FLAG_TO_DPT 25 ; Parameters: 26 ; %1: Error flag to set 27 ; AH: BIOS Error Code 28 ; DS:DI: Ptr to DPT 29 ; CF: Set if error code in AH 30 ; Returns: 31 ; CF: Clear if no error 32 ; Set if error flag was set 33 ; Corrupts registers: 34 ; Nothing 35 ;-------------------------------------------------------------------- 36 %macro STORE_ERROR_FLAG_TO_DPT 1 37 %ifdef MODULE_ADVANCED_ATA 38 mov al, %1 39 call SetErrorFlagFromALwithErrorCodeInAH 40 %endif 41 %endmacro 42 22 43 23 44 ;-------------------------------------------------------------------- … … 57 78 ;-------------------------------------------------------------------- 58 79 AH9h_InitializeDriveForUse: 59 xor ax, ax 80 xor ax, ax ; Clear AH to assume no errors 60 81 61 82 %ifdef MODULE_ADVANCED_ATA … … 69 90 jz SHORT .ContinueInitialization 70 91 ret ; With AH and CF cleared 71 92 .ContinueInitialization: 72 93 %endif 73 94 74 95 push es 75 96 push si 97 76 98 77 99 ;;; SelectDrive … … 80 102 mov [bp+IDEPACK.bDrvAndHead], al 81 103 call Device_SelectDrive 82 83 %ifdef MODULE_ADVANCED_ATA 84 mov al, FLG_INITERROR_FAILED_TO_SELECT_DRIVE 85 call .SetErrorFlagFromALwithErrorCodeInAH 86 %endif 87 jc .ReturnWithErrorCodeInAH 104 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_SELECT_DRIVE 105 jnc SHORT .ContinueInitializationSinceDriveSelectedSuccesfully 106 jmp .ReturnWithErrorCodeInAH 107 .ContinueInitializationSinceDriveSelectedSuccesfully: 108 88 109 89 110 ;;; InitializeDeviceParameters … … 99 120 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY) 100 121 call Idepack_StoreNonExtParametersAndIssueCommandFromAL 101 102 %ifdef MODULE_ADVANCED_ATA 103 mov al, FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS 104 call .SetErrorFlagFromALwithErrorCodeInAH 105 %endif 122 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS 106 123 .SkipInitializeDeviceParameters: 124 107 125 108 126 ;;; SetWriteCache … … 115 133 mov si, [cs:bx+.rgbWriteCacheCommands] 116 134 call AH23h_SetControllerFeatures 117 118 %ifdef MODULE_ADVANCED_ATA 119 mov al, FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE 120 call .SetErrorFlagFromALwithErrorCodeInAH 121 %endif 135 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE 122 136 .SkipSetWriteCache: 137 123 138 124 139 ;;; RecalibrateDrive 125 140 ; Recalibrate drive by seeking to cylinder 0 126 141 call AH11h_RecalibrateDrive 127 128 %ifdef MODULE_ADVANCED_ATA 129 mov al, FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE 130 call .SetErrorFlagFromALwithErrorCodeInAH 131 %endif 142 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE 143 132 144 133 145 ;;; InitializeBlockMode … … 147 159 shr bl, 1 148 160 jnc SHORT .TryNextBlockSize 149 150 %ifdef MODULE_ADVANCED_ATA 151 mov al, FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE 152 call .SetErrorFlagFromALwithErrorCodeInAH 153 %endif 161 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE 154 162 .BlockModeNotSupportedOrDisabled: 155 163 .SupportedBlockSizeFound: 164 156 165 157 166 %ifdef MODULE_ADVANCED_ATA … … 169 178 mov si, FEATURE_SET_TRANSFER_MODE 170 179 call AH23h_SetControllerFeatures 171 172 mov al, FLG_INITERROR_FAILED_TO_SET_PIO_MODE 173 call .SetErrorFlagFromALwithErrorCodeInAH 180 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_SET_PIO_MODE 174 181 %endif ; MODULE_ADVANCED_ATA 182 175 183 176 184 %ifdef MODULE_FEATURE_SETS … … 178 186 ; Initialize the standby timer (if supported) 179 187 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_POWER_MANAGEMENT_SUPPORTED 180 jz .NoPowerManagementSupport188 jz SHORT .NoPowerManagementSupport 181 189 182 190 mov al, COMMAND_IDLE … … 184 192 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY) 185 193 call Idepack_StoreNonExtParametersAndIssueCommandFromAL 186 187 %ifdef MODULE_ADVANCED_ATA 188 mov al, FLG_INITERROR_FAILED_TO_INITIALIZE_STANDBY_TIMER 189 call .SetErrorFlagFromALwithErrorCodeInAH 190 %endif 194 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_INITIALIZE_STANDBY_TIMER 191 195 .NoPowerManagementSupport: 192 196 %endif ; MODULE_FEATURE_SETS 193 197 198 194 199 ; There might have been several errors so just return one error code for them all 200 .ReturnWithErrorCodeInAH: 195 201 %ifdef MODULE_ADVANCED_ATA 196 202 mov ah, [di+DPT_ADVANCED_ATA.bInitError] 197 203 test ah, ah ; Clears CF 198 jz SHORT .ReturnWith ErrorCodeInAH204 jz SHORT .ReturnWithSuccess 199 205 mov ah, RET_HD_RESETFAIL 200 206 stc 201 %endif 202 203 .ReturnWithErrorCodeInAH: 207 .ReturnWithSuccess: 208 %endif 209 204 210 pop si 205 211 pop es … … 207 213 208 214 209 %ifdef MODULE_ADVANCED_ATA 210 ;-------------------------------------------------------------------- 211 ; .SetErrorFlagFromALwithErrorCodeInAH 215 .rgbWriteCacheCommands: 216 db 0 ; DEFAULT_WRITE_CACHE 217 db FEATURE_DISABLE_WRITE_CACHE ; DISABLE_WRITE_CACHE 218 db FEATURE_ENABLE_WRITE_CACHE ; ENABLE_WRITE_CACHE 219 220 221 222 %ifdef MODULE_ADVANCED_ATA 223 ;-------------------------------------------------------------------- 224 ; SetErrorFlagFromALwithErrorCodeInAH 212 225 ; Parameters: 213 226 ; AH: BIOS Error Code 214 227 ; AL: Error flag to set 215 228 ; DS:DI: Ptr to DPT 229 ; CF: Set if error code in AH 230 ; Clear if AH = 0 216 231 ; Returns: 217 232 ; CF: Clear if no error … … 220 235 ; Nothing 221 236 ;-------------------------------------------------------------------- 222 .IgnoreInvalidCommandError:237 IgnoreInvalidCommandError: 223 238 xor ah, ah ; Clears CF 224 225 .SetErrorFlagFromALwithErrorCodeInAH: 239 SetErrorFlagFromALwithErrorCodeInAH: 226 240 jnc SHORT .NoErrorFlagToSet 227 241 cmp ah, RET_HD_INVALID 228 jbe SHORT .IgnoreInvalidCommandError242 jbe SHORT IgnoreInvalidCommandError 229 243 230 244 or [di+DPT_ADVANCED_ATA.bInitError], al … … 234 248 235 249 %endif 236 237 238 .rgbWriteCacheCommands:239 db 0 ; DEFAULT_WRITE_CACHE240 db FEATURE_DISABLE_WRITE_CACHE ; DISABLE_WRITE_CACHE241 db FEATURE_ENABLE_WRITE_CACHE ; ENABLE_WRITE_CACHE -
trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm
r399 r410 209 209 ; CF: Set if selected hotkey 210 210 ; Cleared if unselected hotkey 211 ; ES: BDA segment (zero) 211 212 ; Returns: 212 213 ; DX: Description Attribute … … 234 235 235 236 GetSelectedHotkeyDescriptionAttributeToDX: 236 mov d l,MONO_REVERSE_BLINK237 ret237 mov dx, (COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_CYAN) << 8) | MONO_REVERSE_BLINK 238 jmp SHORT SelectAttributeFromDHorDLbasedOnVideoMode 238 239 239 240 GetNonSelectedHotkeyDescriptionAttributeToDX: 240 mov dl, MONO_REVERSE 241 ret 241 mov dx, (COLOR_ATTRIBUTE(COLOR_BLACK, COLOR_CYAN) << 8) | MONO_REVERSE 242 SelectAttributeFromDHorDLbasedOnVideoMode: 243 mov al, [es:BDA.bVidMode] 244 shr al, 1 245 jnc SHORT .AttributeLoadedToDL ; Black & White modes 246 shr al, 1 247 jnz SHORT .AttributeLoadedToDL ; MDA 248 mov dl, dh 249 .AttributeLoadedToDL: 250 ret 251 242 252 %endif 243 253
Note:
See TracChangeset
for help on using the changeset viewer.