Changeset 507 in xtideuniversalbios


Ignore:
Timestamp:
Mar 1, 2013, 5:12:33 PM (8 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Reduced minimum time to display hotkeys. Now it is 2 seconds.
  • Brought back IDE controller reset.
  • Space savings by merging AH=Dh to AH=0h. AH=Dh is now redirected to AH=9h.
Location:
trunk/XTIDE_Universal_BIOS
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/HotkeyBar.inc

    r506 r507  
    2121%define HOTKEYBAR_INC
    2222
    23 MIN_TIME_TO_DISPLAY_HOTKEY_BAR          EQU (3000/55)   ; 3000 ms
     23MIN_TIME_TO_DISPLAY_HOTKEY_BAR          EQU (2000/55)   ; 2000 ms
    2424
    2525ROM_BOOT_HOTKEY_SCANCODE                EQU 42h ; F8
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r503 r507  
    6262    %endif
    6363%endif
     64
     65NUMBER_OF_IDEVARS                   EQU ((ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) / IDEVARS_size)
    6466
    6567; Bit defines for ROMVARS.wFlags
  • trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm

    r501 r507  
    5555%else                   ; IDE
    5656    Device_FinalizeDPT      EQU     IdeDPT_Finalize
     57%endif
     58
     59
     60;--------------------------------------------------------------------
     61; Device_ResetMasterAndSlaveController
     62;   Parameters:
     63;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     64;   Returns:
     65;       AH:     INT 13h Error Code
     66;       CF:     Cleared if success, Set if error
     67;   Corrupts registers:
     68;       AL, BX, CX, DX
     69;--------------------------------------------------------------------
     70%ifdef MODULE_SERIAL    ; IDE + Serial
     71Device_ResetMasterAndSlaveController:
     72    TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE    ReturnSuccessForSerialPort
     73    jmp     IdeCommand_ResetMasterAndSlaveController
     74
     75%else                   ; IDE
     76    Device_ResetMasterAndSlaveController    EQU     IdeCommand_ResetMasterAndSlaveController
    5777%endif
    5878
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r501 r507  
    2020; Section containing code
    2121SECTION .text
     22
     23;--------------------------------------------------------------------
     24; IdeCommand_ResetMasterAndSlaveController
     25;   Parameters:
     26;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     27;   Returns:
     28;       AH:     INT 13h Error Code
     29;       CF:     Cleared if success, Set if error
     30;   Corrupts registers:
     31;       AL, BX, CX, DX
     32;--------------------------------------------------------------------
     33IdeCommand_ResetMasterAndSlaveController:
     34    ; HSR0: Set_SRST
     35    call    AccessDPT_GetDeviceControlByteToAL
     36    or      al, FLG_DEVCONTROL_SRST | FLG_DEVCONTROL_nIEN   ; Set Reset bit
     37    OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER     DEVICE_CONTROL_REGISTER_out
     38    mov     ax, HSR0_RESET_WAIT_US
     39    call    Timer_DelayMicrosecondsFromAX
     40
     41    ; HSR1: Clear_wait
     42    call    AccessDPT_GetDeviceControlByteToAL
     43    or      al, FLG_DEVCONTROL_nIEN
     44    and     al, ~FLG_DEVCONTROL_SRST                        ; Clear reset bit
     45    OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER     DEVICE_CONTROL_REGISTER_out
     46    mov     ax, HSR1_RESET_WAIT_US
     47    call    Timer_DelayMicrosecondsFromAX
     48
     49    ; HSR2: Check_status
     50    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_MAXIMUM, FLG_STATUS_BSY)
     51    jmp     IdeWait_PollStatusFlagInBLwithTimeoutInBH
     52
    2253
    2354;--------------------------------------------------------------------
     
    4980    test    bh, FLG_DRVNHEAD_DRV        ; Wait already done for Master
    5081    jnz     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
    51     call    AHDh_WaitUntilDriveMotorHasReachedFullSpeed
     82    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_MOTOR_STARTUP, FLG_STATUS_DRDY)
     83    call    IdeWait_PollStatusFlagInBLwithTimeoutInBH
    5284.SkipLongWaitSinceDriveIsNotPrimaryMaster:
    5385
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm

    r493 r507  
    378378    dw  UnsupportedFunction                         ; 0Bh, Write Disk Sectors with ECC (XT, AT, EISA)
    379379    dw  AHCh_HandlerForSeek                         ; 0Ch, Seek (All)
    380     dw  AHDh_HandlerForResetHardDisk                ; 0Dh, Alternate Disk Reset (All)
     380    dw  AH9h_HandlerForInitializeDriveParameters    ; 0Dh, Alternate Disk Reset (All)
    381381    dw  UnsupportedFunction                         ; 0Eh, Read Sector Buffer (XT, PS/1), ESDI Undocumented Diagnostic (PS/2)
    382382    dw  UnsupportedFunction                         ; 0Fh, Write Sector Buffer (XT, PS/1), ESDI Undocumented Diagnostic (PS/2)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r505 r507  
    119119    jz      SHORT .ErrorCodeNotUsed
    120120    mov     bl, [di+DPT.bIdevarsOffset]                 ; replace drive number with Idevars pointer for cmp with dl
     121.ErrorCodeNotUsed:
    121122
    122 .ErrorCodeNotUsed:                                      ; BH will be garbage on exit if this entry point is used,
     123    mov     si, ControllerResetForDPTinDSDI
     124    call    .CallSIforEveryDrive                        ; Reset all drives to power on settings
     125    mov     si, AH9h_InitializeDriveForUse
     126    ; Fall to .CallSIforEveryDrive                      ; Initialize all drives
     127
     128.CallSIforEveryDrive:                                   ; BH will be garbage on exit if this entry point is used,
    123129                                                        ; but reset of all drives will still happen
    124130
     
    130136    ; will point to them.  Performance isn't an issue, as this is a reset operation.
    131137    ;
    132     mov     cx, (ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) / IDEVARS_size
     138    mov     cx, NUMBER_OF_IDEVARS
    133139
    134140.loop:
     141    push    si
    135142    call    FindDPT_ForIdevarsOffsetInDL                ; look for the first drive on this controller, if any
     143    pop     si
    136144    jc      SHORT .notFound
    137145
    138     call    AHDh_ResetDrive                             ; reset master and slave on that controller
     146    push    bx
     147    push    cx
     148    push    dx
     149    call    si                                          ; Reset Master AND Slave or initialize Master OR Slave drive
     150    pop     dx
     151    pop     cx
     152    pop     bx
    139153    call    BackupErrorCodeFromTheRequestedDriveToBH    ; save error code if same controller as drive from entry
    140154
     
    142156    add     dl, IDEVARS_size                            ; move Idevars pointer forward
    143157    loop    .loop
     158    ret
    144159
    145 .done:
    146     ret
     160
     161;--------------------------------------------------------------------
     162; ControllerResetForDPTinDSDI
     163;   Parameters:
     164;       DS:DI:  Ptr to DPT for drive to reset (resets both Master and Slave drive)
     165;       SS:BP:  Ptr to IDEPACK
     166;   Returns:
     167;       AH:     Int 13h return status
     168;       CF:     0 if successful, 1 if error
     169;   Corrupts registers:
     170;       AL, BX, CX, DX
     171;--------------------------------------------------------------------
     172ControllerResetForDPTinDSDI:
     173%ifdef MODULE_IRQ
     174    call    Interrupts_UnmaskInterruptControllerForDriveInDSDI
     175%endif
     176%ifdef MODULE_ADVANCED_ATA
     177    call    Device_ResetMasterAndSlaveController
     178    jmp     AdvAtaInit_InitializeControllerForDPTinDSDI
     179%else
     180    jmp     Device_ResetMasterAndSlaveController
     181%endif
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm

    r399 r507  
    6969;       DS:DI:  Ptr to DPT for Single or Slave Drive
    7070;   Returns:
     71;       AH:     Int 13h return status
    7172;       CF:     Cleared if success or no controller to initialize
    7273;               Set if error
    7374;   Corrupts registers:
    74 ;       AX, BX, CX, DX
     75;       AL, BX, CX, DX
    7576;--------------------------------------------------------------------
    7677AdvAtaInit_InitializeControllerForDPTinDSDI:
     
    9192
    9293.NoAdvancedController:
     94    xor     ax, ax                      ; Success
    9395    ret
    9496
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r443 r507  
    8080    call    DetectDrives_FromAllIDEControllers
    8181    call    Interrupts_InitializeInterruptVectors
    82     ; Fall to .StoreDptPointersToIntVectors
    83 
    84 ;--------------------------------------------------------------------
    85 ; .StoreDptPointersToIntVectors
    86 ;   Parameters:
    87 ;       DS:     RAMVARS segment
    88 ;       ES:     BDA and interrupt vector segment (zero)
    89 ;   Returns:
    90 ;       Nothing
    91 ;   Corrupts registers:
    92 ;       DX, DI
    93 ;--------------------------------------------------------------------
    94 .StoreDptPointersToIntVectors:
    95     mov     dl, 80h
    96     call    FindDPT_ForDriveNumberInDL   ; DPT to DS:DI
    97     jc      SHORT .FindForDrive81h  ; Store nothing if not our drive
    98     mov     [es:HD0_DPT_POINTER_41h*4], di
    99     mov     [es:HD0_DPT_POINTER_41h*4+2], ds
    100 .FindForDrive81h:
    101     inc     dx
    102     call    FindDPT_ForDriveNumberInDL
    103     jc      SHORT .ResetDetectedDrives
    104     mov     [es:HD1_DPT_POINTER_46h*4], di
    105     mov     [es:HD1_DPT_POINTER_46h*4+2], ds
    10682    ; Fall to .ResetDetectedDrives
    10783
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r506 r507  
    266266    %include "AH9h_HInit.asm"       ; Required by Int13h_Jump.asm
    267267    %include "AHCh_HSeek.asm"       ; Required by Int13h_Jump.asm
    268     %include "AHDh_HReset.asm"      ; Required by Int13h_Jump.asm
    269268    %include "AH10h_HReady.asm"     ; Required by Int13h_Jump.asm
    270269    %include "AH11h_HRecal.asm"     ; Required by Int13h_Jump.asm
  • trunk/XTIDE_Universal_BIOS/makefile

    r506 r507  
    99# checksum* Builds all and then generates checksum byte to all binary files                        #
    1010# strings*  Compress src\Strings.asm to src\StringsCompressed.asm                                  #
     11# unused*   Checks if there are any unused functions that can be removed to save space             #
    1112#                                                                                                  #
    1213# * at the end of target name means that Perl is required for the job.                             #
Note: See TracChangeset for help on using the changeset viewer.