Changeset 550 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers


Ignore:
Timestamp:
Apr 27, 2013, 5:30:50 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • CREATE_COMPATIBLE_DPT is now MODULE_COMPATIBLE_TABLES.
  • DPTs pointed by INT 41h and INT 46h are now swapped when swapping drives 81h and 80h.
  • Block mode commands are no longer used when block size is set to 1 with AH=24h.
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
Files:
5 edited

Legend:

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

    r545 r550  
    6868    ; must know what the actual block size is.
    6969    cmp     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
    70     je      SHORT ProcessXTCFsubcommandFromAL.AH1Eh_LoadInvalidCommandToAHandSetCF
     70    je      SHORT .DisableBlockMode
    7171.NoNeedToLimitBlockSize:
    7272%endif ; MODULE_8BIT_IDE_ADVANCED
     
    7474    push    bx
    7575
    76     push    ax
     76    push    ax          ; Store block size for later use
    7777    xchg    dx, ax      ; DL = Block size (Sector Count Register)
    7878    mov     al, COMMAND_SET_MULTIPLE_MODE
    7979    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRDY, FLG_STATUS_DRDY)
    8080    call    Idepack_StoreNonExtParametersAndIssueCommandFromAL
    81     pop     bx
    82     jnc     SHORT .StoreBlockSize
    8381
    84     ; Drive disabled block mode since we tried unsupported block size.
    85     ; We must adjust DPT accordingly.
    86     mov     bl, 1       ; Block size 1 will always work (=Block mode disabled)
    87 .StoreBlockSize:        ; Store new block size to DPT and return
     82    ; Disable block mode if failure or if called with block size of 1 sector.
     83    ; Some drives allow block mode commands for 1 sector blocks and some do not.
     84    pop     bx          ; Pop block size to BL
     85    jc      SHORT .DisableBlockMode
     86    mov     bh, bl      ; BL and BH both have block size we tried to set
     87    dec     bh
     88    jz      SHORT .DisableBlockMode
     89
     90    ; Enable block mode and store block size
     91    or      BYTE [di+DPT.bFlagsHigh], FLGH_DPT_USE_BLOCK_MODE_COMMANDS
     92    jmp     SHORT .StoreBlockSizeFromBLandReturn
     93
     94.DisableBlockMode:
     95    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_USE_BLOCK_MODE_COMMANDS
     96    mov     bl, 1
     97    stc
     98.StoreBlockSizeFromBLandReturn:
    8899    mov     [di+DPT_ATA.bBlockSize], bl
    89 
    90100    pop     bx
    91101    ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r545 r550  
    163163    ; Initialize block mode transfers
    164164    pop     ax  ; Restore .wFlags saved in SetWriteCache
    165     test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
    166     jz      SHORT .BlockModeNotSupportedOrDisabled
    167     test    al, FLG_DRVPARAMS_BLOCKMODE
    168     jz      SHORT .BlockModeNotSupportedOrDisabled
     165    test    al, FLG_DRVPARAMS_BLOCKMODE ; Tested here so block mode can be enabled with AH=24h
     166    jz      SHORT .BlockModeDisabled
    169167
    170168    ; Try block sizes until we find largest possible supported by drive
     
    177175    jnc     SHORT .TryNextBlockSize
    178176    STORE_ERROR_FLAG_TO_DPT     FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE
    179 .BlockModeNotSupportedOrDisabled:
     177.BlockModeDisabled:
    180178.SupportedBlockSizeFound:
    181179
     
    286284%endif ; MODULE_8BIT_IDE_ADVANCED
    287285
     286
    288287%ifdef MODULE_8BIT_IDE
    289288;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm

    r541 r550  
    4444    mov     WORD [bp+IDEPACK.intpack+INTPACK.bx], 0AA55h
    4545
    46 %ifdef CREATE_COMPATIBLE_DPT
     46%ifdef MODULE_COMPATIBLE_TABLES
    4747    call    AH41h_GetSupportBitsToCX
    4848    mov     [bp+IDEPACK.intpack+INTPACK.cx], cx
    4949%else
    5050    mov     WORD [bp+IDEPACK.intpack+INTPACK.cx], ENHANCED_DRIVE_ACCESS_SUPPORT
    51 %endif
     51%endif ; MODULE_COMPATIBLE_TABLES
    5252
    5353    and     BYTE [bp+IDEPACK.intpack+INTPACK.flags], ~FLG_FLAGS_CF  ; Return with CF cleared
     
    5757
    5858
    59 %ifdef CREATE_COMPATIBLE_DPT
     59%ifdef MODULE_COMPATIBLE_TABLES
    6060;--------------------------------------------------------------------
    6161; AH41h_GetSupportBitsToCX
     
    8787    ret
    8888
    89 %endif ; CREATE_COMPATIBLE_DPT
     89%endif ; MODULE_COMPATIBLE_TABLES
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm

    r545 r550  
    8181
    8282    ; Create DPTE (hardware information for device drivers)
    83 %ifdef CREATE_COMPATIBLE_DPT
     83%ifdef MODULE_COMPATIBLE_TABLES
    8484    call    AH41h_GetSupportBitsToCX
    8585    test    cl, ENHANCED_DISK_DRIVE_SUPPORT
     
    8787    call    CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI
    8888.DoNotCreateDPTE:
    89 %endif
     89%endif ; MODULE_COMPATIBLE_TABLES
    9090
    9191    ; Point DS:DI to Extended Drive Information Table to fill
     
    107107    ; Store DPTE for standard controllers only,
    108108    ; FFFF:FFFF for non standard controllers
    109 %ifdef CREATE_COMPATIBLE_DPT
     109%ifdef MODULE_COMPATIBLE_TABLES
    110110    mov     [di+EDRIVE_INFO.fpDPTE], bx
    111111    mov     [di+EDRIVE_INFO.fpDPTE+2], es
     
    117117    mov     [di+EDRIVE_INFO.fpDPTE], bx
    118118    mov     [di+EDRIVE_INFO.fpDPTE+2], bx
    119 %endif
     119%endif ; MODULE_COMPATIBLE_TABLES
    120120
    121121    ; Fill Extended Drive Information Table in DS:DI from DPT in ES:SI
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm

    r547 r550  
    8181    ; Block mode or single sector
    8282    mov     bl, [di+DPT.bFlagsHigh]
    83     and     bx, BYTE FLGH_DPT_BLOCK_MODE_SUPPORTED  ; Bit 1
     83    and     bx, BYTE FLGH_DPT_USE_BLOCK_MODE_COMMANDS   ; Bit 1
    8484    ret
    8585
Note: See TracChangeset for help on using the changeset viewer.