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


Ignore:
Timestamp:
Feb 28, 2012, 2:21:03 PM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Changed version number to 2.0.0
  • Block will no longer be enabled if it is forced off using configurator.
  • Implemented non-working feature to disable drive internal write cache.
File:
1 edited

Legend:

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

    r258 r276  
    4141;--------------------------------------------------------------------
    4242AH9h_InitializeDriveForUse:
     43    push    si
    4344    push    cx
    4445
     
    6364    ; Initialize CHS parameters if LBA is not used
    6465    call    InitializeDeviceParameters
    65     jc      SHORT .RecalibrateDrive
     66    jc      SHORT .SetWriteCache
    6667    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nINITPRMS
     68
     69    ; Enable or Disable Write Cache
     70.SetWriteCache:
     71    ;call   SetWriteCache
    6772
    6873    ; Recalibrate drive by seeking to cylinder 0
     
    8085.ReturnNotSuccessfull:
    8186    pop     cx
     87    pop     si
    8288    ret
    8389
     
    110116
    111117;--------------------------------------------------------------------
     118; SetWriteCache
     119;   Parameters:
     120;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     121;   Returns:
     122;       AH:     BIOS Error code
     123;       CF:     Cleared if succesfull
     124;               Set if any error
     125;   Corrupts registers:
     126;       AL, BX, CX, DX, SI
     127;--------------------------------------------------------------------
     128SetWriteCache:
     129    call    AccessDPT_GetPointerToDRVPARAMStoCSBX
     130    mov     bl, [cs:bx+DRVPARAMS.wFlags]
     131    and     bx, BYTE MASK_DRVPARAMS_WRITECACHE
     132    jz      SHORT ReturnSuccessSinceInitializationNotNeeded     ; DEFAULT_WRITE_CACHE
     133    mov     si, [cs:bx+.rgbWriteCacheCommands]
     134    jmp     AH23h_SetControllerFeatures
     135
     136.rgbWriteCacheCommands:
     137    db      0                               ; DEFAULT_WRITE_CACHE
     138    db      FEATURE_DISABLE_WRITE_CACHE     ; DISABLE_WRITE_CACHE
     139    db      FEATURE_ENABLE_WRITE_CACHE      ; ENABLE_WRITE_CACHE
     140
     141
     142;--------------------------------------------------------------------
    112143; InitializeBlockMode
    113144;   Parameters:
     
    124155    jz      SHORT ReturnSuccessSinceInitializationNotNeeded
    125156
    126     mov     al, [di+DPT_ATA.bMaxBlock]  ; Load max block size, zero AH
     157    call    AccessDPT_GetPointerToDRVPARAMStoCSBX
     158    mov     al, 1                       ; Disable block mode
     159    test    BYTE [cs:bx+DRVPARAMS.wFlags], FLG_DRVPARAMS_BLOCKMODE
     160    eCMOVNZ al, [di+DPT_ATA.bMaxBlock]  ; Load max block size
    127161    jmp     AH24h_SetBlockSize
    128162ReturnSuccessSinceInitializationNotNeeded:
     163    xor     ah, ah
    129164    ret
Note: See TracChangeset for help on using the changeset viewer.