Changeset 617 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Aug 10, 2021, 7:27:30 AM (3 years ago)
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r613 r617 164 164 165 165 ;-------------------------------------------------------------------- 166 ; Device_ReadLBAlowRegisterToAL 167 ; Returns LBA low register / Sector number register contents. 168 ; Note that this returns valid value only after transfer command (read/write/verify) 169 ; has stopped to an error. Do not call this otherwise. 170 ; Parameters: 171 ; DS:DI: Ptr to DPT (in RAMVARS segment) 172 ; Returns: 173 ; AL: Byte read from the device register 174 ; Corrupts registers: 175 ; BX, DX 176 ;-------------------------------------------------------------------- 177 ;%ifdef MODULE_SERIAL ; IDE + Serial 178 ;ALIGN JUMP_ALIGN 179 ;Device_ReadLBAlowRegisterToAL: 180 ; test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 181 ;%ifdef USE_386 182 ; jz IdeCommand_ReadLBAlowRegisterToAL 183 ; jmp SerialCommand_ReadLBAlowRegisterToAL 184 ;%else 185 ; jnz SHORT .ReadFromSerialPort 186 ; jmp IdeCommand_ReadLBAlowRegisterToAL 187 188 ;ALIGN JUMP_ALIGN 189 ;.ReadFromSerialPort: 190 ; jmp SerialCommand_ReadLBAlowRegisterToAL 191 ;%endif 192 193 ;%else ; IDE only 194 Device_ReadLBAlowRegisterToAL EQU IdeCommand_ReadLBAlowRegisterToAL 195 ;%endif 196 ; TODO: For now we simply assume serial device do not produce verify errors 197 198 199 ;-------------------------------------------------------------------- 166 200 ; Device_SelectDrive 167 201 ; Parameters: -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
r612 r617 288 288 OUTPUT_AL_TO_IDE_REGISTER LBA_HIGH_REGISTER 289 289 ret 290 291 292 ;-------------------------------------------------------------------- 293 ; IdeCommand_ReadLBAlowRegisterToAL 294 ; Returns LBA low register / Sector number register contents. 295 ; Note that this returns valid value only after transfer command (read/write/verify) 296 ; has stopped to an error. Do not call this otherwise. 297 ; Parameters: 298 ; DS:DI: Ptr to DPT (in RAMVARS segment) 299 ; Returns: 300 ; AL: Byte read from the register 301 ; Corrupts registers: 302 ; BX, DX 303 ;-------------------------------------------------------------------- 304 ALIGN JUMP_ALIGN 305 IdeCommand_ReadLBAlowRegisterToAL: 306 ; HOB bit (defined in 48-bit address feature set) should be zero by default 307 ; so we get the correct value for CHS, LBA28 and LBA48 drives and commands 308 INPUT_TO_AL_FROM_IDE_REGISTER LBA_LOW_REGISTER 309 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm
r568 r617 29 29 ; DL: Translated Drive number 30 30 ; DS:DI: Ptr to DPT (in RAMVARS segment) 31 ; SS:BP: Ptr to I NTPACK31 ; SS:BP: Ptr to IDEPACK 32 32 ; Parameters on INTPACK in SS:BP: 33 33 ; AL: Number of sectors to verify (1...128) … … 46 46 call Prepare_ByValidatingSectorsInALforOldInt13h ; Preserves AX 47 47 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY) 48 %ifdef USE_186 49 push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL 50 jmp Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH 51 %else 48 push ax ; Store number of sectors to verify 52 49 call Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH 50 pop cx ; Number of sectors verified if successful 51 jnc SHORT .NoErrors 52 53 ; TODO: For now we assume serial device do not produce verify errors 54 call AH4h_CalculateNumberOfSuccessfullyVerifiedSectors 55 .NoErrors: 53 56 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL 54 %endif 57 58 59 ;-------------------------------------------------------------------- 60 ; Calculates number of succesfully verified sectors. This function works only 61 ; if verify command stopped to an device error (such as bad sector) since IDE 62 ; register contents are not valid unless error. 63 ; 64 ; AH4h_CalculateNumberOfSuccessfullyVerifiedSectors 65 ; Parameters: 66 ; AH: INT 13h error code 67 ; CX: Number of sectors that was meant to we verified 68 ; DS:DI: Ptr to DPT (in RAMVARS segment) 69 ; SS:BP: Ptr to IDEPACK 70 ; Returns with INTPACK in SS:BP: 71 ; CX: Number of sectors succesfully verified 72 ; CF: 1 73 ;-------------------------------------------------------------------- 74 ALIGN JUMP_ALIGN 75 AH4h_CalculateNumberOfSuccessfullyVerifiedSectors: 76 xchg cx, ax ; Store error code to CL 77 call Device_ReadLBAlowRegisterToAL 78 mov ah, [bp+IDEPACK.bLbaLow] 79 sub al, ah ; AL = sector address with verify failure - starting sector address 80 xor ah, ah 81 xchg cx, ax ; Number of successfully verified sectors in CX, error code in AH 82 stc 83 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm
r568 r617 41 41 AH44h_HandlerForExtendedVerifySectors: 42 42 call Prepare_ByLoadingDapToESSIandVerifyingForTransfer 43 push WORD [es:si+DAP.wSectorCount] ; Store for successfull number of sectors transferred 43 44 mov ah, [cs:bx+g_rgbVerifyCommandLookup] 44 45 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY) 45 46 call Idepack_ConvertDapToIdepackAndIssueCommandFromAH 47 48 ; Now we need number of succesfully verifed sectors to CX. Since we did not transfer anything, 49 ; we did not have any sector counter like in read and write functions. 50 ; In case of error, drive LBA registers are set to address where the error occurred. We must 51 ; calculate number of succesfully transferred sectors from it. 52 pop cx 53 jnc SHORT .AllSectorsVerifiedSuccessfully 54 55 ; TODO: For now we assume serial device do not produce verify errors 56 call AH4h_CalculateNumberOfSuccessfullyVerifiedSectors 57 58 ALIGN JUMP_ALIGN 59 .AllSectorsVerifiedSuccessfully: 46 60 jmp SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
Note:
See TracChangeset
for help on using the changeset viewer.