Changeset 580 in xtideuniversalbios


Ignore:
Timestamp:
Feb 19, 2015, 1:38:02 PM (10 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • XTIDECFG: Fixed a bug from r459 where the menu option for selection of default boot drive would be missing if the BIOS had been built without MODULE_HOTKEYS. The menu option is now visible if either or both of MODULE_HOTKEYS and MODULE_BOOT_MENU is available.
  • BIOS: Disabled ATA-ID validation by adding a new define (NO_ATAID_VALIDATION) and making it the default for all builds since at least two WD Caviar drive models are incompatible with it.
  • Fixed the "No Fixed Disk Present in FDISK"-bug introduced in r551 which means the Tiny build now works without including MODULE_DRIVEXLATE.
  • Fixed a bug from r528 where pressing hotkey F6 would not initiate detection of serial drives.
  • Fixed a bug from r186 in DisplayFormatCompressed.asm where the boot menu would print the IRQ in hexadecimal format when it should be in decimal format.
  • Optimizations and fixes.
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm

    r567 r580  
    8989    xor     bx, bx
    9090    xchg    si, ax
    91     jmp     short DisplayPrint_NullTerminatedStringFromBXSI
     91    jmp     SHORT DisplayPrint_NullTerminatedStringFromBXSI
    9292
    9393DisplayFormatCompressed_Format_x:
    9494DisplayFormatCompressed_Format_5_x:
    95     mov     si,16                       ; hex output, change base to 16
    96     mov     bx,(04<<8) + 'h'            ; 4 bytes, with postfix character 'h' to emit
     95    mov     si, 16                      ; hex output, change base to 16
     96    mov     bx, (04<<8) + 'h'           ; 4 bytes, with postfix character 'h' to emit
    9797                                        ; (note that the count includes the 'h')
    98     jmp     DisplayFormatCompressed_Format_u
    99 
    100 DisplayFormatCompressed_Format_2_I:
    101     mov     si,g_szDashForZero          ; preload dash string in case we jump
    102     test    ax,ax                       ; if parameter equals zero, emit dash string instead
    103     jz      DisplayFormat_ParseCharacters
    104     ; fall through
     98    SKIP2B  f                           ; Fall through to DisplayFormatCompressed_Format_u
    10599
    106100DisplayFormatCompressed_Format_2_u:
    107     mov     bh,2                        ; only two characters (instead of the default 5)
     101    mov     bh, 2                       ; only two characters (instead of the default 5)
    108102    ; fall through
    109103
     
    111105DisplayFormatCompressed_Format_5_u:
    112106    push    bx                          ; push postfix character - either a zero (default) or a 'h'
    113     mov     bl,bh                       ; preserve character count for .PrintLoop
     107    mov     bl, bh                      ; preserve character count for .PrintLoop
    114108
    115109.DivLoop:
     
    119113
    120114    dec     bh
    121     jnz     .DivLoop
     115    jnz     SHORT .DivLoop
    122116
    123117.PrintLoop:
     
    125119
    126120    dec     bl                          ; on second to last iteration, emit digit whether it is zero or not
    127     jz      .PrintDigit
    128 
    129     js      short DisplayPrint_CharacterFromAL  ; on last iteration, emit postfix character
     121    jz      SHORT .PrintDigit
     122    js      SHORT DisplayPrint_CharacterFromAL  ; on last iteration, emit postfix character
    130123                                                ; if it is zero, DisplayPrint_CharacterFromAL will not emit
    131124
    132125    or      bh, al                      ; skip leading zeros, bh keeps track if we have emitted anything non-zero
    133     jnz     .PrintDigit                 ; note that bh starts at zero, from the loop above
    134 
    135     test    ch,2                        ; are we padding with leading spaces?
    136     jnz     .PrintLoop                  ; test the even/odd of the format byte in the string
     126    jnz     SHORT .PrintDigit           ; note that bh starts at zero, from the loop above
     127
     128    test    ch, 2                       ; are we padding with leading spaces?
     129    jnz     SHORT .PrintLoop            ; test the even/odd of the format byte in the string
    137130
    138131    mov     al, 89h                     ; emit space
     
    144137
    145138    call    DisplayPrint_CharacterFromAL
    146 
    147     jmp     .PrintLoop
    148 
     139    jmp     SHORT .PrintLoop
     140
     141DisplayFormatCompressed_Format_2_I:
     142    test    ax, ax
     143    jnz     SHORT DisplayFormatCompressed_Format_2_u
     144    mov     si, g_szDashForZero         ; if parameter equals zero, emit dash string instead
     145    SKIP2B  bx                          ; Fall through to DisplayFormat_ParseCharacters
    149146
    150147;--------------------------------------------------------------------
     
    161158;       AX, BX, CX, DX, BP
    162159;--------------------------------------------------------------------
    163 
    164160DisplayFormatCompressed_BaseFormatOffset:
    165 
    166161DisplayFormat_ParseCharacters_FromAX:
    167     mov     si,ax
     162    mov     si, ax
    168163    ; fall through to DisplayFormat_ParseCharacters
    169164
     
    174169; and must be handled differently.
    175170;
    176     cmp     si,byte 07fh        ; well within the boundaries of ROMVARS_size
    177     mov     bx,cs               ; preload bx with cs in case we take the following jump
    178     jb      short DisplayPrint_NullTerminatedStringFromBXSI
     171    cmp     si, BYTE 7Fh        ; well within the boundaries of ROMVARS_size
     172    mov     bx, cs              ; preload bx with cs in case we take the following jump
     173    jb      SHORT DisplayPrint_NullTerminatedStringFromBXSI
    179174
    180175.decode:
    181176    cs lodsb                    ; load next byte of the string
    182 
    183     mov     ch,al               ; save a copy for later processing of high order bits
    184 
    185     test    al,0c0h             ; check for translation/format character
    186     jz      DisplayFormatCompressed_TranslatesAndFormats
    187 
    188     and     al,03fh                             ; "Normal" character, mask off high order bits
    189     add     al,StringsCompressed_NormalBase     ; and add character offset (usually around 0x40)
     177    mov     ch, al              ; save a copy for later processing of high order bits
     178    test    al, 0C0h            ; check for translation/format character
     179    jz      SHORT DisplayFormatCompressed_TranslatesAndFormats
     180
     181    and     al, 3Fh                             ; "Normal" character, mask off high order bits
     182    add     al, StringsCompressed_NormalBase    ; and add character offset (usually around 0x40)
    190183
    191184.output:
     
    193186
    194187.process_after_output:
    195     eSHL_IM ch,1                                ; check high order bits for end of string or space
    196     jns     short DisplayFormatCompressed_ret
    197     jnc     .decode
    198     mov     al,' '
     188    eSHL_IM ch, 1                               ; check high order bits for end of string or space
     189    jns     SHORT DisplayFormatCompressed_ret
     190    jnc     SHORT .decode
     191    mov     al, ' '
    199192    call    DisplayPrint_CharacterFromAL
    200     jmp     .decode
     193    jmp     SHORT .decode
    201194
    202195
     
    207200; DisplayFormatCompressed_BaseFormatOffset and jump targets (must fit in 256 bytes)
    208201;
    209     eSHL_IM ch,1                ; setup ch for later testing of null in .process_after_output
    210     and     ax,0001fh           ; also clears AH for addition with BX and DX below
    211 
    212     mov     bx,StringsCompressed_TranslatesAndFormats   ; calculate offset of translation/formats offset byte
    213     add     bx,ax
    214 
    215     cmp     al,StringsCompressed_FormatsBegin           ; determine if this is a translation or a format
    216 
    217     mov     al,[cs:bx]                                  ; fetch translation/formats byte
    218 
    219     jb      DisplayFormat_ParseCharacters.output        ; check if this a translation or a format
     202    eSHL_IM ch, 1               ; setup ch for later testing of null in .process_after_output
     203    and     ax, 001Fh           ; also clears AH for addition with BX and DX below
     204
     205    mov     bx, StringsCompressed_TranslatesAndFormats  ; calculate offset of translation/formats offset byte
     206    add     bx, ax
     207
     208    cmp     al, StringsCompressed_FormatsBegin          ; determine if this is a translation or a format
     209    mov     al, [cs:bx]                                 ; fetch translation/formats byte
     210    jb      SHORT DisplayFormat_ParseCharacters.output  ; check if this a translation or a format
    220211                                                        ; if it is translation, output and postprocess for eos
    221212                                                        ; note that the flags for this conditional jump were
    222213                                                        ; set with the cmp al,StringsCompressed_FormatsBegin
    223214
    224     mov     dx,DisplayFormatCompressed_BaseFormatOffset   ; calculate address to jump to for format handler
    225     sub     dx,ax
    226 
    227     mov     ax,[bp]             ; preload ax with parameter
     215    mov     dx, DisplayFormatCompressed_BaseFormatOffset    ; calculate address to jump to for format handler
     216    sub     dx, ax
     217
     218    mov     ax, [bp]            ; preload ax with parameter
    228219    dec     bp                  ; if no parameter is needed (format 'nl' for example),
    229220    dec     bp                  ; the format handler can reincrement bp
    230221
    231     mov     bx,0500h            ; preload bh with 5 decimal places for numeric output
     222    mov     bx, 0500h           ; preload bh with 5 decimal places for numeric output
    232223                                ; bl is zero, indicating not to output a 'h' (default base 10)
    233224
     
    235226    push    cx
    236227
    237     mov     si,10               ; preload si with 10 for numeric output (default base 10)
    238 
     228    mov     si, 10              ; preload si with 10 for numeric output (default base 10)
    239229    call    dx                  ; call the format routine
    240230
     
    242232    pop     si
    243233
    244     jmp     DisplayFormat_ParseCharacters.process_after_output  ; continue postprocessing, check for end of string
    245 
     234    jmp     SHORT DisplayFormat_ParseCharacters.process_after_output    ; continue postprocessing, check for end of string
  • trunk/Assembly_Library/Src/Display/DisplayPrint.asm

    r567 r580  
    125125DisplayPrint_WordFromAXWithBaseInBX:
    126126    push    cx
    127     push    bx
    128127
    129128    xor     cx, cx
    130129ALIGN DISPLAY_JUMP_ALIGN
    131130.DivideLoop:
     131    inc     cx                  ; Increment character count
    132132    xor     dx, dx              ; DX:AX now holds the integer
    133133    div     bx                  ; Divide DX:AX by base
    134134    push    dx                  ; Push remainder
    135     inc     cx                  ; Increment character count
    136135    test    ax, ax              ; All divided?
    137136    jnz     SHORT .DivideLoop   ;  If not, loop
    138137
     138ALIGN DISPLAY_JUMP_ALIGN
    139139PrintAllPushedDigits:           ; Unused entrypoint OK
    140     mov     bx, g_rgcDigitToCharacter
    141 ALIGN DISPLAY_JUMP_ALIGN
    142140.PrintNextDigit:
    143141    pop     ax                  ; Pop digit
    144     cs xlatb
     142    cmp     al, 10              ; Convert binary digit in AL to ASCII hex digit ('0'-'9' or 'A'-'F')
     143    sbb     al, 69h
     144    das
    145145    call    DisplayPrint_CharacterFromAL
    146146    loop    .PrintNextDigit
    147147
    148     pop     bx
    149     pop     cx
    150     ret
    151 
    152 g_rgcDigitToCharacter:  db  "0123456789ABCDEF"
    153 
    154 %endif ; MODULE_STRINGS_COMPRESSED
     148    pop     cx
     149    ret
     150%endif ; ~MODULE_STRINGS_COMPRESSED
    155151
    156152;--------------------------------------------------------------------
     
    170166DisplayPrint_QWordFromSSBPwithBaseInBX:
    171167    push    cx
    172     push    bx
    173168
    174169    mov     cx, bx              ; CX = Integer base
     
    181176    cmp     WORD [bp], BYTE 0   ; All divided?
    182177    jne     SHORT .DivideLoop   ;  If not, loop
    183     mov     cx, bx              ; Character count to CX
     178    xchg    cx, bx              ; Character count to CX, Integer base to BX
    184179    jmp     SHORT PrintAllPushedDigits
    185180%endif
  • trunk/Assembly_Library/Src/Menu/MenuBorders.asm

    r568 r580  
    388388    mov     si, ATTRIBUTE_CHARS.cNormalTimeout
    389389    cmp     di, BYTE MENU_TIMEOUT_SECONDS_FOR_HURRY
    390     jnb     SHORT .NormalTimeout
    391     dec     si          ; SI = ATTRIBUTE_CHARS.cHurryTimeout
    392 .NormalTimeout:
     390    sbb     si, 0       ; SI = ATTRIBUTE_CHARS.cHurryTimeout (if CF was set)
    393391    call    MenuAttribute_GetToAXfromTypeInSI
    394392
  • trunk/Assembly_Library/Src/Util/Memory.asm

    r526 r580  
    159159;       CX
    160160;--------------------------------------------------------------------
    161 %ifndef EXCLUDE_FROM_XTIDECFG
     161%ifndef EXCLUDE_FROM_XTIDECFG OR NO_ATAID_VALIDATION
    162162ALIGN JUMP_ALIGN
    163163Memory_SumCXbytesFromESSItoAL:
  • trunk/Assembly_Library/Src/Util/Size.asm

    r567 r580  
    5757.MagnitudeConversionLoop:
    5858    ePUSH_T di, .MagnitudeConversionLoop; DI corrupted only on 8086/8088 build
     59%ifdef USE_186
    5960    test    bx, bx                      ; Bits 32...47 in use?
    6061    jnz     SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
    6162    test    dx, dx                      ; Bits 16...31 in use?
    6263    jnz     SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
     64%else ; 808x
     65    mov     di, bx
     66    or      di, dx
     67    jnz     SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
     68%endif
    6369    cmp     ax, 10000                   ; 5 digits needed?
    6470    jae     SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
     
    6874    ; Convert remainder to tenths
    6975    xchg    bx, ax                      ; Store AX
    70     mov     ax, 5
     76    mov     al, 5                       ; AH = 0
    7177    mul     cx                          ; DX:AX = remainder * (10 / 2)
    7278%ifdef USE_186
     
    8995    ret
    9096.rgbMagnitudeToChar:    db  " kMGTP"
    91 %endif
    9297
    9398;--------------------------------------------------------------------
     
    95100;   Parameters:
    96101;       BX:DX:AX:   Size
    97 ;       CX:         Magnitude in BYTE_MULTIPLES
     102;       CX:         Magnitude in BYTE_MULTIPLES (must be 254 or less)
    98103;   Returns:
    99104;       BX:DX:AX:   Size in magnitude
     
    105110ALIGN UTIL_SIZE_JUMP_ALIGN
    106111Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX:
     112    inc     cx                      ; Increment magnitude
     113    mov     si, 1023
     114    and     si, ax                  ; Remainder now in SI
     115    ; Fall to Size_DivideSizeInBXDXAXby1024
     116%endif ; INCLUDE_MENU_LIBRARY
     117
     118;--------------------------------------------------------------------
     119; Size_DivideSizeInBXDXAXby1024
     120;   Parameters:
     121;       BX:DX:AX:   Size
     122;       CX:         Must be 255 or less
     123;   Returns:
     124;       BX:DX:AX:   Size divided by 1024
     125;   Corrupts registers:
     126;       Nothing
     127;--------------------------------------------------------------------
     128ALIGN UTIL_SIZE_JUMP_ALIGN
     129Size_DivideSizeInBXDXAXby1024:
     130%ifdef USE_386
     131    shrd    ax, dx, 10
     132    shrd    dx, bx, 10
     133    shr     bx, 10
     134%else
    107135    push    cx
    108     xor     si, si                  ; Zero remainder
    109     mov     cl, 10                  ; Divide by 1024
     136    mov     cl, 10
    110137ALIGN UTIL_SIZE_JUMP_ALIGN
    111138.ShiftLoop:
    112139    call    Size_DivideBXDXAXbyTwo
    113     rcr     si, 1                   ; Update remainder
    114140    loop    .ShiftLoop
    115 %ifdef USE_186
    116     shr     si, 6                   ; Remainder to SI beginning
    117 %else
    118     mov     cl, 6
    119     shr     si, cl
     141    pop     cx
    120142%endif
    121     pop     cx
    122     inc     cx                      ; Increment magnitude
    123143    ret
    124144
     
    134154;       Nothing
    135155;--------------------------------------------------------------------
     156%ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     157    %ifdef USE_386
     158        %define EXCLUDE
     159    %endif
     160    %ifdef MODULE_BOOT_MENU
     161        %undef EXCLUDE
     162    %endif
     163%endif
     164
     165%ifndef EXCLUDE
    136166ALIGN UTIL_SIZE_JUMP_ALIGN
    137167Size_ConvertSectorCountInBXDXAXtoKiB:   ; unused entrypoint ok
     
    141171    rcr     ax, 1                   ; ...kiB
    142172    ret
     173%endif
     174%undef EXCLUDE
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm

    r567 r580  
    4949ALIGN JUMP_ALIGN
    5050.InswLoop:
    51     %rep 8 ; WORDs
     51    %rep 8  ; WORDs
    5252        XTIDE_INSW
    5353    %endrep
     
    7676    rep insb
    7777    ret
    78 %else ; If 8088/8086
     78%else ; 808x
    7979    UNROLL_SECTORS_IN_CX_TO_OWORDS
    8080ALIGN JUMP_ALIGN
     
    112112    ret
    113113
    114 %else ; If 8088/8086
     114%else ; 808x
    115115    UNROLL_SECTORS_IN_CX_TO_OWORDS
    116116ALIGN JUMP_ALIGN
     
    130130    db      0C1h        ; SHL
    131131    db      0E1h        ; CX
    132     db      7           ; 7 (Sectors to DWORDs)
     132    db      7           ; 7 (Sectors to DWORDs)
    133133    rep
    134134    db      66h         ; Override operand size to 32-bit
     
    155155;       Nothing
    156156;   Corrupts registers:
    157 ;       AX, BX, CX, DX
     157;       AX, BX, CX
    158158;--------------------------------------------------------------------
    159159ALIGN JUMP_ALIGN
     
    162162    UNROLL_SECTORS_IN_CX_TO_QWORDS
    163163    mov     bl, 8       ; Bit mask for toggling data low/high reg
    164     push    es          ; Copy ES...
    165     pop     ds          ; ...to DS
     164    push    es
     165    pop     ds
    166166ALIGN JUMP_ALIGN
    167167.OutswLoop:
     
    183183;       Nothing
    184184;   Corrupts registers:
    185 ;       AX, BX, CX, DX
     185;       AX, BX, CX
    186186;--------------------------------------------------------------------
    187187ALIGN JUMP_ALIGN
     
    189189    UNROLL_SECTORS_IN_CX_TO_QWORDS
    190190    push    ds
    191     push    es      ; Copy ES...
    192     pop     ds      ; ...to DS
     191    push    es
     192    pop     ds
    193193ALIGN JUMP_ALIGN
    194194.WriteNextQword:
    195195    %rep 4  ; WORDs
    196         XTIDE_MOD_OUTSW ; special macro
     196        XTIDE_MOD_OUTSW
    197197    %endrep
    198198    loop    .WriteNextQword
     
    210210;       Nothing
    211211;   Corrupts registers:
    212 ;       AX, BX, CX, DX
     212;       AX, BX, CX
    213213;--------------------------------------------------------------------
    214214ALIGN JUMP_ALIGN
     
    220220    ret
    221221
    222 %else ; If 8088/8086
    223     UNROLL_SECTORS_IN_CX_TO_QWORDS
    224     push    ds
    225     ;mov    ax, es
    226     ;mov    ds, ax  ; move es to ds via ax (does this run faster on 8088?)
     222%else ; 808x
     223    UNROLL_SECTORS_IN_CX_TO_QWORDS
     224    push    ds
    227225    push    es
    228226    pop     ds
     
    231229    %rep 8  ; BYTEs
    232230        lodsb           ; Load BYTE from [DS:SI]
    233         out dx, al      ; Write BYTE
     231        out     dx, al  ; Write BYTE
    234232    %endrep
    235233    loop    .WriteNextQword
     
    251249;       Nothing
    252250;   Corrupts registers:
    253 ;       AX, BX, CX, DX
     251;       AX, BX, CX
    254252;--------------------------------------------------------------------
    255253ALIGN JUMP_ALIGN
     
    261259    ret
    262260
    263 %else ; If 8088/8086
    264     UNROLL_SECTORS_IN_CX_TO_QWORDS
    265     push    ds
    266     ;mov    ax, es
    267     ;mov    ds, ax      ; move es to ds via ax (does this run faster on 8088?)
     261%else ; 808x
     262    UNROLL_SECTORS_IN_CX_TO_QWORDS
     263    push    ds
    268264    push    es
    269265    pop     ds
     
    272268    %rep 4  ; WORDs
    273269        lodsw           ; Load WORD from [DS:SI]
    274         out dx, ax      ; Write WORD
     270        out     dx, ax  ; Write WORD
    275271    %endrep
    276272    loop    .WriteNextQword
    277273    pop     ds
    278274    ret
    279 %endif  ; if/else USE_186
     275%endif
    280276
    281277;--------------------------------------------------------------------
     
    284280    db      0C1h        ; SHL
    285281    db      0E1h        ; CX
    286     db      7           ; 7 (Sectors to DWORDs)
     282    db      7           ; 7 (Sectors to DWORDs)
    287283    es                  ; Source is ES segment
    288284    rep
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm

    r567 r580  
    7474
    7575;--------------------------------------------------------------------
    76 ; AH15h_GetSectorCountFromForeignDriveToDXAX:
    77 ; AH15h_GetSectorCountToBXDXAX:
     76; AH15h_GetSectorCountFromForeignDriveToDXAX
     77; AH15h_GetSectorCountToBXDXAX
    7878;   Parameters:
    7979;       DL:     Drive number (AH15h_GetSectorCountFromForeignDriveToDXAX only)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm

    r568 r580  
    100100    jb      Prepare_ReturnFromInt13hWithInvalidFunctionError
    101101    mov     [di+EDRIVE_INFO.wSize], ax
    102     add     al, EDRIVEINFO_SIZE_WITH_DPTE - MINIMUM_EDRIVEINFO_SIZE
     102    mov     al, EDRIVEINFO_SIZE_WITH_DPTE
    103103    cmp     cx, ax
    104104    jb      SHORT .SkipEddConfigurationParameters
    105     mov     [di+EDRIVE_INFO.wSize], ax
     105    mov     [di+EDRIVE_INFO.wSize], al
    106106
    107107    ; Store DPTE for standard controllers only,
     
    159159    mov     [di+EDRIVE_INFO.dwCylinders+2], cx
    160160
    161     xor     ax, ax      ; Success
     161    xchg    ax, cx      ; Success
    162162    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r568 r580  
    3232;       AX, BX, CX
    3333;--------------------------------------------------------------------
     34%ifndef NO_ATAID_VALIDATION
    3435AtaID_VerifyFromESSI:
    3536    ; We cannot start by reading ATA version since the ID might be
     
    8788.ValidPCHorSinOffsetBX:
    8889    ret
     90%endif ; NO_ATAID_VALIDATION
    8991
    9092
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r568 r580  
    4848    call    StartDetectionWithDriveSelectByteInBHandStringInCX
    4949
     50%ifdef MODULE_HOTKEYS
     51%ifdef MODULE_SERIAL
     52    ; This is only needed for hotkey F6 (ComDtct) to work
     53    call    ScanHotkeysFromKeyBufferAndStoreToBootvars          ; Done here while CX is still protected
     54%endif
     55%endif
     56
    5057    pop     cx
    5158
     
    6875
    6976%ifdef MODULE_HOTKEYS
    70     cmp     al, COM_DETECT_HOTKEY_SCANCODE  ; Set by last call to HotkeyBar_UpdateDuringDriveDetection above
     77    cmp     al, COM_DETECT_HOTKEY_SCANCODE  ; Set by last call to ScanHotkeysFromKeyBufferAndStoreToBootvars above
    7178    je      .DriveDetectLoop
    7279%endif
     
    7683    and     al, 8                           ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
    7784    jnz     .DriveDetectLoop
    78 %endif
     85%endif ; MODULE_SERIAL
    7986
    8087.AddHardDisks:
     
    226233;--------------------------------------------------------------------
    227234CreateBiosTablesForHardDisk:
     235%ifndef NO_ATAID_VALIDATION
    228236    push    bx
    229237    call    AtaID_VerifyFromESSI
    230238    pop     bx
    231239    jnz     SHORT DetectDrives_DriveNotFound
     240%endif
    232241    call    CreateDPT_FromAtaInformation
    233242    jc      SHORT DetectDrives_DriveNotFound
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r567 r580  
    8282    call    RamVars_Initialize
    8383    call    BootVars_Initialize
     84%ifdef MODULE_HOTKEYS
     85    ; This is a simple fix for the so called "No Fixed Disk Present in FDISK"-bug introduced in r551. MODULE_HOTKEYS includes the internal
     86    ; module MODULE_DRIVEXLATE which is needed if interrupt handlers are installed before drive detection. The reason for this is that
     87    ; Interrupts_InitializeInterruptVectors won't install our interrupt 13h handler if no drives were detected (unless MODULE_DRIVEXLATE is included).
     88    ; Since the drive detection hasn't been done yet, the handler will not be installed, causing the above mentioned bug.
    8489    call    Interrupts_InitializeInterruptVectors   ; HotkeyBar requires INT 40h so install handlers before drive detection
    8590    call    DetectDrives_FromAllIDEControllers
     91%else
     92    ; Without MODULE_HOTKEYS (or actually MODULE_DRIVEXLATE) we *must* use this call order.
     93    call    DetectDrives_FromAllIDEControllers
     94    call    Interrupts_InitializeInterruptVectors
     95%endif
    8696    mov     [RAMVARS.wDrvDetectSignature], es       ; No longer in drive detection mode (set normal timeouts)
    8797    ; Fall to .StoreDptPointersToIntVectors
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm

    r558 r580  
    2222
    2323;--------------------------------------------------------------------
    24 ; Drives must be detected before this function is called!
     24; Drives must be detected before this function is called unless
     25; MODULE_DRIVEXLATE has been included in the BIOS.
    2526;
    2627; Interrupts_InitializeInterruptVectors
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm

    r568 r580  
    304304    ; Max = 16,514,064 / 63 = 262128
    305305    mov     cx, LBA_ASSIST_SPT          ; CX = 63
    306     call    Math_DivDXAXbyCX
     306    call    Math_DivDXAXbyCX            ; Preserves CX
    307307    push    dx
    308308    push    ax                          ; Value CH stored for later use
     
    316316    ; AX = Number of heads = ((Value CH - 1) / 1024) + 1
    317317    ; Max = (262127 / 1024) + 1 = 256
    318     push    si
    319     call    Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
    320     pop     si
     318    call    Size_DivideSizeInBXDXAXby1024   ; Preserves CX
    321319    inc     ax                          ; + 1
    322320
    323321    ; Heads must be 16, 32, 64, 128 or 255 (round up to the nearest)
    324322    ; Max = 255
    325     mov     cx, 16                      ; Min number of heads
     323    mov     cl, 16                      ; Min number of heads
    326324.CompareNextValidNumberOfHeads:
    327325    cmp     ax, cx
  • trunk/XTIDE_Universal_BIOS/makefile

    r567 r580  
    3535# RESERVE_DIAGNOSTIC_CYLINDER Reserve one L-CHS cylinder for compatibility with old BIOSes         #
    3636# DANGEROUS_DETECTION         Scans Advanced Controllers from dangerous ports like mirrored PIC    #
     37# NO_ATAID_VALIDATION ***     Excludes code that tries to ensure proper communication with drives  #
    3738# USE_186                     Use instructions supported by 80188/80186 and V20/V30 and later      #
    3839# USE_286                     Use instructions supported by 286 and later (defines USE_UNDOC_INTEL)#
     
    4243#                                                                                                  #
    4344# ** AT Builds only (when USE_AT is defined)                                                       #
     45# *** Use this only when certain known good drives are not being detected (eg WD Caviars)          #
    4446####################################################################################################
    4547
     
    101103# Assembler preprocessor defines.                               #
    102104#################################################################
    103 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_POWER_MANAGEMENT RESERVE_DIAGNOSTIC_CYLINDER
     105DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_POWER_MANAGEMENT RESERVE_DIAGNOSTIC_CYLINDER NO_ATAID_VALIDATION
    104106DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED MODULE_COMPATIBLE_TABLES
    105107
    106108DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED
    107 DEFINES_XTPLUS = $(DEFINES_COMMON) $(DEFINES_XT) USE_186
     109DEFINES_XTPLUS = $(DEFINES_XT) USE_186
    108110DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 MODULE_IRQ MODULE_ADVANCED_ATA MODULE_COMPATIBLE_TABLES
    109111
     
    112114DEFINES_AT_LARGE = $(DEFINES_AT) $(DEFINES_COMMON_LARGE)
    113115
    114 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE
     116DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE NO_ATAID_VALIDATION
    115117DEFINES_386_8K = $(DEFINES_AT) USE_386
    116118
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm

    r567 r580  
    163163    push    cs
    164164    pop     ds
     165    call    Buffers_GetRomvarsFlagsToAX
    165166    call    .EnableOrDisableScanForSerialDrives
    166167    call    .EnableOrDisableDefaultBootDrive
     
    173174; .EnableOrDisableScanForSerialDrives
    174175;   Parameters:
    175 ;       SS:BP:  Menu handle
    176 ;   Returns:
    177 ;       Nothing
    178 ;   Corrupts registers:
    179 ;       AX, BX
     176;       AX:     ROMVARS.wFlags
     177;       SS:BP:  Menu handle
     178;   Returns:
     179;       Nothing
     180;   Corrupts registers:
     181;       BX
    180182;--------------------------------------------------------------------
    181183ALIGN JUMP_ALIGN
    182184.EnableOrDisableScanForSerialDrives:
    183     call    Buffers_GetRomvarsFlagsToAX
    184185    mov     bx, g_MenuitemBootMenuSerialScanDetect
    185186    test    ax, FLG_ROMVARS_MODULE_SERIAL
     
    190191; .EnableOrDisableDefaultBootDrive
    191192;   Parameters:
    192 ;       SS:BP:  Menu handle
    193 ;   Returns:
    194 ;       Nothing
    195 ;   Corrupts registers:
    196 ;       AX, BX
     193;       AX:     ROMVARS.wFlags
     194;       SS:BP:  Menu handle
     195;   Returns:
     196;       Nothing
     197;   Corrupts registers:
     198;       BX
    197199;--------------------------------------------------------------------
    198200ALIGN JUMP_ALIGN
    199201.EnableOrDisableDefaultBootDrive:
    200     call    Buffers_GetRomvarsFlagsToAX
    201202    mov     bx, g_MenuitemBootMnuStngsDefaultBootDrive
    202     test    ax, FLG_ROMVARS_MODULE_HOTKEYS
     203    test    ax, FLG_ROMVARS_MODULE_HOTKEYS | FLG_ROMVARS_MODULE_BOOT_MENU
    203204    jmp     SHORT .DisableMenuitemFromCSBXifZFset
    204205
     
    207208; .EnableOrDisableBootMenuSelectionTimeout
    208209;   Parameters:
    209 ;       SS:BP:  Menu handle
    210 ;   Returns:
    211 ;       Nothing
    212 ;   Corrupts registers:
    213 ;       AX, BX
     210;       AX:     ROMVARS.wFlags
     211;       SS:BP:  Menu handle
     212;   Returns:
     213;       Nothing
     214;   Corrupts registers:
     215;       BX
    214216;--------------------------------------------------------------------
    215217ALIGN JUMP_ALIGN
    216218.EnableOrDisableBootMenuSelectionTimeout:
    217     call    Buffers_GetRomvarsFlagsToAX
    218219    mov     bx, g_MenuitemBootMnuStngsSelectionTimeout
    219220    test    ax, FLG_ROMVARS_MODULE_BOOT_MENU
Note: See TracChangeset for help on using the changeset viewer.