Changeset 547 in xtideuniversalbios for trunk


Ignore:
Timestamp:
Apr 21, 2013, 3:47:11 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Hotkeys were incorrectly initialized to use 'C' as first hard drive letter.
  • All CHS translate modes should again work (incorrectly decremented DX instead of DL, it might or might not have caused problems).
Location:
trunk/XTIDE_Universal_BIOS
Files:
13 edited

Legend:

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

    r545 r547  
    129129DEVICE_XTIDE_DEFAULT_PORTCTRL           EQU     (DEVICE_XTIDE_DEFAULT_PORT + XTIDE_CONTROL_BLOCK_OFFSET)
    130130; Note XT-CF control port is SHL 1 relative to XTIDE, and coded that way hence no need for specific definition like...
    131 ; DEVICE_XTCF_DEFAULT_PORTCTRL              EQU     (DEVICE_XTIDE_DEFAULT_PORT + XTCF_CONTROL_BLOCK_OFFSET)
     131; DEVICE_XTCF_DEFAULT_PORTCTRL          EQU     (DEVICE_XTIDE_DEFAULT_PORT + XTCF_CONTROL_BLOCK_OFFSET)
    132132
    133133DEVICE_ATA_PRIMARY_PORT                 EQU     1F0h
     
    192192FLG_DRVPARAMS_BLOCKMODE         EQU (1<<4)  ; Enable Block mode transfers
    193193FLG_DRVPARAMS_USERCHS           EQU (1<<5)  ; User specified P-CHS values
    194     MAX_USER_CYLINDERS              EQU 16383
    195     MAX_USER_HEADS                  EQU 16
    196     MAX_USER_SECTORS_PER_TRACK      EQU 63
    197     MAX_USER_CHS_COUNT              EQU (MAX_USER_CYLINDERS * MAX_USER_HEADS * MAX_USER_SECTORS_PER_TRACK)
     194    MAX_PCHS_CYLINDERS              EQU 16383
     195    MAX_PCHS_HEADS                  EQU 16
     196    MAX_PCHS_SECTORS_PER_TRACK      EQU 63
     197    MAX_PCHS_TOTAL_SECTOR_COUNT     EQU (MAX_PCHS_CYLINDERS * MAX_PCHS_HEADS * MAX_PCHS_SECTORS_PER_TRACK)  ; 16,514,064
    198198FLG_DRVPARAMS_USERLBA           EQU (1<<6)  ; User specified LBA value
    199     MIN_USER_LBA_COUNT              EQU (MAX_USER_CHS_COUNT+1)  ; Must be more than max CHS
    200     MAX_USER_LBA_COUNT              EQU ((2^28)-1)              ; LBA28 limit
    201199
    202200%endif ; ROMVARS_INC
  • trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialDPT.asm

    r526 r547  
    4848
    4949%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    50     %if FLGH_DPT_SERIAL_DEVICE != 0x4 || FLGH_DPT_SERIAL_FLOPPY != 0x10 || FLGH_DPT_SERIAL_FLOPPY_TYPE_MASK != 0xe0 || FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION != 5
    51         %error "The serial server passes FLGH values into SerialDPT_Finalize directly.  If the flag positions are changed, corresponding changes will need to be made in the serial server, and likely a version check put in to deal with servers talking to incompatible clients"
    52     %endif
     50    %ifdef MODULE_SERIAL_FLOPPY
     51        %if FLGH_DPT_SERIAL_DEVICE != 0x4 || FLGH_DPT_SERIAL_FLOPPY != 0x10 || FLGH_DPT_SERIAL_FLOPPY_TYPE_MASK != 0xe0 || FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION != 5
     52            %error "The serial server passes FLGH values into SerialDPT_Finalize directly.  If the flag positions are changed, corresponding changes will need to be made in the serial server, and likely a version check put in to deal with servers talking to incompatible clients"
     53        %endif
     54    %else
     55        %if FLGH_DPT_SERIAL_DEVICE != 0x4
     56            %error "The serial server passes FLGH values into SerialDPT_Finalize directly.  If the flag positions are changed, corresponding changes will need to be made in the serial server, and likely a version check put in to deal with servers talking to incompatible clients"
     57        %endif
     58    %endif ; MODULE_SERIAL_FLOPPY
    5359%endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm

    r526 r547  
    2323;--------------------------------------------------------------------
    2424; Int 13h function AH=15h, Read Disk Drive Size.
     25;
     26; It is unclear what is the total number of sectors to return.
     27; Award BIOS from 1997 returns full capacity instead of L-CHS limit
     28; like we do. I think it makes more sense if this function returns
     29; L-CHS limit.
    2530;
    2631; AH15h_HandlerForReadDiskDriveSize
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm

    r526 r547  
    4545
    4646    ; Make sure that sector count is valid
     47    mov     al, [es:si+DAP.wSectorCount]
     48    test    al, al
     49    jz      SHORT ZeroSectorsRequestedSoNoErrors
     50    js      SHORT InvalidNumberOfSectorsRequested
     51
     52%if 0   ; Slow version in the unlikely case that high byte needs to be checked.
    4753    mov     ax, [es:si+DAP.wSectorCount]
    4854    test    ax, ax
     
    5056    cmp     ax, BYTE 127
    5157    ja      SHORT InvalidNumberOfSectorsRequested
     58%endif
    5259
    5360    ; Get EBIOS command index to BX
     
    5562    call    Prepare_GetOldInt13hCommandIndexToBX
    5663    mov     al, [di+DPT.bFlagsLow]
    57     eSHL_IM al, 1                   ; Set CF if LBA48 supported
     64    shl     al, 1                   ; Set CF if LBA48 supported
    5865    adc     bl, bh                  ; LBA48 EXT commands
    5966    ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r529 r547  
    8686
    8787%ifdef MODULE_HOTKEYS
     88    ; Last hard drive might have scrolled Hotkey Bar out of screen.
     89    ; We want to display it during wait.
     90    call    HotkeyBar_UpdateDuringDriveDetection
     91
    8892.WaitUntilTimeToCloseHotkeyBar:
    8993    call    TimerTicks_ReadFromBdaToAX
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r526 r547  
    246246
    247247    ; Get boot drive letters
    248     call    FloppyDrive_GetCountToAX
    249     mov     ah, 'A'         ; AH = First Floppy Drive letter (always 'A')
    250     add     al, ah
    251     MAX_U   al, 'C'         ; AL = First Hard Drive letter ('C', 'D', or 'E')
     248    call    BootVars_GetLetterForFirstHardDriveToAX
    252249    test    dl, dl
    253     eCMOVNS al, ah
     250    eCMOVNS al, DEFAULT_FLOPPY_DRIVE_LETTER
    254251    push    ax
    255252
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm

    r531 r547  
    158158;               Set if BIOS function not supported
    159159;   Corrupts registers:
    160 ;       AH, ES
     160;       AH
    161161;--------------------------------------------------------------------
    162162FloppyDrive_GetCountFromBIOS_or_BDA:
  • trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm

    r528 r547  
    3232;--------------------------------------------------------------------
    3333DriveXlate_ConvertDriveLetterInDLtoDriveNumber:
    34     call    DriveXlate_GetLetterForFirstHardDriveToAX
     34    call    BootVars_GetLetterForFirstHardDriveToAX
    3535    cmp     dl, al
    3636    jb      SHORT .ConvertLetterInDLtoFloppyDriveNumber
     
    6868
    6969    ; Store default hard drive to boot from
    70     call    DriveXlate_GetLetterForFirstHardDriveToAX
     70    call    BootVars_GetLetterForFirstHardDriveToAX
    7171    add     dl, al
    7272    stc
     
    7575.GetDefaultFloppyDrive:
    7676    sub     dl, 80h - DEFAULT_FLOPPY_DRIVE_LETTER   ; Clears CF
    77     ret
    78 
    79 
    80 ;--------------------------------------------------------------------
    81 ; Returns letter for first hard disk. Usually it will be 'C' but it
    82 ; can be higher if more than two floppy drives are found.
    83 ;
    84 ; DriveXlate_GetLetterForFirstHardDriveToAX
    85 ;   Parameters:
    86 ;       DS:     RAMVARS segment
    87 ;   Returns:
    88 ;       AX:     Upper case letter for first hard disk
    89 ;   Corrupts registers:
    90 ;       Nothing
    91 ;--------------------------------------------------------------------
    92 DriveXlate_GetLetterForFirstHardDriveToAX:
    93     call    FloppyDrive_GetCountToAX
    94     add     al, DEFAULT_FLOPPY_DRIVE_LETTER
    95     MAX_U   al, DEFAULT_HARD_DRIVE_LETTER
    9677    ret
    9778
  • trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm

    r528 r547  
    9090;       AX, CX, DX, SI, DI
    9191;--------------------------------------------------------------------
    92     call    DriveXlate_GetLetterForFirstHardDriveToAX
     92    call    BootVars_GetLetterForFirstHardDriveToAX
    9393    mov     ah, ANGLE_QUOTE_RIGHT
    9494    mov     cl, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bHddLetter]
     
    397397    ; Determine if Floppy or Hard Drive hotkey
    398398    xchg    cx, ax
    399     call    DriveXlate_GetLetterForFirstHardDriveToAX
     399    call    BootVars_GetLetterForFirstHardDriveToAX
    400400    cmp     cl, al
    401401    jb      SHORT .StoreDriveLetter ; Store Floppy Drive letter
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm

    r542 r547  
    176176;       BL:     Number of L-CHS heads (?...240)
    177177;       CX:     Number of bits shifted (0...3)
    178 ;       DL:     ADDRESSING_MODE_NORMAL or ADDRESSING_MODE_LARGE
     178;       DX:     ADDRESSING_MODE_NORMAL or ADDRESSING_MODE_LARGE
    179179;   Corrupts registers:
    180180;       Nothing
     
    218218; ConvertPCHfromAXBLtoEnhancedCHinAXBL:
    219219;   Parameters:
    220 ;       AX:     Number of P-CHS cylinders (1...8192)
     220;       AX:     Number of P-CHS cylinders (1...8192, or up to 17475 if fell from above)
    221221;       BL:     Number of P-CHS heads (1...16)
    222222;   Returns:
    223223;       AX:     Number of L-CHS cylinders (?...1024)
    224 ;       BL:     Number of L-CHS heads (?...128)
     224;       BL:     Number of L-CHS heads (?...128, or up to 240 if fell from above)
    225225;       CX:     Number of bits shifted (0...3)
    226 ;       DL:     TRANSLATEMODE_NORMAL or TRANSLATEMODE_LARGE
     226;       DX:     TRANSLATEMODE_NORMAL or TRANSLATEMODE_LARGE
    227227;   Corrupts registers:
    228228;       Nothing
    229229;--------------------------------------------------------------------
    230230ConvertPCHfromAXBLtoEnhancedCHinAXBL:
     231    cwd                 ; Assume TRANSLATEMODE_NORMAL
    231232    xor     cx, cx      ; No bits to shift initially
    232     xor     dl, dl      ; Assume TRANSLATEMODE_NORMAL
    233233.ShiftIfMoreThan1024Cylinder:
    234234    cmp     ax, MAX_LCHS_CYLINDERS
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm

    r545 r547  
    5959;--------------------------------------------------------------------
    6060BootVars_StoreDefaultDriveLettersToHotkeyVars:
    61     mov     WORD [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wFddAndHddLetters], DEFAULT_FLOPPY_DRIVE_LETTER | (DEFAULT_HARD_DRIVE_LETTER<<8)
     61    call    BootVars_GetLetterForFirstHardDriveToAX
     62    mov     ah, DEFAULT_FLOPPY_DRIVE_LETTER
     63    xchg    al, ah
     64    mov     [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wFddAndHddLetters], ax
    6265    ret
    6366
    6467%endif ; MODULE_HOTKEYS
     68
     69
     70;--------------------------------------------------------------------
     71; Returns letter for first hard disk. Usually it will be 'C' but it
     72; can be higher if more than two floppy drives are found.
     73;
     74; BootVars_GetLetterForFirstHardDriveToAX
     75;   Parameters:
     76;       DS:     RAMVARS segment
     77;   Returns:
     78;       AX:     Upper case letter for first hard disk
     79;   Corrupts registers:
     80;       Nothing
     81;--------------------------------------------------------------------
     82BootVars_GetLetterForFirstHardDriveToAX:
     83    call    FloppyDrive_GetCountToAX
     84    add     al, DEFAULT_FLOPPY_DRIVE_LETTER     ; First Hard Drive letter comes after last floppy drive letter...
     85    MAX_U   al, DEFAULT_HARD_DRIVE_LETTER       ; ...but it can never be 'A' or 'B'
     86    ret
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r545 r547  
    109109    ; Store P-CHS and flags
    110110    call    AtaGeometry_GetPCHStoAXBLBHfromAtaInfoInESSI
    111     dec     dx                      ; Set ZF if TRANSLATEMODE_LARGE, SF if TRANSLATEMODE_NORMAL
     111    dec     dl                      ; Set ZF if TRANSLATEMODE_LARGE, SF if TRANSLATEMODE_NORMAL
    112112    js      SHORT .NothingToChange
    113113    jz      SHORT .LimitHeadsForLargeAddressingMode
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm

    r531 r547  
    197197    ret
    198198%endif
    199 
    200 
    201 %if 0                           ; unused...
    202 ;--------------------------------------------------------------------
    203 ; RamVars_IsDriveDetectionInProgress
    204 ;   Parameters:
    205 ;       DS:     RAMVARS segment
    206 ;   Returns:
    207 ;       ZF:     Set if drive detection is in progress (ROM initialization)
    208 ;   Corrupts registers:
    209 ;       None
    210 ;--------------------------------------------------------------------
    211 RamVars_IsDriveDetectionInProgress:
    212     cmp     WORD [RAMVARS.wSignature], RAMVARS_DRV_DETECT_SIGNATURE
    213     ret
    214 %endif
Note: See TracChangeset for help on using the changeset viewer.