Changeset 167 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Timestamp:
- Aug 21, 2011, 3:42:15 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm
r165 r167 25 25 %ifdef USE_186 26 26 push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 27 ; Fall to AH25h_GetDriveInformationToBufferInESSI fromDriveInDL27 ; Fall to AH25h_GetDriveInformationToBufferInESSI 28 28 %else 29 call AH25h_GetDriveInformationToBufferInESSI fromDriveInDL29 call AH25h_GetDriveInformationToBufferInESSI 30 30 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 31 31 %endif … … 33 33 34 34 ;-------------------------------------------------------------------- 35 ; AH25h_GetDriveInformationToBufferInESSI fromDriveInDL35 ; AH25h_GetDriveInformationToBufferInESSI 36 36 ; Parameters: 37 ; DL: Translated Drive number38 37 ; DS:DI: Ptr to DPT (in RAMVARS segment) 39 38 ; ES:SI: Ptr to buffer to receive 512-byte drive information … … 44 43 ; AL, BX, CX, DX 45 44 ;-------------------------------------------------------------------- 46 AH25h_GetDriveInformationToBufferInESSIfromDriveInDL: 45 ALIGN JUMP_ALIGN 46 AH25h_GetDriveInformationToBufferInESSI: 47 47 push es 48 48 push bp -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm
r165 r167 28 28 ALIGN JUMP_ALIGN 29 29 AH2h_HandlerForReadDiskSectors: 30 cmp BYTE [bp+IDEPACK.intpack+INTPACK.al], 030 cmp al, 0 31 31 jle SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero 32 32 33 xor bx, bx 34 call CommandLookup_OrOldInt13hIndexToBL 33 call CommandLookup_GetOldInt13hIndexToBX 35 34 mov ah, [cs:bx+g_rgbReadCommandLookup] 36 35 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ) … … 55 54 mov ah, RET_HD_INVALID 56 55 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 57 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm
r165 r167 27 27 ALIGN JUMP_ALIGN 28 28 AH3h_HandlerForWriteDiskSectors: 29 cmp BYTE [bp+IDEPACK.intpack+INTPACK.al], 029 cmp al, 0 30 30 jle SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero 31 31 32 xor bx, bx 33 call CommandLookup_OrOldInt13hIndexToBL 32 call CommandLookup_GetOldInt13hIndexToBX 34 33 mov ah, [cs:bx+g_rgbWriteCommandLookup] 35 34 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ) -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm
r165 r167 26 26 ALIGN JUMP_ALIGN 27 27 AH4h_HandlerForVerifyDiskSectors: 28 cmp BYTE [bp+IDEPACK.intpack+INTPACK.al], 028 cmp al, 0 29 29 jle SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero 30 30 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm
r165 r167 17 17 ; Returns with INTPACK: 18 18 ; AH: Major version of EBIOS extensions 19 ; BX: 55AAh19 ; BX: AA55h 20 20 ; CX: Support bits 21 21 ; CF: 0 if succesfull, 1 if error … … 26 26 jne SHORT .EbiosNotSupported 27 27 28 mov BYTE [bp+IDEPACK.intpack+INTPACK.ah], EBIOS_VERSION 29 mov WORD [bp+IDEPACK.intpack+INTPACK.bx], 0AA55h 28 30 mov WORD [bp+IDEPACK.intpack+INTPACK.cx], ENHANCED_DRIVE_ACCESS_SUPPORT 29 mov ah, EBIOS_VERSION30 31 and BYTE [bp+IDEPACK.intpack+INTPACK.flags], ~FLG_FLAGS_CF ; Return with CF cleared 31 32 jmp Int13h_ReturnFromHandlerWithoutStoringErrorCode -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm
r165 r167 55 55 cmp BYTE [es:si+DAP.bSize], MINIMUM_DAP_SIZE 56 56 jb SHORT .DapContentsNotValid 57 cmp BYTE [es:si+DAP.bSectorCount],057 cmp WORD [es:si+DAP.wSectorCount], BYTE 0 58 58 jle SHORT .DapContentsNotValid ; Must be 1...127 59 59 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
r165 r167 23 23 ALIGN JUMP_ALIGN 24 24 AH48h_HandlerForGetExtendedDriveParameters: 25 ; Get ATA Drive Information and total sector count from it 25 ; Get our buffer to ES:SI 26 push di 27 call FindDPT_ForNewDriveToDSDI 28 lea si, [di+LARGEST_DPT_SIZE] ; IdeCommand.asm required fake DPT 29 pop di 26 30 push ds 27 pop es ; ES now points RAMVARS segment 28 mov si, [cs:ROMVARS.bStealSize] 29 and si, BYTE 7Fh 30 eSHL_IM si, 10 ; Kilobytes to bytes 31 sub si, 512 ; Subtract buffer size for offset in RAMVARS 32 call AH25h_GetDriveInformationToBufferInESSIfromDriveInDL 31 pop es 32 33 ; Get Drive ID and total sector count from it 34 call AH25h_GetDriveInformationToBufferInESSI 35 jc SHORT .ReturnWithError 33 36 call AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI 34 xchg cx, ax 37 xchg cx, ax ; Sector count now in BX:DX:CX 35 38 36 39 ; Point ES:DI to Destination buffer 37 40 mov di, [bp+IDEPACK.intpack+INTPACK.si] 38 41 mov es, [bp+IDEPACK.intpack+INTPACK.ds] 39 cmp WORD [es:di+EDRIVE_INFO.wSize], MINIMUM_EDRIVEINFO_SIZE 42 mov ax, MINIMUM_EDRIVEINFO_SIZE 43 cmp WORD [es:di+EDRIVE_INFO.wSize], ax 40 44 jb SHORT .BufferTooSmall 45 je SHORT .SkipEddConfigurationParameters 46 47 ; We do not support EDD Configuration Parameters so set to FFFF:FFFFh 48 xor ax, ax 49 dec ax ; AX = FFFFh 50 mov [es:di+EDRIVE_INFO.fpEDDparams], ax 51 mov [es:di+EDRIVE_INFO.fpEDDparams+2], ax 52 mov ax, EDRIVE_INFO_size 41 53 42 54 ; Fill Extended Drive Information Table in ES:DI 43 mov ax, MINIMUM_EDRIVEINFO_SIZE 44 stosw 55 .SkipEddConfigurationParameters: 56 stosw ; Store Extended Drive Information Table size 45 57 mov al, FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS 46 58 stosw … … 63 75 .BufferTooSmall: 64 76 mov ah, RET_HD_INVALID 77 .ReturnWithError: 65 78 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/CommandLookup.asm
r165 r167 7 7 ;-------------------------------------------------------------------- 8 8 ; CommandLookup_GetEbiosIndexToBX 9 ; CommandLookup_OrOldInt13hIndexToBL10 9 ; Parameters: 11 10 ; DS:DI: Ptr to DPT … … 14 13 ; BX: Index to command lookup table 15 14 ; Corrupts registers: 16 ; AX 15 ; AX, DX 17 16 ;-------------------------------------------------------------------- 18 17 ALIGN JUMP_ALIGN 19 18 CommandLookup_GetEbiosIndexToBX: 20 19 ; LBA28 or LBA48 command 21 xor bx, bx 22 mov ax, [es:si+DAP.qwLBA+3] ; Load LBA48 bytes 3 and 4 23 and al, ~0Fh ; Clear LBA28 bits 24...27 24 or al, [es:si+DAP.qwLBA+5] 25 cmp bx, ax ; Set CF if any of bits 28...47 set 26 rcl bx, 1 ; BX = 0 for LBA28, BX = 1 for LBA48 20 xor dx, dx 21 mov al, [es:si+DAP.qwLBA+3] ; Load LBA48 byte 3 (bits 24...31) 22 and ax, 00F0h ; Clear LBA28 bits 24...27 23 or ax, [es:si+DAP.qwLBA+4] ; Set bits from LBA bytes 4 and 5 24 cmp dx, ax ; Set CF if any of bits 28...47 set 25 rcl dx, 1 ; DX = 0 for LBA28, DX = 1 for LBA48 26 call CommandLookup_GetOldInt13hIndexToBX 27 or bx, dx ; Set block mode / single sector bit 28 ret 27 29 30 ;-------------------------------------------------------------------- 31 ; CommandLookup_GetOldInt13hIndexToBX 32 ; Parameters: 33 ; DS:DI: Ptr to DPT 34 ; Returns: 35 ; BX: Index to command lookup table 36 ; Corrupts registers: 37 ; Nothing 38 ;-------------------------------------------------------------------- 39 ALIGN JUMP_ALIGN 40 CommandLookup_GetOldInt13hIndexToBX: 28 41 ; Block mode or single sector 29 ALIGN JUMP_ALIGN 30 CommandLookup_OrOldInt13hIndexToBL: 31 mov al, FLGH_DPT_BLOCK_MODE_SUPPORTED ; Bit 1 32 and al, [di+DPT.bFlagsHigh] 33 or bl, al ; BX = index to lookup table 42 mov bl, [di+DPT.bFlagsHigh] 43 and bx, BYTE FLGH_DPT_BLOCK_MODE_SUPPORTED ; Bit 1 34 44 ret 35 45 … … 52 62 db COMMAND_VERIFY_SECTORS 53 63 db COMMAND_VERIFY_SECTORS_EXT 54
Note:
See TracChangeset
for help on using the changeset viewer.