Ignore:
Timestamp:
Apr 27, 2013, 5:30:50 PM (11 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.
File:
1 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
Note: See TracChangeset for help on using the changeset viewer.