Changeset 605 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- May 8, 2021, 6:55:56 PM (4 years ago)
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.