Changeset 621 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src


Ignore:
Timestamp:
Nov 21, 2021, 2:15:32 PM (3 years ago)
Author:
Krister Nordvall
Message:

Changes:

  • Fixed three different bugs all causing the boot menu to show drives using IRQs even though the BIOS had been built without MODULE_IRQ.
  • Fixed two bugs in XTIDECFG where loading a BIOS from file and then loading the old settings from EEPROM would
    • overwrite ROMVARS.wFlags in the loaded BIOS file (in RAM). The possibly resulting mismatch of module flags could make it impossible to change settings for modules included in the BIOS or allow changing settings for modules not included in the BIOS.
    • not copy the color theme over to the loaded BIOS.
  • Also fixed two very minor bugs in XTIDECFG in BiosFile_LoadFileFromDSSItoRamBuffer and BiosFile_SaveRamBufferToFileInDSSI where the error handling in these routines would close whatever file handle that happened to match the error code returned by DOS in AX.
  • Made significant changes to the new flash ROM programming routines to reduce the size. Also fixed a minor bug that would cause the second verification to be skipped and return success when programming a 64 KB block of data.
  • Changed the custom BIOS build file names to the 8.3 format.
  • Changed some help strings in XTIDECFG to clarify things.
  • Other minor optimizations and fixes.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm

    r617 r621  
    5252    jne     IdeDPT_Finalize
    5353    jmp     SerialDPT_Finalize
    54 %else
     54%else ; ~USE_386
    5555    je      SHORT .FinalizeDptForSerialPortDevice
    5656    jmp     IdeDPT_Finalize
     
    100100;       AL, BX, CX, DX, SI, DI, ES
    101101;--------------------------------------------------------------------
     102%ifndef NO_ATAID_CORRECTION
    102103Device_IdentifyToBufferInESSIwithDriveSelectByteInBH:
    103 %ifndef NO_ATAID_CORRECTION
    104104    cmp     cx, XUB_INT13h_SIGNATURE
    105105    je      SHORT .DoNotFixAtaInformation
     
    108108    ePUSH_T cx, AtaID_PopESSIandFixIllegalValuesFromESSI    ; Here we modify ATA information if necessary
    109109.DoNotFixAtaInformation:
    110 %endif
    111110
    112111%ifdef MODULE_SERIAL    ; IDE + Serial
     
    115114    jne     IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
    116115    jmp     SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
    117 %else
     116%else ; ~USE_386
    118117    je      SHORT .IdentifyDriveFromSerialPort
    119118    jmp     IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     
    126125%endif
    127126
     127%else ; NO_ATAID_CORRECTION
     128%ifdef MODULE_SERIAL    ; IDE + Serial
     129    cmp     BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
     130%ifdef USE_386
     131    jne     IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     132    jmp     SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     133%else ; ~USE_386
     134    je      SHORT .IdentifyDriveFromSerialPort
     135    jmp     IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     136.IdentifyDriveFromSerialPort:
     137    jmp     SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     138%endif
     139
     140%else                   ; IDE
     141    Device_IdentifyToBufferInESSIwithDriveSelectByteInBH    EQU     IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     142%endif
     143%endif ; NO_ATAID_CORRECTION
     144
    128145
    129146;--------------------------------------------------------------------
     
    149166    jz      IdeCommand_OutputWithParameters
    150167    jmp     SerialCommand_OutputWithParameters
    151 %else
     168%else ; ~USE_386
    152169    jnz     SHORT .OutputCommandToSerialPort
    153170    jmp     IdeCommand_OutputWithParameters
     
    182199;   jz      IdeCommand_ReadLBAlowRegisterToAL
    183200;   jmp     SerialCommand_ReadLBAlowRegisterToAL
    184 ;%else
     201;%else ; ~USE_386
    185202;   jnz     SHORT .ReadFromSerialPort
    186203;   jmp     IdeCommand_ReadLBAlowRegisterToAL
     
    214231    jnz     SHORT ReturnSuccessForSerialPort
    215232    jmp     IdeCommand_SelectDrive
    216 %else
     233%else ; USE_386
    217234    jz      IdeCommand_SelectDrive
    218235    ; Fall to ReturnSuccessForSerialPort
     
    225242
    226243%ifdef MODULE_SERIAL
    227 ALIGN JUMP_ALIGN
    228244ReturnSuccessForSerialPort:
    229245    xor     ax, ax
  • trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm

    r601 r621  
    154154
    155155    push    si
    156     call    FindDPT_ToDSDIforSerialDevice
     156    call    FindDPT_ToDSDIforSerialDevice   ; Preserves AX
    157157    pop     si
    158158%ifdef MODULE_SERIAL_FLOPPY
     
    162162; So, if there was a previously found floppy disk, DI will point to that DPT and we use that value for the slave.
    163163;
    164     cmp     BYTE [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], 0
     164    cmp     [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al  ; Zero?
    165165    je      SHORT .notfounddpt
    166166.founddpt:
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm

    r599 r621  
    203203;--------------------------------------------------------------------
    204204Interrupts_UnmaskInterruptControllerForDriveInDSDI:
    205     eMOVZX  bx, [di+DPT.bIdevarsOffset]
     205    eMOVZX  bx, [di+DPT.bIdevarsOffset]     ; Clears CF on pre-386 CPUs
     206%ifndef USE_386
     207%ifdef USE_UNDOC_INTEL
     208    salc
     209    or      al, [cs:bx+IDEVARS.bIRQ]
     210%else
    206211    mov     al, [cs:bx+IDEVARS.bIRQ]
    207212    test    al, al
     213%endif
     214%else ; USE_386
     215    mov     al, [cs:bx+IDEVARS.bIRQ]
     216    test    al, al
     217%endif
    208218    jz      SHORT .Return   ; Interrupts disabled
    209219    cmp     al, 8
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r605 r621  
    9696    at  ROMVARS.ideVars0+IDEVARS.wControlBlockPort, dw  DEVICE_ATA_PRIMARY_PORTCTRL     ; Controller Control Block base port
    9797    at  ROMVARS.ideVars0+IDEVARS.bDevice,           db  DEVICE_16BIT_ATA
     98%ifdef MODULE_IRQ
    9899    at  ROMVARS.ideVars0+IDEVARS.bIRQ,              db  14
     100%endif
    99101    at  ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
    100102    at  ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,   dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
     
    103105    at  ROMVARS.ideVars1+IDEVARS.wControlBlockPort, dw  DEVICE_ATA_SECONDARY_PORTCTRL
    104106    at  ROMVARS.ideVars1+IDEVARS.bDevice,           db  DEVICE_16BIT_ATA
     107%ifdef MODULE_IRQ
    105108    at  ROMVARS.ideVars1+IDEVARS.bIRQ,              db  15
     109%endif
    106110    at  ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
    107111    at  ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,   dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
     
    110114    at  ROMVARS.ideVars2+IDEVARS.wControlBlockPort, dw  DEVICE_ATA_TERTIARY_PORTCTRL
    111115    at  ROMVARS.ideVars2+IDEVARS.bDevice,           db  DEVICE_16BIT_ATA
     116%ifdef MODULE_IRQ
    112117    at  ROMVARS.ideVars2+IDEVARS.bIRQ,              db  0   ; Should be 11 on the GSI Inc. Model 2C
     118%endif
    113119    at  ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
    114120    at  ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,   dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
     
    117123    at  ROMVARS.ideVars3+IDEVARS.wControlBlockPort, dw  DEVICE_ATA_QUATERNARY_PORTCTRL
    118124    at  ROMVARS.ideVars3+IDEVARS.bDevice,           db  DEVICE_16BIT_ATA
     125%ifdef MODULE_IRQ
    119126    at  ROMVARS.ideVars3+IDEVARS.bIRQ,              db  0   ; Should be 10 on the GSI Inc. Model 2C
     127%endif
    120128    at  ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
    121129    at  ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,   dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
  • trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm

    r592 r621  
    123123.around:
    124124
    125     mov     ax, g_szFddSizeOr                           ; .PrintXTFloppyType
     125    mov     ax, g_szFddSizeOr
    126126    test    bl, bl                                      ; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD)
    127127    jz      SHORT .PushAXAndOutput
    128128
    129     mov     al, (g_szFddUnknown - $$) & 0xff            ; .PrintUnknownFloppyType
     129    mov     al, (g_szFddUnknown - $$) & 0xff
    130130    cmp     bl, FLOPPY_TYPE_35_ED
    131131    ja      SHORT .PushAXAndOutput
     
    218218
    219219.ConvertSectorCountInBXDXAXtoSizeAndPushForFormat:
     220    call    Size_ConvertSectorCountInBXDXAXtoKiB
    220221    ePUSH_T cx, g_szCapacityNum     ; Push format substring
    221     call    Size_ConvertSectorCountInBXDXAXtoKiB
    222222    mov     cx, BYTE_MULTIPLES.kiB
    223223    call    Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm

    r567 r621  
    137137;--------------------------------------------------------------------
    138138; Iteration routines for FindDPT_MasterOrSingleForIdevarsOffsetInDL and
    139 ; FindDPT_SlaveForIdevarsOffsetInDL, for use with IterateAllDPTs
     139; FindDPT_SlaveForIdevarsOffsetInDL, for use with FindDPT_IterateAllDPTs
    140140;
    141141; Returns when DPT is found on the controller with Idevars offset in DL
     
    152152IterateFindSecondDPTforIdevars:
    153153    call    IterateFindFirstDPTforIdevars
    154     jc      SHORT .WrongController
     154    jc      SHORT WrongController
    155155    mov     si, IterateFindFirstDPTforIdevars
    156 .WrongController:
     156SetCFandReturn:
    157157    stc
     158WrongController:
    158159    ret
    159160
    160161IterateFindFirstDPTforIdevars:
    161162    cmp     dl, [di+DPT.bIdevarsOffset]         ; Clears CF if matched
    162     je      .Done
    163     stc                                         ; Set CF for not found
    164 .Done:
     163    jne     SHORT SetCFandReturn
    165164    ret
    166165
     
    221220;               Set if DPT not found, or no DPTs present
    222221;   Corrupts registers:
    223 ;       SI
     222;       BL, SI
    224223;--------------------------------------------------------------------
    225224%ifdef MODULE_SERIAL
     
    315314    loop    .LoopWhileDPTsLeft
    316315
    317 ALIGN JUMP_ALIGN
    318316.NotFound:
    319317    stc
Note: See TracChangeset for help on using the changeset viewer.