Changeset 501 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device
- Timestamp:
- Jan 26, 2013, 4:58:50 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Device
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r480 r501 55 55 %else ; IDE 56 56 Device_FinalizeDPT EQU IdeDPT_Finalize 57 %endif58 59 60 ;--------------------------------------------------------------------61 ; Device_ResetMasterAndSlaveController62 ; Parameters:63 ; DS:DI: Ptr to DPT (in RAMVARS segment)64 ; Returns:65 ; AH: INT 13h Error Code66 ; CF: Cleared if success, Set if error67 ; Corrupts registers:68 ; AL, BX, CX, DX69 ;--------------------------------------------------------------------70 %ifdef MODULE_SERIAL ; IDE + Serial71 Device_ResetMasterAndSlaveController:72 TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort73 jmp IdeCommand_ResetMasterAndSlaveController74 75 %else ; IDE76 Device_ResetMasterAndSlaveController EQU IdeCommand_ResetMasterAndSlaveController77 57 %endif 78 58 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
r493 r501 20 20 ; Section containing code 21 21 SECTION .text 22 23 ;--------------------------------------------------------------------24 ; IdeCommand_ResetMasterAndSlaveController25 ; Parameters:26 ; DS:DI: Ptr to DPT (in RAMVARS segment)27 ; Returns:28 ; AH: INT 13h Error Code29 ; CF: Cleared if success, Set if error30 ; Corrupts registers:31 ; AL, BX, CX, DX32 ;--------------------------------------------------------------------33 IdeCommand_ResetMasterAndSlaveController:34 ; HSR0: Set_SRST35 call AccessDPT_GetDeviceControlByteToAL36 or al, FLG_DEVCONTROL_SRST | FLG_DEVCONTROL_nIEN ; Set Reset bit37 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out38 mov ax, HSR0_RESET_WAIT_US39 call Timer_DelayMicrosecondsFromAX40 41 ; HSR1: Clear_wait42 call AccessDPT_GetDeviceControlByteToAL43 or al, FLG_DEVCONTROL_nIEN44 and al, ~FLG_DEVCONTROL_SRST ; Clear reset bit45 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out46 mov ax, HSR1_RESET_WAIT_US47 call Timer_DelayMicrosecondsFromAX48 49 ; HSR2: Check_status50 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_MAXIMUM, FLG_STATUS_BSY)51 jmp IdeWait_PollStatusFlagInBLwithTimeoutInBH52 53 22 54 23 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm
r496 r501 77 77 78 78 .ShlRegisterIndexInDX: 79 eSHL_IMdx, 179 shl dx, 1 80 80 ; Fall to .InputToALfromRegisterInDX 81 81 … … 98 98 ;-------------------------------------------------------------------- 99 99 IdeIO_OutputALtoIdeControlBlockRegisterInDL: 100 ; Note! We do not need to reverse A0 and A3 for XTIDE rev 2 since101 ; the only Control Block Register we access is DEVICE_CONTROL_REGISTER_out102 ; at offset 6 (0110b).103 100 xor dh, dh ; IDE Register index now in DX 104 101 105 102 mov bl, [di+DPT_ATA.bDevice] 106 103 cmp bl, DEVICE_8BIT_XTIDE_REV2 107 jbe SHORT .OutputALtoControlBlockRegisterInDX ; Standard IDE controllers and XTIDE rev 1 104 je SHORT .ReverseA0andA3fromRegisterIndexInDX 105 jb SHORT .OutputALtoControlBlockRegisterInDX ; Standard IDE controllers and XTIDE rev 1 108 106 109 107 %ifdef MODULE_8BIT_IDE_ADVANCED … … 117 115 %endif 118 116 117 .ReverseA0andA3fromRegisterIndexInDX: 118 ; We cannot use lookup table since A3 will be always set because 119 ; Control Block Registers start from Command Block + 8h. We can do 120 ; a small trick since we only access Device Control Register at 121 ; offset 6h: Always clear A3 and set A0. 122 add dx, [cs:bx+IDEVARS.wControlBlockPort] 123 xor dl, 1001b ; Clear A3, Set A0 124 jmp SHORT OutputALtoPortInDX 125 119 126 .ShlRegisterIndexInDX: 120 127 add dl, XTCF_CONTROL_BLOCK_OFFSET 121 eSHL_IMdx, 1128 shl dx, 1 122 129 jmp SHORT OutputALtoRegisterInDX 123 130 … … 163 170 ret 164 171 %endif 165 172 166 173 .ReverseA0andA3fromRegisterIndexInDX: 167 174 mov bx, dx … … 170 177 171 178 .ShlRegisterIndexInDX: 172 eSHL_IMdx, 1179 shl dx, 1 173 180 ; Fall to OutputALtoRegisterInDX 174 181
Note:
See TracChangeset
for help on using the changeset viewer.