Changeset 507 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Mar 1, 2013, 5:12:33 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r501 r507 55 55 %else ; IDE 56 56 Device_FinalizeDPT EQU IdeDPT_Finalize 57 %endif 58 59 60 ;-------------------------------------------------------------------- 61 ; Device_ResetMasterAndSlaveController 62 ; Parameters: 63 ; DS:DI: Ptr to DPT (in RAMVARS segment) 64 ; Returns: 65 ; AH: INT 13h Error Code 66 ; CF: Cleared if success, Set if error 67 ; Corrupts registers: 68 ; AL, BX, CX, DX 69 ;-------------------------------------------------------------------- 70 %ifdef MODULE_SERIAL ; IDE + Serial 71 Device_ResetMasterAndSlaveController: 72 TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort 73 jmp IdeCommand_ResetMasterAndSlaveController 74 75 %else ; IDE 76 Device_ResetMasterAndSlaveController EQU IdeCommand_ResetMasterAndSlaveController 57 77 %endif 58 78 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
r501 r507 20 20 ; Section containing code 21 21 SECTION .text 22 23 ;-------------------------------------------------------------------- 24 ; IdeCommand_ResetMasterAndSlaveController 25 ; Parameters: 26 ; DS:DI: Ptr to DPT (in RAMVARS segment) 27 ; Returns: 28 ; AH: INT 13h Error Code 29 ; CF: Cleared if success, Set if error 30 ; Corrupts registers: 31 ; AL, BX, CX, DX 32 ;-------------------------------------------------------------------- 33 IdeCommand_ResetMasterAndSlaveController: 34 ; HSR0: Set_SRST 35 call AccessDPT_GetDeviceControlByteToAL 36 or al, FLG_DEVCONTROL_SRST | FLG_DEVCONTROL_nIEN ; Set Reset bit 37 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out 38 mov ax, HSR0_RESET_WAIT_US 39 call Timer_DelayMicrosecondsFromAX 40 41 ; HSR1: Clear_wait 42 call AccessDPT_GetDeviceControlByteToAL 43 or al, FLG_DEVCONTROL_nIEN 44 and al, ~FLG_DEVCONTROL_SRST ; Clear reset bit 45 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out 46 mov ax, HSR1_RESET_WAIT_US 47 call Timer_DelayMicrosecondsFromAX 48 49 ; HSR2: Check_status 50 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_MAXIMUM, FLG_STATUS_BSY) 51 jmp IdeWait_PollStatusFlagInBLwithTimeoutInBH 52 22 53 23 54 ;-------------------------------------------------------------------- … … 49 80 test bh, FLG_DRVNHEAD_DRV ; Wait already done for Master 50 81 jnz SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster 51 call AHDh_WaitUntilDriveMotorHasReachedFullSpeed 82 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_MOTOR_STARTUP, FLG_STATUS_DRDY) 83 call IdeWait_PollStatusFlagInBLwithTimeoutInBH 52 84 .SkipLongWaitSinceDriveIsNotPrimaryMaster: 53 85 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r493 r507 378 378 dw UnsupportedFunction ; 0Bh, Write Disk Sectors with ECC (XT, AT, EISA) 379 379 dw AHCh_HandlerForSeek ; 0Ch, Seek (All) 380 dw AH Dh_HandlerForResetHardDisk; 0Dh, Alternate Disk Reset (All)380 dw AH9h_HandlerForInitializeDriveParameters ; 0Dh, Alternate Disk Reset (All) 381 381 dw UnsupportedFunction ; 0Eh, Read Sector Buffer (XT, PS/1), ESDI Undocumented Diagnostic (PS/2) 382 382 dw UnsupportedFunction ; 0Fh, Write Sector Buffer (XT, PS/1), ESDI Undocumented Diagnostic (PS/2) -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
r505 r507 119 119 jz SHORT .ErrorCodeNotUsed 120 120 mov bl, [di+DPT.bIdevarsOffset] ; replace drive number with Idevars pointer for cmp with dl 121 .ErrorCodeNotUsed: 121 122 122 .ErrorCodeNotUsed: ; BH will be garbage on exit if this entry point is used, 123 mov si, ControllerResetForDPTinDSDI 124 call .CallSIforEveryDrive ; Reset all drives to power on settings 125 mov si, AH9h_InitializeDriveForUse 126 ; Fall to .CallSIforEveryDrive ; Initialize all drives 127 128 .CallSIforEveryDrive: ; BH will be garbage on exit if this entry point is used, 123 129 ; but reset of all drives will still happen 124 130 … … 130 136 ; will point to them. Performance isn't an issue, as this is a reset operation. 131 137 ; 132 mov cx, (ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) / IDEVARS_size138 mov cx, NUMBER_OF_IDEVARS 133 139 134 140 .loop: 141 push si 135 142 call FindDPT_ForIdevarsOffsetInDL ; look for the first drive on this controller, if any 143 pop si 136 144 jc SHORT .notFound 137 145 138 call AHDh_ResetDrive ; reset master and slave on that controller 146 push bx 147 push cx 148 push dx 149 call si ; Reset Master AND Slave or initialize Master OR Slave drive 150 pop dx 151 pop cx 152 pop bx 139 153 call BackupErrorCodeFromTheRequestedDriveToBH ; save error code if same controller as drive from entry 140 154 … … 142 156 add dl, IDEVARS_size ; move Idevars pointer forward 143 157 loop .loop 158 ret 144 159 145 .done: 146 ret 160 161 ;-------------------------------------------------------------------- 162 ; ControllerResetForDPTinDSDI 163 ; Parameters: 164 ; DS:DI: Ptr to DPT for drive to reset (resets both Master and Slave drive) 165 ; SS:BP: Ptr to IDEPACK 166 ; Returns: 167 ; AH: Int 13h return status 168 ; CF: 0 if successful, 1 if error 169 ; Corrupts registers: 170 ; AL, BX, CX, DX 171 ;-------------------------------------------------------------------- 172 ControllerResetForDPTinDSDI: 173 %ifdef MODULE_IRQ 174 call Interrupts_UnmaskInterruptControllerForDriveInDSDI 175 %endif 176 %ifdef MODULE_ADVANCED_ATA 177 call Device_ResetMasterAndSlaveController 178 jmp AdvAtaInit_InitializeControllerForDPTinDSDI 179 %else 180 jmp Device_ResetMasterAndSlaveController 181 %endif -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r399 r507 69 69 ; DS:DI: Ptr to DPT for Single or Slave Drive 70 70 ; Returns: 71 ; AH: Int 13h return status 71 72 ; CF: Cleared if success or no controller to initialize 72 73 ; Set if error 73 74 ; Corrupts registers: 74 ; A X, BX, CX, DX75 ; AL, BX, CX, DX 75 76 ;-------------------------------------------------------------------- 76 77 AdvAtaInit_InitializeControllerForDPTinDSDI: … … 91 92 92 93 .NoAdvancedController: 94 xor ax, ax ; Success 93 95 ret 94 96 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
r443 r507 80 80 call DetectDrives_FromAllIDEControllers 81 81 call Interrupts_InitializeInterruptVectors 82 ; Fall to .StoreDptPointersToIntVectors83 84 ;--------------------------------------------------------------------85 ; .StoreDptPointersToIntVectors86 ; Parameters:87 ; DS: RAMVARS segment88 ; ES: BDA and interrupt vector segment (zero)89 ; Returns:90 ; Nothing91 ; Corrupts registers:92 ; DX, DI93 ;--------------------------------------------------------------------94 .StoreDptPointersToIntVectors:95 mov dl, 80h96 call FindDPT_ForDriveNumberInDL ; DPT to DS:DI97 jc SHORT .FindForDrive81h ; Store nothing if not our drive98 mov [es:HD0_DPT_POINTER_41h*4], di99 mov [es:HD0_DPT_POINTER_41h*4+2], ds100 .FindForDrive81h:101 inc dx102 call FindDPT_ForDriveNumberInDL103 jc SHORT .ResetDetectedDrives104 mov [es:HD1_DPT_POINTER_46h*4], di105 mov [es:HD1_DPT_POINTER_46h*4+2], ds106 82 ; Fall to .ResetDetectedDrives 107 83 -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r506 r507 266 266 %include "AH9h_HInit.asm" ; Required by Int13h_Jump.asm 267 267 %include "AHCh_HSeek.asm" ; Required by Int13h_Jump.asm 268 %include "AHDh_HReset.asm" ; Required by Int13h_Jump.asm269 268 %include "AH10h_HReady.asm" ; Required by Int13h_Jump.asm 270 269 %include "AH11h_HRecal.asm" ; Required by Int13h_Jump.asm
Note:
See TracChangeset
for help on using the changeset viewer.