Changeset 221 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h


Ignore:
Timestamp:
Jan 25, 2012, 2:36:47 PM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • AH=0Ch (Seek) should work properly again.
  • More than 127 sectors are no longer allowed for EBIOS functions.
  • Changed location for BOOTNFO structs.
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
Files:
1 deleted
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm

    r170 r221  
    2222ALIGN JUMP_ALIGN
    2323AH25h_HandlerForGetDriveInformation:
    24     mov     si, [bp+IDEPACK.intpack+INTPACK.bx]
     24    mov     al, 1           ; Read 1 sector
     25    call    Prepare_BufferToESSIforOldInt13hTransfer
    2526%ifdef USE_186
    2627    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm

    r218 r221  
    1515;       SS:BP:  Ptr to IDEPACK
    1616;   Parameters on INTPACK:
    17 ;       AL:     Number of sectors to read (1...255, 0=256)
     17;       AL:     Number of sectors to read (1...128)
    1818;       CH:     Cylinder number, bits 7...0
    1919;       CL:     Bits 7...6: Cylinder number bits 9 and 8
     
    2828ALIGN JUMP_ALIGN
    2929AH2h_HandlerForReadDiskSectors:
    30     call    CommandLookup_GetOldInt13hIndexToBX
     30    call    Prepare_BufferToESSIforOldInt13hTransfer
     31    call    Prepare_GetOldInt13hCommandIndexToBX
    3132    mov     ah, [cs:bx+g_rgbReadCommandLookup]
    3233    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm

    r169 r221  
    1515;       SS:BP:  Ptr to IDEREGS_AND_INTPACK
    1616;   Parameters on INTPACK:
    17 ;       AL:     Number of sectors to write (1...255, 0=256)
     17;       AL:     Number of sectors to write (1...128)
    1818;       CH:     Cylinder number, bits 7...0
    1919;       CL:     Bits 7...6: Cylinder number bits 9 and 8
     
    2727ALIGN JUMP_ALIGN
    2828AH3h_HandlerForWriteDiskSectors:
    29     call    CommandLookup_GetOldInt13hIndexToBX
     29    call    Prepare_BufferToESSIforOldInt13hTransfer
     30    call    Prepare_GetOldInt13hCommandIndexToBX
    3031    mov     ah, [cs:bx+g_rgbWriteCommandLookup]
    3132    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
    32     mov     si, [bp+IDEPACK.intpack+INTPACK.bx]
    3333%ifdef USE_186
    3434    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm

    r169 r221  
    1515;       SS:BP:  Ptr to INTPACK
    1616;   Parameters on INTPACK in SS:BP:
    17 ;       AL:     Number of sectors to verify (1...255, 0=256)
     17;       AL:     Number of sectors to verify (1...128)
    1818;       CH:     Cylinder number, bits 7...0
    1919;       CL:     Bits 7...6: Cylinder number bits 9 and 8
     
    2626ALIGN JUMP_ALIGN
    2727AH4h_HandlerForVerifyDiskSectors:
     28    call    Prepare_ByValidatingSectorsInALforOldInt13h
    2829    mov     ah, COMMAND_VERIFY_SECTORS
    2930    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm

    r218 r221  
    2424ALIGN JUMP_ALIGN
    2525AH42h_HandlerForExtendedReadSectors:
    26     call    AH42h_LoadDapToESSIandVerifyForTransfer
    27     call    CommandLookup_GetEbiosIndexToBX
     26    call    Prepare_ByLoadingDapToESSIandVerifyingForTransfer
    2827    mov     ah, [cs:bx+g_rgbReadCommandLookup]
    2928    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
     
    3534    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    3635%endif
    37 
    38 
    39 ;--------------------------------------------------------------------
    40 ; AH42h_LoadDapToESSIandVerifyForTransfer
    41 ;   Parameters:
    42 ;       SI:     Same as in INTPACK
    43 ;       SS:BP:  Ptr to IDEPACK
    44 ;   Parameters on INTPACK:
    45 ;       DS:SI:  Ptr to Disk Address Packet
    46 ;   Returns:
    47 ;       ES:SI:  Ptr to Disk Address Packet (DAP)
    48 ;       Exits from INT 13h if invalid DAP
    49 ;   Corrupts registers:
    50 ;       Nothing
    51 ;--------------------------------------------------------------------
    52 ALIGN JUMP_ALIGN
    53 AH42h_LoadDapToESSIandVerifyForTransfer:
    54     mov     es, [bp+IDEPACK.intpack+INTPACK.ds] ; ES:SI to point Disk Address Packet
    55     cmp     BYTE [es:si+DAP.bSize], MINIMUM_DAP_SIZE
    56     jb      SHORT AH42h_ReturnWithInvalidFunctionError
    57     cmp     WORD [es:si+DAP.bSectorCount], BYTE 0
    58     je      SHORT AH42h_ReturnWithInvalidFunctionError
    59     ret
    60 AH42h_ReturnWithInvalidFunctionError:
    61     mov     ah, RET_HD_INVALID
    62     jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm

    r169 r221  
    2727AH43h_HandlerForExtendedWriteSectors:
    2828    cmp     BYTE [bp+IDEPACK.intpack+INTPACK.al], 2 ; Verify requested?
    29     jae     SHORT AH42h_ReturnWithInvalidFunctionError
     29    jae     SHORT Prepare_ReturnFromInt13hWithInvalidFunctionError
    3030
    31     call    AH42h_LoadDapToESSIandVerifyForTransfer
    32     call    CommandLookup_GetEbiosIndexToBX
     31    call    Prepare_ByLoadingDapToESSIandVerifyingForTransfer
    3332    mov     ah, [cs:bx+g_rgbWriteCommandLookup]
    3433    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm

    r165 r221  
    2424ALIGN JUMP_ALIGN
    2525AH44h_HandlerForExtendedVerifySectors:
    26     call    AH42h_LoadDapToESSIandVerifyForTransfer
    27     call    CommandLookup_GetEbiosIndexToBX
     26    call    Prepare_ByLoadingDapToESSIandVerifyingForTransfer
    2827    mov     ah, [cs:bx+g_rgbVerifyCommandLookup]
    2928    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH47h_ExtendedSeek.asm

    r169 r221  
    2525    mov     es, [bp+IDEPACK.intpack+INTPACK.ds] ; ES:SI to point Disk Address Packet
    2626    cmp     BYTE [es:si+DAP.bSize], MINIMUM_DAP_SIZE
    27     jb      SHORT AH42h_ReturnWithInvalidFunctionError
     27    jb      SHORT Prepare_ReturnFromInt13hWithInvalidFunctionError
    2828
    2929    mov     ah, COMMAND_SEEK
     
    3636    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    3737%endif
     38
     39.WriteWithVerifyNotSupported:
     40    jmp     Prepare_ReturnFromInt13hWithInvalidFunctionError
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm

    r170 r221  
    4040    mov     ax, MINIMUM_EDRIVEINFO_SIZE
    4141    cmp     [di+EDRIVE_INFO.wSize], ax
    42     jb      SHORT AH42h_ReturnWithInvalidFunctionError
     42    jb      SHORT Prepare_ReturnFromInt13hWithInvalidFunctionError
    4343    je      SHORT .SkipEddConfigurationParameters
    4444
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm

    r220 r221  
    55SECTION .text
    66
     7;--------------------------------------------------------------------
     8; Prepare_ByLoadingDapToESSIandVerifyingForTransfer
     9;   Parameters:
     10;       SI:     Offset to DAP
     11;       DS:DI:  Ptr to DPT
     12;       SS:BP:  Ptr to IDEPACK
     13;   Parameters on INTPACK:
     14;       DS:SI:  Ptr to Disk Address Packet
     15;   Returns:
     16;       BX:     Index to command lookup table
     17;       ES:SI:  Ptr to Disk Address Packet (DAP)
     18;       Exits from INT 13h if invalid DAP
     19;   Corrupts registers:
     20;       AX, DX
     21;--------------------------------------------------------------------
     22%ifdef MODULE_EBIOS
     23ALIGN JUMP_ALIGN
     24Prepare_ByLoadingDapToESSIandVerifyingForTransfer:
     25    ; Load pointer to DAP to ES:SI and make sure it is valid
     26    mov     es, [bp+IDEPACK.intpack+INTPACK.ds] ; ES:SI to point Disk Address Packet
     27    cmp     BYTE [es:si+DAP.bSize], MINIMUM_DAP_SIZE
     28    jb      SHORT InvalidDAP
     29
     30    ; Make sure that sector count is valid
     31    mov     ax, [es:si+DAP.wSectorCount]
     32    test    ax, ax
     33    jz      SHORT ZeroSectorsRequestedSoNoErrors
     34    cmp     ax, BYTE 127
     35    ja      SHORT InvalidNumberOfSectorsRequested
     36    ; Fall to GetEbiosCommandIndexToBX
     37
     38;--------------------------------------------------------------------
     39; GetEbiosCommandIndexToBX
     40;   Parameters:
     41;       DS:DI:  Ptr to DPT
     42;       ES:SI:  Ptr to DAP (Disk Address Packet)
     43;   Returns:
     44;       BX:     Index to command lookup table
     45;   Corrupts registers:
     46;       AX, DX
     47;--------------------------------------------------------------------
     48GetEbiosCommandIndexToBX:
     49    ; LBA28 or LBA48 command
     50    xor     dx, dx
     51    mov     al, [es:si+DAP.qwLBA+3] ; Load LBA48 byte 3 (bits 24...31)
     52    and     ax, 00F0h               ; Clear LBA28 bits 24...27
     53    or      ax, [es:si+DAP.qwLBA+4] ; Set bits from LBA bytes 4 and 5
     54    cmp     dx, ax                  ; Set CF if any of bits 28...47 set
     55    rcl     dx, 1                   ; DX = 0 for LBA28, DX = 1 for LBA48
     56    call    Prepare_GetOldInt13hCommandIndexToBX
     57    or      bx, dx                  ; Set block mode / single sector bit
     58    ret
     59%endif
     60
     61
     62;--------------------------------------------------------------------
     63; Prepare_GetOldInt13hCommandIndexToBX
     64;   Parameters:
     65;       DS:DI:  Ptr to DPT
     66;   Returns:
     67;       BX:     Index to command lookup table
     68;   Corrupts registers:
     69;       Nothing
     70;--------------------------------------------------------------------
     71ALIGN JUMP_ALIGN
     72Prepare_GetOldInt13hCommandIndexToBX:
     73    ; Block mode or single sector
     74    mov     bl, [di+DPT.bFlagsHigh]
     75    and     bx, BYTE FLGH_DPT_BLOCK_MODE_SUPPORTED  ; Bit 1
     76    ret
     77
     78
    779;---------------------------------------------------------------------
    8 ; PrepareBuffer_ToESSIforOldInt13hTransfer
     80; Prepare_BufferToESSIforOldInt13hTransfer
    981;   Parameters:
    1082;       AL:     Number of sectors to transfer
     
    1991;--------------------------------------------------------------------
    2092ALIGN JUMP_ALIGN
    21 PrepareBuffer_ToESSIforOldInt13hTransfer:
     93Prepare_BufferToESSIforOldInt13hTransfer:
    2294    ; Normalize buffer pointer
    2395    mov     bx, [bp+IDEPACK.intpack+INTPACK.bx] ; Load offset
     
    2799    mov     es, bx                              ; Segment normalized
    28100    and     si, BYTE 0Fh                        ; Offset normalized
     101    ; Fall to Prepare_ByValidatingSectorsInALforOldInt13h
    29102
    30     ; Check if valid number of sectors
     103
     104;---------------------------------------------------------------------
     105; Prepare_ByValidatingSectorsInALforOldInt13h
     106;   Parameters:
     107;       AL:     Number of sectors to transfer
     108;   Returns:
     109;       Exits INT 13h if invalid number of sectors in AL
     110;   Corrupts registers:
     111;       Nothing
     112;--------------------------------------------------------------------
     113ALIGN JUMP_ALIGN
     114Prepare_ByValidatingSectorsInALforOldInt13h:
    31115    test    al, al
    32     js      SHORT .CheckZeroOffsetFor128Sectors
    33     jz      SHORT .InvalidNumberOfSectorsRequested
     116    js      SHORT .CheckZeroOffsetFor128Sectors     ; 128 or more
     117    jz      SHORT InvalidNumberOfSectorsRequested   ; Zero not allowed for old INT 13h
    34118    ret     ; Continue with transfer
    35119
     
    37121.CheckZeroOffsetFor128Sectors:
    38122    cmp     al, 128
    39     ja      SHORT .InvalidNumberOfSectorsRequested
     123    ja      SHORT InvalidNumberOfSectorsRequested
    40124    mov     ah, RET_HD_BOUNDARY
    41125    test    si, si                              ; Offset must be zero to xfer 128 sectors
    42     jnz     SHORT .CannotAlignPointerProperly
     126    jnz     SHORT CannotAlignPointerProperly
    43127    ret     ; Continue with transfer
    44128
    45 .InvalidNumberOfSectorsRequested:
     129InvalidDAP:
     130InvalidNumberOfSectorsRequested:
     131Prepare_ReturnFromInt13hWithInvalidFunctionError:
    46132    mov     ah, RET_HD_INVALID
    47 .CannotAlignPointerProperly:
     133ZeroSectorsRequestedSoNoErrors:
     134CannotAlignPointerProperly:
    48135    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    49136
     137
     138
     139; Command lookup tables
     140g_rgbReadCommandLookup:
     141    db      COMMAND_READ_SECTORS        ; 00b, CHS or LBA28 single sector
     142    db      COMMAND_READ_SECTORS_EXT    ; 01b, LBA48 single sector
     143    db      COMMAND_READ_MULTIPLE       ; 10b, CHS or LBA28 block mode
     144    db      COMMAND_READ_MULTIPLE_EXT   ; 11b, LBA48 block mode
     145
     146g_rgbWriteCommandLookup:
     147    db      COMMAND_WRITE_SECTORS
     148    db      COMMAND_WRITE_SECTORS_EXT
     149    db      COMMAND_WRITE_MULTIPLE
     150    db      COMMAND_WRITE_MULTIPLE_EXT
     151
     152g_rgbVerifyCommandLookup:
     153    db      COMMAND_VERIFY_SECTORS
     154    db      COMMAND_VERIFY_SECTORS_EXT
     155    db      COMMAND_VERIFY_SECTORS
     156    db      COMMAND_VERIFY_SECTORS_EXT
Note: See TracChangeset for help on using the changeset viewer.