Changeset 605 in xtideuniversalbios
- Timestamp:
- May 8, 2021, 6:55:56 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/CMOS.inc
r593 r605 31 31 ; Almost all of the CMOS locations are vendor specific and 32 32 ; there is very little standardation 33 HARD_DISK_TYPES EQU 12h ; Windows 9 5reads this to check if IDE drives33 HARD_DISK_TYPES EQU 12h ; Windows 9x reads this to check if IDE drives 34 34 ; are present so it should be safe to access this. 35 35 ; Bits 0...3 Hard Disk 1 type (Primary Slave) -
trunk/Assembly_Library/Inc/Emulate.inc
r596 r605 60 60 %endif 61 61 %else ; XT 62 JUMP_ALIGN EQU 1 63 WORD_ALIGN EQU 162 JUMP_ALIGN EQU 1 ; 2 is optimal for 8086 and NEC V30 CPUs but it's not worth the ROM space for most XT machines with 8088 or NEC V20 CPUs. 63 WORD_ALIGN EQU 2 ; The same applies here but the cost of ROM space is negligible. 64 64 %endif 65 65 -
trunk/Assembly_Library/Src/Time/TimerTicks.asm
r592 r605 203 203 ;-------------------------------------------------------------------- 204 204 %ifdef EXCLUDE_FROM_XUB 205 %ifndef MODULE_BOOT_MENU OR MODULE_HOTKEYS205 %ifndef MODULE_BOOT_MENU 206 206 %define EXCLUDE 207 207 %endif -
trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
r601 r605 40 40 41 41 struc HOTKEYVARS 42 .fpPrevTimerHandler resb 4 ; Previous 1Ch timer handler42 .fpPrevTimerHandler resb 4 ; Previous 08h timer handler 43 43 .wTimeWhenDisplayed resb 2 ; System time (ticks) when Hotkey bar was first displayed 44 44 .wFddAndHddLetters: -
trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc
r598 r605 53 53 %endif 54 54 55 %ifdef MODULE_WIN9 5_CMOS_HACK55 %ifdef MODULE_WIN9X_CMOS_HACK 56 56 %ifndef USE_386 57 %error "MODULE_WIN9 5_CMOS_HACK requires USE_386!"57 %error "MODULE_WIN9X_CMOS_HACK requires USE_386!" 58 58 %endif 59 59 %endif -
trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
r601 r605 84 84 85 85 STANDARD_CONTROL_BLOCK_OFFSET EQU 200h 86 XTIDE_CONTROL_BLOCK_OFFSET EQU 8h ; for XTIDE, A3 is used to control selected register (CS0 vs CS1)...86 XTIDE_CONTROL_BLOCK_OFFSET EQU 8h ; For XTIDE, A3 is used to control selected register (CS0 vs CS1)... 87 87 XTCF_CONTROL_BLOCK_OFFSET EQU 10h ; ...and for XT-CF (all variants), it's A4 88 88 ADP50L_CONTROL_BLOCK_OFFSET EQU 10h … … 183 183 ; Bit defines for ROMVARS.wFlags 184 184 FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.) 185 FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES EQU (1<<1) ; Ignores drives configured in motherboard BIOS setup. 186 ; For now it is a hack to get Windows 95 IDE drivers working 187 ; but it will be needed later when XTUB supports dynamic drive overlay. 188 ; Because of that this must be included into AT builds and cannot be a 189 ; module (any AT or 386 must be installable to the hard drive so 190 ; there won't be need for even more different builds). 185 FLG_ROMVARS_CLEAR_BDA_HD_COUNT EQU (1<<1) ; This flag has two purposes; * Removes the system BIOS "dummy" drive 186 ; so that Windows 9x protected mode drivers can be used with XUB drives. 187 ; * Some computers (Zenith Z-171 and Z-161) do not clear the BDA hard 188 ; drive count which causes it to increment on each warm boot. 191 189 FLG_ROMVARS_SERIAL_SCANDETECT EQU (1<<3) ; Scan COM ports at the end of drive detection. Can also be invoked 192 190 ; by holding down the ALT key at the end of drive detection. -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r604 r605 97 97 ;call HotkeyBar_UpdateDuringDriveDetection 98 98 99 push ds 100 push es 101 pop ds 102 99 103 .WaitUntilTimeToCloseHotkeyBar: 100 call TimerTicks_ReadFromBdaToAX101 sub ax, [ es:BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeWhenDisplayed]104 mov ax, [BDA.dwTimerTicks] 105 sub ax, [BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeWhenDisplayed] 102 106 cmp ax, MIN_TIME_TO_DISPLAY_HOTKEY_BAR 103 107 jb SHORT .WaitUntilTimeToCloseHotkeyBar … … 105 109 ; Restore system timer tick handler since hotkeys are no longer needed 106 110 cli 107 mov ax, [ es:BOOTVARS.hotkeyVars+HOTKEYVARS.fpPrevTimerHandler]108 mov [ es:BIOS_SYSTEM_TIMER_TICK_INTERRUPT_08h*4], ax109 mov ax, [ es:BOOTVARS.hotkeyVars+HOTKEYVARS.fpPrevTimerHandler+2]110 mov [ es:BIOS_SYSTEM_TIMER_TICK_INTERRUPT_08h*4+2], ax111 mov ax, [BOOTVARS.hotkeyVars+HOTKEYVARS.fpPrevTimerHandler] 112 mov [BIOS_SYSTEM_TIMER_TICK_INTERRUPT_08h*4], ax 113 mov ax, [BOOTVARS.hotkeyVars+HOTKEYVARS.fpPrevTimerHandler+2] 114 mov [BIOS_SYSTEM_TIMER_TICK_INTERRUPT_08h*4+2], ax 111 115 sti 116 117 pop ds 112 118 %endif 113 119 ; Fall to .ResetAllDrives -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r601 r605 70 70 ; 71 71 call FindDPT_ToDSDIforSerialDevice ; Does not modify AX 72 jnc .AddHardDisks72 jnc SHORT .AddHardDisks 73 73 74 74 mov bp, ROMVARS.ideVarsSerialAuto ; Point to our special IDEVARS structure, just for serial scans … … 76 76 %ifdef MODULE_HOTKEYS 77 77 cmp al, COM_DETECT_HOTKEY_SCANCODE ; Set by last call to ScanHotkeysFromKeyBufferAndStoreToBootvars above 78 je .DriveDetectLoop78 je SHORT .DriveDetectLoop 79 79 %endif 80 80 … … 82 82 or al, [es:BDA.bKBFlgs1] ; Or, did the user hold down the ALT key? 83 83 and al, 8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_SCANDETECT 84 jnz .DriveDetectLoop84 jnz SHORT .DriveDetectLoop 85 85 %endif ; MODULE_SERIAL 86 86 … … 96 96 ; 97 97 98 ; Here we might want to replace BIOS configured drives with the ones we detected. 99 ; Primary reason is to support dynamic overlay feature in the future. Second reason 100 ; is a hack to get Windows 95 to load its built-in protected mode IDE driver. 98 ; This is a hack to get Windows 9x to load its built-in protected mode IDE driver. 101 99 ; 102 100 ; The Windows hack has two parts. First part is to try to alter CMOS address 12h as that 103 ; is what Windows 9 5driver reads to detect IDE drives. Altering is not possible on all101 ; is what Windows 9x driver reads to detect IDE drives. Altering is not possible on all 104 102 ; systems since CMOS has a checksum but its location is not standardized. We will first 105 103 ; try to detect valid checksum. If it succeeds, then it is safe to assume this system 106 104 ; has compatible CMOS and we can alter it. 107 ; If verify fails, we do the more dirty hack to zero BDA drive count. Then Windows 9 5works105 ; If verify fails, we do the more dirty hack to zero BDA drive count. Then Windows 9x works 108 106 ; as long as user has configured at least one drive in the BIOS setup. 109 110 %ifdef USE_AT ; FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES is for AT builds only 111 %ifdef MODULE_WIN95_CMOS_HACK 107 %ifdef MODULE_WIN9X_CMOS_HACK 112 108 mov dl, HARD_DISK_TYPES 113 109 call CMOS_ReadFromIndexInDLtoAL 114 110 test al, 0F0h 115 jnz SHORT .ClearBdaDriveCount ; CMOS byte 12h is ready for Windows 9 5111 jnz SHORT .ClearBdaDriveCount ; CMOS byte 12h is ready for Windows 9x 116 112 call CMOS_Verify10hTo2Dh ; Can we modify CMOS? 117 113 jnz SHORT .ClearBdaDriveCount ; Unsupported BIOS, use plan B 118 114 119 115 ; Now we can alter CMOS location 12h. Award BIOS locks if we set drive 0 type to Fh 120 ; (but accept changes to drive type 1). Windows 9 5requires that the drive 0 type is116 ; (but accept changes to drive type 1). Windows 9x requires that the drive 0 type is 121 117 ; non zero and ignores drive 1 type. So if we only set drive 1, then Award BIOS 122 ; won't give problems but Windows 9 5stays in MS-DOS compatibility mode.118 ; won't give problems but Windows 9x stays in MS-DOS compatibility mode. 123 119 ; 124 120 ; For Award BIOSes we could set the Drive 0 type to 1 and then clear the BDA drive count. 125 ; So essentially we could automatically do what user needs to do manually to get Windows 9 5121 ; So essentially we could automatically do what user needs to do manually to get Windows 9x 126 122 ; working on Award BIOSes. However, I think that should be left to do manually since 127 ; there may be SCSI drives on the system or FLG_ROMVARS_ IGNORE_MOTHERBOARD_DRIVEScould123 ; there may be SCSI drives on the system or FLG_ROMVARS_CLEAR_BDA_HD_COUNT could 128 124 ; be intentionally cleared and forcing the dummy drive might cause only trouble. 129 125 … … 147 143 call CMOS_StoreNewChecksumFor10hto2Dh 148 144 .ClearBdaDriveCount: 149 %endif ; MODULE_WIN95_CMOS_HACK 150 151 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES 152 jz SHORT .ContinueInitialization 153 mov BYTE [es:BDA.bHDCount], 0 ; Set hard disk count to zero 154 .ContinueInitialization: 155 %endif ; USE_AT 145 %endif ; MODULE_WIN9X_CMOS_HACK 156 146 157 147 mov cx, [RAMVARS.wDrvCntAndFlopCnt] ; Our count of hard disks 158 148 mov al, [es:BDA.bHDCount] 159 add [es:BDA.bHDCount], cl ; Add our drives to the system count 149 %ifndef MODULE_MFM_COMPATIBILITY 150 ; This is excluded when MODULE_MFM_COMPATIBILITY is included because it doesn't make sense to use both at the same time anyway. 151 ; Note that the option to "Remove other hard drives" is still visible in XTIDECFG.COM for builds including MODULE_MFM_COMPATIBILITY. 152 ; Changing that option just won't do anything. We might want to remove the option for builds that contain MODULE_MFM_COMPATIBILITY 153 ; but that would require a ROMVARS flag that is probably better spent on other things. 154 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_CLEAR_BDA_HD_COUNT ; Clears CF 155 jz SHORT .ContinueInitialization 156 %ifdef USE_UNDOC_INTEL 157 salc 158 %else 159 xor al, al 160 %endif 161 .ContinueInitialization: 162 %endif ; MODULE_MFM_COMPATIBILITY 163 add cl, al 164 mov [es:BDA.bHDCount], cl ; Update the system count 160 165 or al, 80h ; Or in hard disk flag 161 166 mov [RAMVARS.bFirstDrv], al ; Store first drive number … … 177 182 add al, ch ; Add our drives to existing drive count 178 183 cmp al, 3 ; For BDA, max out at 4 drives (ours is zero based) 179 jb .MaxBDAFloppiesExceeded184 jb SHORT .MaxBDAFloppiesExceeded 180 185 mov al, 3 181 186 .MaxBDAFloppiesExceeded: -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r594 r605 78 78 %ifdef USE_AT 79 79 %ifdef USE_386 80 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | FLG_ROMVARS_ IGNORE_MOTHERBOARD_DRIVES| MASK_ROMVARS_INCLUDED_MODULES80 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | FLG_ROMVARS_CLEAR_BDA_HD_COUNT | MASK_ROMVARS_INCLUDED_MODULES 81 81 %else 82 82 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | MASK_ROMVARS_INCLUDED_MODULES … … 192 192 193 193 %include "AssemblyLibrary.asm" 194 %ifdef MODULE_WIN9 5_CMOS_HACK194 %ifdef MODULE_WIN9X_CMOS_HACK 195 195 %include "CMOS.asm" ; This belongs in the Assembly Library 196 196 %endif -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
r568 r605 220 220 ; C. the serial server always returns floppy drives last 221 221 ; 222 adc byte[RAMVARS.xlateVars+XLATEVARS.bFlopCreateCnt], 0223 jnz .AllDone222 adc BYTE [RAMVARS.xlateVars+XLATEVARS.bFlopCreateCnt], 0 223 jnz SHORT .AllDone 224 224 %else ; ~MODULE_SERIAL_FLOPPY 225 225 ; … … 228 228 ; floppies are supported, so it is important to still fail here if a floppy is seen during the drive scan. 229 229 ; 230 jc .AllDone230 jc SHORT .AllDone 231 231 %endif ; MODULE_SERIAL_FLOPPY 232 232 %endif ; MODULE_SERIAL -
trunk/XTIDE_Universal_BIOS/makefile
r603 r605 29 29 # MODULE_VERY_LATE_INIT Initialize on INT 13h if our INT 19h handler is not called # 30 30 # MODULE_POWER_MANAGEMENT Power Management support # 31 # MODULE_WIN9 5_CMOS_HACK Hack for Windows 95compatibility #31 # MODULE_WIN9X_CMOS_HACK Hack for Windows 9x compatibility # 32 32 # MODULE_MFM_COMPATIBILITY Restores BDA drive count for MFM controllers that expect to be the # 33 33 # only hard drive controller on the system # … … 119 119 120 120 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE NO_ATAID_VALIDATION CLD_NEEDED 121 DEFINES_386 = $(DEFINES_AT) USE_386 MODULE_ADVANCED_ATA MODULE_WIN9 5_CMOS_HACK121 DEFINES_386 = $(DEFINES_AT) USE_386 MODULE_ADVANCED_ATA MODULE_WIN9X_CMOS_HACK 122 122 DEFINES_386_LARGE = $(DEFINES_386) $(DEFINES_COMMON_LARGE) 123 123 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/AutoConfigure.asm
r592 r605 41 41 push es 42 42 pop ds ; ROMVARS now in DS:DI 43 call ChecksumSystemBios 43 44 call ResetIdevarsToDefaultValues 44 45 call DetectIdePortsAndDevices … … 48 49 pop ds 49 50 pop es 51 .Return: 52 ret 53 54 55 ;-------------------------------------------------------------------- 56 ; ChecksumSystemBios 57 ; Parameters: 58 ; DS:DI: Ptr to ROMVARS 59 ; Returns: 60 ; Nothing 61 ; Corrupts registers: 62 ; AX, BX, CX, DX, SI 63 ;-------------------------------------------------------------------- 64 ALIGN JUMP_ALIGN 65 ChecksumSystemBios: 66 push ds 67 mov si, 0F000h 68 mov ds, si 69 mov si, 0FFFFh 70 ; DS:SI now points to the end of the System BIOS. 71 std 72 mov cx, 32768 ; The smallest known problematic BIOS so far. 73 mov dx, si ; Initialize the checksum 74 call CalculateCRC_CCITTfromDSSIwithSizeInCX 75 pop ds 76 mov bx, .Checksums 77 cld 78 .NextChecksum: 79 mov ax, [cs:bx] 80 test ax, ax 81 jz SHORT AutoConfigure_ForThisSystem.Return 82 inc bx 83 inc bx 84 cmp ax, dx 85 jne SHORT .NextChecksum 86 or BYTE [di+ROMVARS.wFlags], FLG_ROMVARS_CLEAR_BDA_HD_COUNT 87 mov dx, g_szDlgBadBiosFound 88 jmp Dialogs_DisplayNotificationFromCSDX 89 90 ALIGN WORD_ALIGN 91 .Checksums: 92 dw 0D192h ; 32 KB Zenith Z-161 (071784) 93 dw 02F69h ; 32 KB Zenith Z-171 (031485) 94 dw 0 95 96 97 ;-------------------------------------------------------------------- 98 ; CalculateCRC_CCITTfromDSSIwithSizeInCX 99 ; Parameters: 100 ; DS:SI: Pointer to string to checksum 101 ; CX: Length of string to checksum 102 ; DX: Checksum (initially 0FFFFh) 103 ; DF: Set/Clear depending on direction wanted 104 ; Returns: 105 ; DX: Checksum 106 ; DS:SI: Pointer to byte after the end of checksummed string 107 ; Corrupts registers: 108 ; AX, BX, CX 109 ;-------------------------------------------------------------------- 110 ALIGN JUMP_ALIGN 111 CalculateCRC_CCITTfromDSSIwithSizeInCX: 112 ; jcxz .Return 113 xor bh, bh 114 mov ah, 0E0h 115 .NextByte: 116 lodsb 117 xor dh, al 118 mov bl, dh 119 rol bx, 1 120 rol bx, 1 121 rol bx, 1 122 rol bx, 1 123 xor dx, bx 124 rol bx, 1 125 xchg dh, dl 126 xor dx, bx 127 ror bx, 1 128 ror bx, 1 129 ror bx, 1 130 ror bx, 1 131 and bl, ah 132 xor dx, bx 133 ror bx, 1 134 xor dh, bl 135 loop .NextByte 136 ;.Return: 50 137 ret 51 138 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm
r597 r605 142 142 at MENUITEM.szQuickInfo, dw g_szNfoClearBdaDriveCount 143 143 at MENUITEM.szHelp, dw g_szHelpClearBdaDriveCount 144 at MENUITEM.bFlags, db FLG_MENUITEM_ FLAGVALUE144 at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_FLAGVALUE 145 145 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 146 146 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.wFlags … … 148 148 at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag 149 149 at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans 150 at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_ROMVARS_ IGNORE_MOTHERBOARD_DRIVES150 at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_ROMVARS_CLEAR_BDA_HD_COUNT 151 151 iend 152 152 … … 258 258 call .EnableOrDisableColorThemeSelection 259 259 call .EnableOrDisableBootMenuSelectionTimeout 260 call .EnableOrDisableClearBdaDriveCount261 260 mov si, g_MenupageForBootMenuSettingsMenu 262 261 jmp Menupage_ChangeToNewMenupageInDSSI … … 328 327 mov bx, g_MenuitemBootMnuStngsSelectionTimeout 329 328 test ax, FLG_ROMVARS_MODULE_BOOT_MENU 330 jmp SHORT .DisableMenuitemFromCSBXifZFset331 332 333 ;--------------------------------------------------------------------334 ; .EnableOrDisableClearBdaDriveCount335 ; Parameters:336 ; AX: ROMVARS.wFlags337 ; SS:BP: Menu handle338 ; Returns:339 ; Nothing340 ; Corrupts registers:341 ; BX342 ;--------------------------------------------------------------------343 ALIGN JUMP_ALIGN344 .EnableOrDisableClearBdaDriveCount:345 mov bx, g_MenuitemBootMnuStngsClearBdaDriveCount346 call Buffers_IsXTbuildLoaded347 329 .DisableMenuitemFromCSBXifZFset: 348 330 jz SHORT .DisableMenuitemFromCSBX … … 448 430 mov cx, ATTRIBUTE_CHARS_size 449 431 mul cl ; Multiply with the menu choice index 450 mov si, ColorThemeTable451 add si, ax452 mov ax, [es:di] ; Fetch the ptr to ColorTheme432 mov si, [es:di] ; Fetch the ptr to ColorTheme 433 add ax, ColorThemeTable 434 xchg si, ax 453 435 mov di, ax 454 436 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r602 r605 118 118 g_bControllersDetected: db 'x' ; Value stored directly here 119 119 db " controllers.",NULL 120 g_szDlgBadBiosFound: db "This computer has been identified as being one of the following models:",LF,LF 121 db "Zenith Z-171",LF 122 db "Zenith Z-161",LF,LF 123 db "The Boot settings menu option 'Remove other hard drives' has been set to YES for this reason.",NULL 120 124 g_szDlgCfgFullMode: db "Enable full operating mode?",NULL 121 125 g_szDlgCfgStealSize: db "How many kiB of base memory to steal for XTIDE Universal BIOS variables (1...255)?",NULL … … 465 469 db " of normal drive detection. Note that if any serial drives are detected during the normal drive detection," 466 470 db " no scan will take place (to avoid finding the same drive twice).",NULL 467 g_szHelpClearBdaDriveCount: db "Set to NO for normal operation. Set to YES to get Windows 95 drivers to work when" 468 db " MODULE_WIN95_CMOS_HACK is not included (dummy drive needs to be defined in system BIOS setup).",NULL 471 g_szHelpClearBdaDriveCount: db "Set to NO for normal operation. Set to YES to get Windows 9x protected mode drivers to work when" 472 db " MODULE_WIN9X_CMOS_HACK is not included (dummy drive needs to be defined in system BIOS setup). This option must" 473 db " also be set to YES on computers where the system BIOS does not initialize RAM properly. Zenith models Z-171 and" 474 db " Z-161 are known examples of such machines.",NULL 469 475 470 476 g_szMultichoiceBootDispMode: db "Default",LF
Note:
See TracChangeset
for help on using the changeset viewer.