Changeset 267 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- Feb 24, 2012, 8:34:41 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Device
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
r266 r267 19 19 call AccessDPT_GetDeviceControlByteToAL 20 20 or al, FLG_DEVCONTROL_SRST | FLG_DEVCONTROL_nIEN ; Set Reset bit 21 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER 21 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out 22 22 mov ax, HSR0_RESET_WAIT_US 23 23 call Timer_DelayMicrosecondsFromAX … … 27 27 or al, FLG_DEVCONTROL_nIEN 28 28 and al, ~FLG_DEVCONTROL_SRST ; Clear reset bit 29 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER 29 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out 30 30 mov ax, HSR1_RESET_WAIT_US 31 31 call Timer_DelayMicrosecondsFromAX … … 122 122 .DoNotSetInterruptInServiceFlag: 123 123 %endif 124 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER 124 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out 125 125 126 126 ; Output Feature Number 127 127 mov al, [bp+IDEPACK.bFeatures] 128 OUTPUT_AL_TO_IDE_REGISTER 128 OUTPUT_AL_TO_IDE_REGISTER FEATURES_REGISTER_out 129 129 130 130 ; Output Sector Address High (only used by LBA48) … … 140 140 ; Output command 141 141 mov al, [bp+IDEPACK.bCommand] 142 OUTPUT_AL_TO_IDE_REGISTER 142 OUTPUT_AL_TO_IDE_REGISTER COMMAND_REGISTER_out 143 143 144 144 ; Wait until command completed … … 182 182 ; Select Master or Slave Drive 183 183 mov al, [bp+IDEPACK.bDrvAndHead] 184 OUTPUT_AL_TO_IDE_REGISTER 184 OUTPUT_AL_TO_IDE_REGISTER DRIVE_AND_HEAD_SELECT_REGISTER 185 185 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRDY, FLG_STATUS_DRDY) 186 186 cmp BYTE [bp+IDEPACK.bCommand], COMMAND_IDENTIFY_DEVICE … … 204 204 ALIGN JUMP_ALIGN 205 205 IDEDEVICE%+OutputSectorCountAndAddress: 206 OUTPUT_AL_TO_IDE_REGISTER 206 OUTPUT_AL_TO_IDE_REGISTER SECTOR_COUNT_REGISTER 207 207 208 208 mov al, ah 209 OUTPUT_AL_TO_IDE_REGISTER 209 OUTPUT_AL_TO_IDE_REGISTER LBA_LOW_REGISTER 210 210 211 211 mov al, cl 212 OUTPUT_AL_TO_IDE_REGISTER 212 OUTPUT_AL_TO_IDE_REGISTER LBA_MIDDLE_REGISTER 213 213 214 214 mov al, ch 215 JUMP_TO_OUTPUT_AL_TO_IDE_REGISTER 215 JUMP_TO_OUTPUT_AL_TO_IDE_REGISTER LBA_HIGH_REGISTER -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm
r266 r267 20 20 IDEDEVICE%+Error_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL: 21 21 mov ah, al ; IDE Status Register to AH 22 INPUT_TO_AL_FROM_IDE_REGISTER ERROR_REGISTER_in 22 INPUT_TO_AL_FROM_IDE_REGISTER ERROR_REGISTER_in 23 24 %ifndef ASSEMBLE_SHARED_IDE_DEVICE_FUNCTIONS ; JR-IDE/ISA 25 jmp ContinueFromMemIdeError 26 %else 27 ContinueFromMemIdeError: 23 28 xchg al, ah ; Status Register now in AL, Error Register now in AH 24 29 … … 30 35 31 36 ; Fall to GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX 32 %ifndef ASSEMBLE_SHARED_IDE_DEVICE_FUNCTIONS ; JR-IDE/ISA 33 jmp GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX 34 %endif 37 35 38 36 39 ;-------------------------------------------------------------------- … … 46 49 ; BX 47 50 ;-------------------------------------------------------------------- 48 %ifdef ASSEMBLE_SHARED_IDE_DEVICE_FUNCTIONS49 51 ALIGN JUMP_ALIGN 50 52 GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX: -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm
r266 r267 9 9 ; Parameters: 10 10 ; DS:DI: Ptr to DPT (in RAMVARS segment) 11 ; SS:BP: Ptr to IDEPACK orPIOVARS11 ; SS:BP: Ptr to IDEPACK, PIOVARS or MEMPIOVARS 12 12 ; Returns: 13 13 ; AH: INT 13h Error Code -
trunk/XTIDE_Universal_BIOS/Src/Device/MemoryMappedIDE/MemIdeTransfer.asm
r266 r267 70 70 ;-------------------------------------------------------------------- 71 71 ReadFromSectorAccessWindow: 72 pop ds ; CS -> DS73 mov di, si 74 mov si, JRIDE_SECTOR_ACCESS_WINDOW_OFFSET 75 76 call WaitUntilReadyToTransferNextBlock 77 jc SHORT ReturnWithMemoryIOtransferErrorInAH 78 79 mov cx, [bp+ PIOVARS.wWordsInBlock]72 pop ds ; CS -> DS 73 mov di, si ; ES:DI = destination 74 mov si, JRIDE_SECTOR_ACCESS_WINDOW_OFFSET ; DS:SI = source 75 76 call WaitUntilReadyToTransferNextBlock 77 jc SHORT ReturnWithMemoryIOtransferErrorInAH 78 79 mov cx, [bp+MEMPIOVARS.wWordsInBlock] 80 80 81 81 ALIGN JUMP_ALIGN 82 82 .ReadNextBlockFromDrive: 83 cmp [bp+ PIOVARS.wWordsLeft], cx83 cmp [bp+MEMPIOVARS.wWordsLeft], cx 84 84 jbe SHORT .ReadLastBlockFromDrive 85 85 call ReadSingleBlockFromSectorAccessWindowInDSSItoESDI … … 88 88 89 89 ; Increment number of successfully read WORDs 90 mov cx, [bp+ PIOVARS.wWordsInBlock]91 sub [bp+ PIOVARS.wWordsLeft], cx92 add [bp+ PIOVARS.wWordsDone], cx90 mov cx, [bp+MEMPIOVARS.wWordsInBlock] 91 sub [bp+MEMPIOVARS.wWordsLeft], cx 92 add [bp+MEMPIOVARS.wWordsDone], cx 93 93 jmp SHORT .ReadNextBlockFromDrive 94 94 95 95 ALIGN JUMP_ALIGN 96 96 .ReadLastBlockFromDrive: 97 mov ch, [bp+ PIOVARS.wWordsLeft+1]; Sectors left97 mov ch, [bp+MEMPIOVARS.wWordsLeft+1] ; Sectors left 98 98 call ReadSingleBlockFromSectorAccessWindowInDSSItoESDI 99 99 … … 107 107 ReturnWithMemoryIOtransferErrorInAH: 108 108 lds di, [bp+MEMPIOVARS.fpDPT] ; DPT now in DS:DI 109 mov cx, [bp+ PIOVARS.wWordsDone]109 mov cx, [bp+MEMPIOVARS.wWordsDone] 110 110 jc SHORT .ConvertTransferredWordsInCXtoSectors 111 add cx, [bp+ PIOVARS.wWordsLeft]; Never sets CF111 add cx, [bp+MEMPIOVARS.wWordsLeft] ; Never sets CF 112 112 .ConvertTransferredWordsInCXtoSectors: 113 113 xchg cl, ch … … 141 141 jc SHORT ReturnWithMemoryIOtransferErrorInAH 142 142 143 mov cx, [bp+ PIOVARS.wWordsInBlock]143 mov cx, [bp+MEMPIOVARS.wWordsInBlock] 144 144 145 145 ALIGN JUMP_ALIGN 146 146 .WriteNextBlockToDrive: 147 cmp [bp+ PIOVARS.wWordsLeft], cx147 cmp [bp+MEMPIOVARS.wWordsLeft], cx 148 148 jbe SHORT .WriteLastBlockToDrive 149 149 call WriteSingleBlockFromDSSIToSectorAccessWindowInESDI … … 152 152 153 153 ; Increment number of successfully written WORDs 154 mov cx, [bp+ PIOVARS.wWordsInBlock]155 sub [bp+ PIOVARS.wWordsLeft], cx156 add [bp+ PIOVARS.wWordsDone], cx154 mov cx, [bp+MEMPIOVARS.wWordsInBlock] 155 sub [bp+MEMPIOVARS.wWordsLeft], cx 156 add [bp+MEMPIOVARS.wWordsDone], cx 157 157 jmp SHORT .WriteNextBlockToDrive 158 158 159 159 ALIGN JUMP_ALIGN 160 160 .WriteLastBlockToDrive: 161 mov ch, [bp+ PIOVARS.wWordsLeft+1] ; Sectors left161 mov ch, [bp+MEMPIOVARS.wWordsLeft+1] ; Sectors left 162 162 ePUSH_T bx, CheckErrorsAfterTransferringLastMemoryMappedBlock 163 163 ; Fall to WriteSingleBlockFromDSSIToSectorAccessWindowInESDI
Note:
See TracChangeset
for help on using the changeset viewer.