Changeset 530 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization


Ignore:
Timestamp:
Mar 28, 2013, 1:36:23 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • AT builds again copy old INT 13h handler to 40h. It turned out it is needed, by XTIDE Universal BIOS at least (fixes disappearing floppy drive hotkey button when booting starts).
  • AH=48h no longer returns P-CHS parameteres for drives with more than 15,482,880 sectors (now works like described on Phoenix specification).
Location:
trunk/XTIDE_Universal_BIOS/Src/Initialization
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm

    r526 r530  
    2222SECTION .text
    2323
    24 %ifdef COPY_13H_HANDLER_TO_40H
    2524;--------------------------------------------------------------------
    2625; Checks is floppy drive handler installed to interrupt vector 40h.
     
    3635;--------------------------------------------------------------------
    3736FloppyDrive_IsInt40hInstalled:
    38     cmp     WORD [es:BIOS_DISKETTE_INTERRUPT_40h*4+2], 0C000h   ; Any ROM segment?
    39 %ifdef USE_AT   ; No need to verify on XT systems.
    40     jb      SHORT .Int40hHandlerIsNotInstalled
    41     call    .VerifyInt40hHandlerSinceSomeBiosesSimplyReturnFromInt40h
    42 .Int40hHandlerIsNotInstalled:
    43 %endif
    44     cmc
    45     ret
    46 
    47 ;--------------------------------------------------------------------
    48 ; .VerifyInt40hHandlerSinceSomeBiosesSimplyReturnFromInt40h
    49 ;   Parameters:
    50 ;       Nothing
    51 ;   Returns:
    52 ;       CF:     Cleared if INT 40h is installed
    53 ;               Set if INT 40h is not installed
    54 ;   Corrupts registers:
    55 ;       BX, CX, DI
    56 ;--------------------------------------------------------------------
    5737%ifdef USE_AT
    58 .VerifyInt40hHandlerSinceSomeBiosesSimplyReturnFromInt40h:
    5938    push    es
    6039    push    dx
    6140    push    ax
    6241
    63     call    .LoadInt40hVerifyParameters
     42    call    LoadInt40hVerifyParameters
    6443    int     BIOS_DISK_INTERRUPT_13h
    6544    jc      SHORT .Int40hIsInstalled    ; Maybe there are not any floppy drives at all
    66     push    es
    67     push    di
     45    push    es                          ; Drive Parameter Table segment
     46    push    di                          ; Drive Parameter Table offset
    6847
    69     call    .LoadInt40hVerifyParameters
     48    call    LoadInt40hVerifyParameters
    7049    int     BIOS_DISKETTE_INTERRUPT_40h
    7150
     
    8362    pop     dx
    8463    pop     es
     64
     65%else ; if XT build
     66    cmp     WORD [es:BIOS_DISKETTE_INTERRUPT_40h*4+2], 0C000h   ; Any ROM segment? (set CF if not)
     67%endif ; USE_AT
     68    cmc
    8569    ret
    8670
    8771;--------------------------------------------------------------------
    88 ; .LoadInt40hVerifyParameters
     72; LoadInt40hVerifyParameters
    8973;   Parameters:
    9074;       Nothing
     
    9680;       DH
    9781;--------------------------------------------------------------------
    98 .LoadInt40hVerifyParameters:
    99     mov     ah, 08h             ; Get Drive Parameters
    100     cwd                         ; Floppy drive 0
     82%ifdef USE_AT
     83LoadInt40hVerifyParameters:
     84    mov     ah, GET_DRIVE_PARAMETERS
     85    cwd                     ; Floppy drive 0
    10186    mov     di, dx
    102     mov     es, dx              ; ES:DI = 0000:0000h to guard against BIOS bugs
     87    mov     es, dx          ; ES:DI = 0000:0000h to guard against BIOS bugs
    10388    ret
    10489%endif
    105 
    106 %endif ; COPY_13H_HANDLER_TO_40H
    10790
    10891
     
    130113%ifdef MODULE_BOOT_MENU
    131114FloppyDrive_GetType:
    132     mov     ah, 08h         ; Get Drive Parameters
     115    mov     ah, GET_DRIVE_PARAMETERS
    133116    xor     bx, bx          ; FLOPPY_TYPE_525_OR_35_DD when function not supported
    134117    int     BIOS_DISKETTE_INTERRUPT_40h
     
    151134    js      .UseBIOSorBDA               ; We didn't add in any drives, counts here are not valid
    152135
    153     adc     al,1                        ; adds in the drive count bit, and adds 1 for count vs. 0-index,
     136    adc     al ,1                       ; adds in the drive count bit, and adds 1 for count vs. 0-index,
    154137    jmp     .FinishCalc                 ; need to clear AH on the way out, and add in minimum drive numbers
    155138
     
    165148    ret
    166149
    167 FloppyDrive_GetCountFromBIOS_or_BDA:
    168     push    es
    169150
    170151;--------------------------------------------------------------------
    171 ; Reads Floppy Drive Count from BIOS.
    172 ; Does not work on most XT systems. Call .GetCountFromBDA
    173 ; if this function fails.
    174 ;
    175 ; .GetCountFromBIOS
     152; FloppyDrive_GetCountFromBIOS_or_BDA
    176153;   Parameters:
    177154;       Nothing
     
    181158;               Set if BIOS function not supported
    182159;   Corrupts registers:
    183 ;       ES
     160;       AH, ES
    184161;--------------------------------------------------------------------
     162FloppyDrive_GetCountFromBIOS_or_BDA:
     163    push    es
     164
     165; Reads Floppy Drive Count from BIOS.
     166; Does not work on most XT systems. Call .GetCountFromBDA
     167; if this function fails.
    185168%ifdef USE_AT
    186 .GetCountFromBIOS:
    187169    push    di
    188170    push    bx
     
    190172    push    dx
    191173
    192     mov     ah, 08h                 ; Get Drive Parameters
     174    mov     ah, GET_DRIVE_PARAMETERS
    193175    cwd                             ; Floppy Drive 00h
    194176    int     BIOS_DISKETTE_INTERRUPT_40h
     
    199181    pop     bx
    200182    pop     di
    201 %endif
    202183
    203 ;--------------------------------------------------------------------
    204184; Reads Floppy Drive Count (0...4) from BIOS Data Area.
    205185; This function should be used only if .GetCountFromBIOS fails.
    206 ;
    207 ; .GetCountFromBDA
    208 ;   Parameters:
    209 ;       Nothing
    210 ;   Returns:
    211 ;       AL:     Number of Floppy Drives
    212 ;   Corrupts registers:
    213 ;       AH, ES
    214 ;--------------------------------------------------------------------
    215 %ifndef USE_AT
    216 .GetCountFromBDA:
     186%else ; ifndef USE_AT
    217187    LOAD_BDA_SEGMENT_TO es, ax
    218     mov     al, [es:BDA.wEquipment]         ; Load Equipment WORD low byte
    219     mov     ah, al                          ; Copy it to AH
    220     and     ax, 0C001h                      ; Leave bits 15..14 and 0
    221     eROL_IM ah, 2                           ; EW low byte bits 7..6 to 1..0
    222     add     al, ah                          ; AL = Floppy Drive count
     188    mov     al, [es:BDA.wEquipment] ; Load Equipment WORD low byte
     189    mov     ah, al                  ; Copy it to AH
     190    and     ax, 0C001h              ; Leave bits 15..14 and 0
     191    eROL_IM ah, 2                   ; EW low byte bits 7..6 to 1..0
     192    add     al, ah                  ; AL = Floppy Drive count
    223193%endif
    224194
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm

    r526 r530  
    6464    mov     [RAMVARS.fpOldI13h], ax             ; Store old INT 13h offset
    6565
    66 %ifdef COPY_13H_HANDLER_TO_40H
    6766    ; Only store INT 13h handler to 40h if 40h is not already installed.
    6867    ; At least AMI BIOS for 286 stores 40h handler by itself and calls
    69     ; 40h from 13h. That system locks to infinite loop if we copy 13h to 40h.
     68    ; 40h from 13h. That system locks to infinite loop if we blindly copy 13h to 40h.
    7069    call    FloppyDrive_IsInt40hInstalled
    7170    jc      SHORT .Int40hAlreadyInstalled
     
    7372    mov     [es:BIOS_DISKETTE_INTERRUPT_40h*4+2], dx    ; Store old INT 13h segment
    7473.Int40hAlreadyInstalled:
    75 %endif ; COPY_13H_HANDLER_TO_40H
    7674
    7775    mov     al, BIOS_DISK_INTERRUPT_13h         ; INT 13h interrupt vector offset
Note: See TracChangeset for help on using the changeset viewer.