Changeset 428 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS


Ignore:
Timestamp:
May 29, 2012, 7:24:58 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Motor spin up is now waited when resetting drive.
  • Optimized boot sector loading a bit.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r421 r428  
    7979    test    bh, FLG_DRVNHEAD_DRV
    8080    jnz     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
    81     mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_MOTOR_STARTUP, FLG_STATUS_DRDY)
    82     call    IdeWait_PollStatusFlagInBLwithTimeoutInBH
     81    call    AHDh_WaitUnilDriveMotorHasReachedFullSpeed
    8382.SkipLongWaitSinceDriveIsNotPrimaryMaster:
    8483
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm

    r398 r428  
    106106    push    cx
    107107    push    ax
    108     call    AH9h_InitializeDriveForUse          ; Reset Master and Slave (Master will come first in DPT list)
     108    call    AHDh_WaitUnilDriveMotorHasReachedFullSpeed
     109    call    AH9h_InitializeDriveForUse          ; Initialize Master or Slave (Master will come first in DPT list)
    109110
    110111%ifdef MODULE_ADVANCED_ATA
     
    130131    ret
    131132
     133
     134;--------------------------------------------------------------------
     135; AHDh_WaitUnilDriveMotorHasReachedFullSpeed
     136;   Parameters:
     137;       DS:DI:  Ptr to DPT
     138;   Returns:
     139;       AH:     Int 13h return status
     140;       CF:     0 if successful, 1 if error
     141;   Corrupts registers:
     142;       AL, BX, CX, DX
     143;--------------------------------------------------------------------
     144AHDh_WaitUnilDriveMotorHasReachedFullSpeed:
     145%ifdef MODULE_SERIAL
     146    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
     147    jz      SHORT .WaitSinceRealHardDisk
     148    ret
     149.WaitSinceRealHardDisk:
     150%endif
     151
     152    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_MOTOR_STARTUP, FLG_STATUS_BSY)
     153    jmp     IdeWait_PollStatusFlagInBLwithTimeoutInBH
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm

    r392 r428  
    7373
    7474.ReadRetryLoop:
    75     call    .ResetBootDriveFromDL
    7675    call    .LoadFirstSectorFromDLtoESBX
    7776    jnc     SHORT .Return
    78     dec     di                              ; Decrement retry counter
    79     jnz     SHORT .ReadRetryLoop            ; Loop while retries left
    80 .Return:
    81     ret
     77    dec     di                              ; Decrement retry counter (preserve CF)
     78    jz      SHORT .Return                   ; Loop while retries left
    8279
    83 ;--------------------------------------------------------------------
    84 ; .ResetBootDriveFromDL
    85 ;   Parameters:
    86 ;       DL:     Drive to boot from (translated, 00h or 80h)
    87 ;   Returns:
    88 ;       AH:     INT 13h error code
    89 ;       CF:     Cleared if read successful
    90 ;               Set if any error
    91 ;   Corrupts registers:
    92 ;       AL
    93 ;--------------------------------------------------------------------
    94 .ResetBootDriveFromDL:
     80    ; Reset drive and retry
    9581    xor     ax, ax                          ; AH=0h, Disk Controller Reset
    9682    test    dl, dl                          ; Floppy drive?
    97     jns     SHORT .SkipAltReset
    98     mov     ah, 0Dh                         ; AH=Dh, Reset Hard Disk (Alternate reset)
    99 .SkipAltReset:
     83    eCMOVS  ah, RESET_HARD_DISK             ; AH=Dh, Reset Hard Disk (Alternate reset)
    10084    int     BIOS_DISK_INTERRUPT_13h
    101     ret
     85    jmp     SHORT .ReadRetryLoop
     86
    10287
    10388;--------------------------------------------------------------------
     
    119104    xor     dh, dh                          ; Head 0
    120105    int     BIOS_DISK_INTERRUPT_13h
     106.Return:
    121107    ret
Note: See TracChangeset for help on using the changeset viewer.