Changeset 540 in xtideuniversalbios


Ignore:
Timestamp:
Apr 13, 2013, 3:40:27 PM (8 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Improved interrupt handling: INT 15h AH=91h is no longer called if AH=90h was not called.
Location:
trunk/XTIDE_Universal_BIOS
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/Controllers/Vision.inc

    r526 r540  
    2727; Possible base addresses for QD6500 and QD6580
    2828QD65XX_BASE_PORT                    EQU     30h
    29 QD65XX_ALTERNATIVE_BASE_PORT        EQU     0B0h
    30 
     29QD65XX_ALTERNATIVE_BASE_PORT        EQU     0B0h    ; This is the default setting but Intel PIIX4 South Bridge
     30                                                    ; (and likely other PCI chisets as well) mirror PIC registers here
    3131
    3232; Vision Register offsets from QD chip base port
  • trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc

    r536 r540  
    6666%ifdef MODULE_SERIAL
    6767    FLGH_DPT_SERIAL_DEVICE              EQU (1<<2)  ; Bit 2, Serial Port Device
    68 %endif
    69 %ifdef MODULE_IRQ
    70     FLGH_DPT_INTERRUPT_IN_SERVICE       EQU (1<<3)  ; Bit 3, Set when waiting for IRQ
    7168%endif
    7269%ifdef MODULE_FEATURE_SETS
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r536 r540  
    140140
    141141    ; Clear Task Flag and set Interrupt In-Service Flag
    142     or      BYTE [di+DPT.bFlagsHigh], FLGH_DPT_INTERRUPT_IN_SERVICE
    143142    push    ds
    144     LOAD_BDA_SEGMENT_TO ds, dx, !   ; Also zero DX
    145     mov     [BDA.bHDTaskFlg], dl
     143    LOAD_BDA_SEGMENT_TO ds, dx
     144    mov     BYTE [BDA.bHDTaskFlg], 1    ; Will be adjusted to zero later
    146145    pop     ds
    147146.DoNotSetInterruptInServiceFlag:
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIrq.asm

    r535 r540  
    3333IdeIrq_WaitForIRQ:
    3434    push    ds
    35 
    3635    LOAD_BDA_SEGMENT_TO ds, ax, !       ; Zero AX
    3736    mov     ah, OS_HOOK_DEVICE_BUSY     ; Hard disk busy (AX=9000h)
    3837    cli                                 ; Disable interrupts
    39     cmp     al, [BDA.bHDTaskFlg]        ; Task flag already set?
    40     jc      SHORT .ReturnFromWaitNotify ;  If so, skip OS notification
     38    dec     BYTE [BDA.bHDTaskFlg]       ; Clear to zero if still waiting for IRQ
     39    pop     ds
     40    jnz     SHORT .ReturnFromWaitNotify ; IRQ already! (CompactFlash was faster than CPU)   
    4141    int     BIOS_SYSTEM_INTERRUPT_15h   ; OS hook, device busy
    4242
    4343.ReturnFromWaitNotify:
    4444    sti                                 ; Enable interrupts
    45     pop     ds
    4645    ret
    4746
     
    6160ALIGN JUMP_ALIGN
    6261IdeIrq_InterruptServiceRoutineForIrqs2to7:
    63     push    di
    6462    push    ax
    65     call    AcknowledgeIdeInterruptAndSetTaskFlag
     63    mov     al, COMMAND_END_OF_INTERRUPT
    6664
    67     mov     al, COMMAND_END_OF_INTERRUPT
     65%ifdef USE_AT
    6866    jmp     SHORT AcknowledgeMasterInterruptController
    69 
    7067
    7168ALIGN JUMP_ALIGN
    7269IdeIrq_InterruptServiceRoutineForIrqs8to15:
    73     push    di
    7470    push    ax
    75     call    AcknowledgeIdeInterruptAndSetTaskFlag
    76 
    7771    mov     al, COMMAND_END_OF_INTERRUPT
    7872    out     SLAVE_8259_COMMAND_out, al  ; Acknowledge Slave 8259
     73    JMP_DELAY
    7974AcknowledgeMasterInterruptController:
     75%endif ; USE_AT
     76
    8077    out     MASTER_8259_COMMAND_out, al ; Acknowledge Master 8259
    8178
     79    ; Set Task Flag
     80    push    ds
     81    LOAD_BDA_SEGMENT_TO ds, ax, !       ; Clear AL and CF for INT 15h
     82    dec     BYTE [BDA.bHDTaskFlg]       ; Set task flag (or clear if IRQ occurred before call to INT 15h AH=90h)
     83    sti                                 ; Enable interrupts
     84    pop     ds
     85
    8286    ; Issue Int 15h, function AX=9100h (Interrupt ready)
    83     clc                                 ; Must be called with CF clear
    84     mov     ax, OS_HOOK_DEVICE_POST<<8  ; Interrupt ready, device 0 (HD)
     87    jz      SHORT .DoNotPostSinceIrqOccurredBeforeWait
     88    mov     ah, OS_HOOK_DEVICE_POST     ; Interrupt ready, device 0 (HD)
    8589    int     BIOS_SYSTEM_INTERRUPT_15h
     90.DoNotPostSinceIrqOccurredBeforeWait:
    8691
    8792    pop     ax
    88     pop     di
    8993    iret
    90 
    91 
    92 ;--------------------------------------------------------------------
    93 ; AcknowledgeIdeInterruptAndSetTaskFlag
    94 ;   Parameters:
    95 ;       Nothing
    96 ;   Returns:
    97 ;       Nothing
    98 ;   Corrupts registers:
    99 ;       AX
    100 ;--------------------------------------------------------------------
    101 ALIGN JUMP_ALIGN
    102 AcknowledgeIdeInterruptAndSetTaskFlag:
    103     push    ds
    104     push    si
    105     push    dx
    106     push    bx
    107 
    108     ; Reading Status Register acknowledges IDE interrupt
    109     call    RamVars_GetSegmentToDS
    110     mov     bl, FLGH_DPT_INTERRUPT_IN_SERVICE
    111     call    FindDPT_ToDSDIforFlagsHighInBL
    112     INPUT_TO_AL_FROM_IDE_REGISTER STATUS_REGISTER_in
    113 
    114     ; Clear Interrupt In-Service Flag from DPT
    115     and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_INTERRUPT_IN_SERVICE
    116 
    117     ; Set Task Flag
    118     LOAD_BDA_SEGMENT_TO ds, ax
    119     mov     BYTE [BDA.bHDTaskFlg], 0FFh     ; Set task flag
    120 
    121     pop     bx
    122     pop     dx
    123     pop     si
    124     pop     ds
    125     ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm

    r533 r540  
    392392    dw  UnsupportedFunction                         ; 12h, Controller RAM Diagnostic (XT)
    393393    dw  UnsupportedFunction                         ; 13h, Drive Diagnostic (XT)
    394     dw  UnsupportedFunction                         ; 14h, Controller Internal Diagnostic (All)
     394    dw  AH10h_HandlerForCheckDriveReady             ; 14h, Controller Internal Diagnostic (All)
    395395    dw  AH15h_HandlerForReadDiskDriveSize           ; 15h, Read Disk Drive Size (AT+)
    396396    dw  UnsupportedFunction                         ; 16h,
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm

    r530 r540  
    119119    test    al, al
    120120    jz      SHORT .Return   ; IRQ not used
     121%ifdef USE_AT
    121122    cmp     al, 8
    122123    jb      SHORT .InstallLowIrqHandler
     
    137138    mov     si, IdeIrq_InterruptServiceRoutineForIrqs8to15
    138139    jmp     SHORT Interrupts_InstallHandlerToVectorInALFromCSSI
     140%endif ; USE_AT
    139141
    140142;--------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.