Changeset 521 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers
- Timestamp:
- Mar 10, 2013, 3:46:59 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
r520 r521 119 119 jz SHORT .ErrorCodeNotUsed 120 120 mov bl, [di+DPT.bIdevarsOffset] ; replace drive number with Idevars pointer for cmp with dl 121 .ErrorCodeNotUsed: 122 123 mov si, ControllerResetForDPTinDSDI 124 call .CallSIforEveryController ; Reset all drives to power on settings 125 mov si, ControllerInitForMasterOrSingleDPTinDSDI 126 ; Fall to .CallSIforEveryController ; Initialize all controllers (Master and Slave drives) 127 128 .CallSIforEveryController: ; BH will be garbage on exit if this entry point is used, 121 .ErrorCodeNotUsed: ; BH will be garbage on exit if this entry point is used, 129 122 ; but reset of all drives will still happen 130 131 123 mov dl, ROMVARS.ideVars0 ; starting Idevars offset 132 124 … … 139 131 140 132 .loop: 141 push si 142 call FindDPT_ForIdevarsOffsetInDL ; look for the first drive on this controller, if any 143 pop si 144 jc SHORT .notFound 133 call FindDPT_MasterOrSingleForIdevarsOffsetInDL 134 jc SHORT .ControllerNotAvailable 145 135 146 push bx 136 ; Reset controller (both Master and Slave Drive). We ignore error codes 137 ; here since initialization is the one that matters. 147 138 push cx 148 139 push dx 149 call si ; Reset Master AND Slave or initialize Master OR Slave drive 140 push bx 141 %ifdef MODULE_IRQ 142 call Interrupts_UnmaskInterruptControllerForDriveInDSDI 143 %endif 144 call Device_ResetMasterAndSlaveController 145 %ifdef MODULE_ADVANCED_ATA 146 call AdvAtaInit_InitializeControllerForDPTinDSDI 147 %endif 148 pop bx 150 149 pop dx 150 151 ; Initialize Master Drive 152 call AH9h_InitializeDriveForUse ; Initialize Master drive 153 call BackupErrorCodeFromTheRequestedDriveToBH 154 155 ; Initialize Slave Drive 156 call FindDPT_SlaveForIdevarsOffsetInDL 157 jc SHORT .SlaveDriveNotAvailable 158 call AH9h_InitializeDriveForUse 159 ; Here we have a small problem. Since DL now has offset to IDEVARS, it will be the same 160 ; for both Master and Slave Drive. We simply ignore error from slave drive reset since most 161 ; systems do not have slave drives at all and it is unlikely that AH=00h would be called for 162 ; specific drive anyway. AH=Dh is for that. 163 164 .SlaveDriveNotAvailable: 151 165 pop cx 152 pop bx 153 call BackupErrorCodeFromTheRequestedDriveToBH ; save error code if same controller as drive from entry 154 155 .notFound: 166 .ControllerNotAvailable: 156 167 add dl, IDEVARS_size ; move Idevars pointer forward 157 168 loop .loop 158 169 ret 159 160 161 ;--------------------------------------------------------------------162 ; ControllerResetForDPTinDSDI163 ; Parameters:164 ; DS:DI: Ptr to DPT for drive to reset (resets both Master and Slave drive)165 ; SS:BP: Ptr to IDEPACK166 ; Returns:167 ; AH: Int 13h return status168 ; Corrupts registers:169 ; AL, BX, CX, DX170 ;--------------------------------------------------------------------171 ControllerResetForDPTinDSDI:172 %ifdef MODULE_IRQ173 call Interrupts_UnmaskInterruptControllerForDriveInDSDI174 %endif175 %ifdef MODULE_ADVANCED_ATA176 call Device_ResetMasterAndSlaveController177 jmp AdvAtaInit_InitializeControllerForDPTinDSDI178 %else179 jmp Device_ResetMasterAndSlaveController180 %endif181 182 183 ;--------------------------------------------------------------------184 ; ControllerInitForMasterOrSingleDPTinDSDI185 ; Parameters:186 ; DS:DI: Ptr to DPT for Master or Single Drive (initializes both Master and Slave drive)187 ; SS:BP: Ptr to IDEPACK188 ; Returns:189 ; AH: Int 13h return status190 ; Corrupts registers:191 ; AL, BX, CX, DX192 ;--------------------------------------------------------------------193 ControllerInitForMasterOrSingleDPTinDSDI:194 call AH9h_InitializeDriveForUse ; Init Master or Single drive195 push ax ; Store error code196 197 eMOVZX ax, BYTE [di+DPT.bIdevarsOffset] ; Clear AH198 add di, BYTE LARGEST_DPT_SIZE ; Slave drive or next controller199 cmp [di+DPT.bIdevarsOffset], al200 jne SHORT .NoSlaveDrivePresent201 202 call AH9h_InitializeDriveForUse ; Init Slave drive203 .NoSlaveDrivePresent:204 pop bx205 MAX_U ah, bh ; Return error code from either drive206 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r505 r521 73 73 ; CF: 0 if successful, 1 if error 74 74 ; Corrupts registers: 75 ; AL, BX, CX, DX75 ; AL, CX 76 76 ;-------------------------------------------------------------------- 77 77 AH9h_InitializeDriveForUse: … … 93 93 push es 94 94 push si 95 push dx 96 push bx 95 97 96 98 … … 232 234 %endif 233 235 236 pop bx 237 pop dx 234 238 pop si 235 239 pop es -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r520 r521 161 161 %endif 162 162 clc 163 ;; fall through to JumpToBootSector_or_RomBoot164 165 ;-------------------------------------------------------------------- 166 ; JumpToBootSector_or_RomBoot163 ;; fall through to Int19_JumpToBootSectorOrRomBoot 164 165 ;-------------------------------------------------------------------- 166 ; Int19_JumpToBootSectorOrRomBoot 167 167 ; 168 168 ; Switches back to the POST stack, clears the DS and ES registers, … … 179 179 ; Never returns 180 180 ;-------------------------------------------------------------------- 181 JumpToBootSector_or_RomBoot:181 Int19_JumpToBootSectorOrRomBoot: 182 182 mov cx, es ; Preserve MBR segment (can't push because of stack change) 183 183 mov ax, 0 ; NOTE: can't use XOR (LOAD_BDA_SEGMENT_TO) as it impacts CF -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
r505 r521 36 36 call DetectPrint_TryToBootFromDL 37 37 call LoadFirstSectorFromDriveDL 38 %ifndef USE_386 39 jc SHORT .FailedToLoadFirstSector 38 jnc SHORT .FirstSectorLoadedToESBX 39 40 ; Do not display timeout error (80h) for floppy drives since 41 ; it most likely mean no diskette in drive. This way we do not 42 ; display error code every time user intends to boot from hard disk 43 ; when A then C boot order is used. 44 js SHORT .PrintFailedToLoadErrorCode ; Hard Drive 45 cmp ah, RET_HD_TIMEOUT 46 je SHORT .ReturnWithCFclearSinceFailedToLoadBootSector 47 cmp ah, RET_HD_NOMEDIA 48 je SHORT .ReturnWithCFclearSinceFailedToLoadBootSector 49 .PrintFailedToLoadErrorCode: 50 %ifdef USE_186 51 push .ReturnWithCFclearSinceFailedToLoadBootSector 52 jmp DetectPrint_FailedToLoadFirstSector 40 53 %else 41 jc DetectPrint_FailedToLoadFirstSector 54 call DetectPrint_FailedToLoadFirstSector 55 jmp .ReturnWithCFclearSinceFailedToLoadBootSector 42 56 %endif 43 57 58 59 .FirstSectorLoadedToESBX: 44 60 test dl, dl 45 61 jns SHORT .AlwaysBootFromFloppyDriveForBooterGames … … 47 63 jne SHORT .FirstHardDiskSectorNotBootable 48 64 .AlwaysBootFromFloppyDriveForBooterGames: 49 stc 50 jmp SHORT JumpToBootSector_or_RomBoot 51 52 %ifndef USE_386 53 .FailedToLoadFirstSector: 54 jmp DetectPrint_FailedToLoadFirstSector 55 %endif 65 stc ; Boot Sector loaded succesfully 66 jmp SHORT Int19_JumpToBootSectorOrRomBoot 56 67 57 68 .FirstHardDiskSectorNotBootable: 58 69 mov si, g_szBootSectorNotFound 59 jmp DetectPrint_NullTerminatedStringFromCSSIandSetCF 70 call DetectPrint_NullTerminatedStringFromCSSI 71 .ReturnWithCFclearSinceFailedToLoadBootSector: 72 clc 73 ret 60 74 61 75 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
Note:
See TracChangeset
for help on using the changeset viewer.