Changeset 601 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization
- Timestamp:
- Feb 14, 2019, 7:38:08 PM (6 years ago)
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Initialization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r596 r601 36 36 ;-------------------------------------------------------------------- 37 37 AdvAtaInit_DetectControllerForIdeBaseInBX: 38 ; Detect if system has PCI bus. If it does, we can skip VLB detection. This is 38 ; Detect if system has PCI bus. If it does, we can skip VLB detection. This is a 39 39 ; good thing since detecting Vision QD6580 is dangerous since Intel PIIX4 south bridge 40 40 ; mirrors Interrupt Controller registers from Axh to Bxh. This can lead to faulty … … 45 45 push bx 46 46 push di 47 xor edi, edi ; Some BIOSes require this to be set to zero 48 mov ax, PCI_INSTALLATION_CHECK 49 int BIOS_TIME_PCI_PNP_1Ah 47 ; xor edi, edi ; Some BIOSes require this to be set to zero 48 ; *FIXME* The above instruction is commented away since RBIL says that this 49 ; only applies to software looking for the protected-mode entry point. 50 mov ax, PCI_INSTALLATION_CHECK ; May corrupt EAX, EBX, ECX, EDX, EDI 51 int BIOS_TIME_PCI_PNP_INTERRUPT_1Ah 50 52 pop di 51 53 pop bx -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r599 r601 98 98 ; Here we might want to replace BIOS configured drives with the ones we detected. 99 99 ; Primary reason is to support dynamic overlay feature in the future. Second reason 100 ; is a hack to get Windows 95 load proper IDE drivers.100 ; is a hack to get Windows 95 to load its built-in protected mode IDE driver. 101 101 ; 102 102 ; The Windows hack has two parts. First part is to try to alter CMOS address 12h as that … … 109 109 110 110 %ifdef USE_AT ; FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES is for AT builds only 111 112 %ifdef MODULE_WIN95_CMOS_HACK 113 mov dl, HARD_DISK_TYPES 114 call CMOS_ReadFromIndexInDLtoAL 115 test al, 0F0h 116 jnz SHORT .ClearBdaDriveCount ; CMOS byte 12h is ready for Windows 95 117 call CMOS_Verify10hTo2Dh ; Can we modify CMOS? 118 jnz SHORT .ClearBdaDriveCount ; Unsupported BIOS, use plan B 119 120 ; Now we can alter CMOS location 12h. Award BIOS locks if we set drive 0 type to Fh 121 ; (but accept changes to drive type 1). Windows 95 requires that the drive 0 type is 122 ; non zero and ignores drive 1 type. So if we only set drive 1, then Award BIOS 123 ; won't give problems but Windows 95 stays in MS-DOS compatibility mode. 124 ; 125 ; For Award BIOSes we could set the Drive 0 type to 1 and then clear the BDA drive count. 126 ; So essentially we could automatically do what user needs to do manually to get Windows 95 127 ; working on Award BIOSes. However, I think that should be left to do manually since 128 ; there may be SCSI drives on the system or FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES could 129 ; be intentionally cleared and forcing the dummy drive might cause only trouble. 130 131 ; Try to detect Award BIOS (Seems to work on a tested 128k BIOS so hopefully 132 ; there will be no need to scan E000h segment) 133 mov cx, 65536 - 4 134 mov eax, 'Awar' ; Four characters should be enough 135 mov di, 0F000h ; Scan 64k starting from segment F000h 136 mov fs, di ; No need to preserve FS since we set it to zero soon when we boot 137 xor di, di 138 .ScanNextCharacters: 139 cmp [fs:di], eax 140 je SHORT .ClearBdaDriveCount ; Award detected, cannot modify CMOS 141 inc di ; Increment offset by one character (not four) 142 loop .ScanNextCharacters 143 144 ; Now it should be safe to write 145 mov dl, HARD_DISK_TYPES 146 mov al, 0F0h ; Drive 0 type 16...47 (supposed to be defined elsewhere in the CMOS) 147 call CMOS_WriteALtoIndexInDL 148 call CMOS_StoreNewChecksumFor10hto2Dh 111 %ifdef MODULE_WIN95_CMOS_HACK 112 mov dl, HARD_DISK_TYPES 113 call CMOS_ReadFromIndexInDLtoAL 114 test al, 0F0h 115 jnz SHORT .ClearBdaDriveCount ; CMOS byte 12h is ready for Windows 95 116 call CMOS_Verify10hTo2Dh ; Can we modify CMOS? 117 jnz SHORT .ClearBdaDriveCount ; Unsupported BIOS, use plan B 118 119 ; 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 95 requires that the drive 0 type is 121 ; non zero and ignores drive 1 type. So if we only set drive 1, then Award BIOS 122 ; won't give problems but Windows 95 stays in MS-DOS compatibility mode. 123 ; 124 ; 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 95 126 ; 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_DRIVES could 128 ; be intentionally cleared and forcing the dummy drive might cause only trouble. 129 130 ; Try to detect Award BIOS (Seems to work on a tested 128k BIOS so hopefully 131 ; there will be no need to scan E000h segment) 132 mov cx, 65536 - 4 133 mov eax, 'Awar' ; Four characters should be enough 134 mov di, 0F000h ; Scan 64k starting from segment F000h 135 mov fs, di ; No need to preserve FS since we set it to zero soon when we boot 136 xor di, di 137 .ScanNextCharacters: 138 cmp [fs:di], eax 139 je SHORT .ClearBdaDriveCount ; Award detected, cannot modify CMOS 140 inc di ; Increment offset by one character (not four) 141 loop .ScanNextCharacters 142 143 ; Now it should be safe to write 144 mov dl, HARD_DISK_TYPES 145 mov al, 0F0h ; Drive 0 type 16...47 (supposed to be defined elsewhere in the CMOS) 146 call CMOS_WriteALtoIndexInDL 147 call CMOS_StoreNewChecksumFor10hto2Dh 149 148 .ClearBdaDriveCount: 150 %endif; MODULE_WIN95_CMOS_HACK149 %endif ; MODULE_WIN95_CMOS_HACK 151 150 152 151 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES 153 152 jz SHORT .ContinueInitialization 154 mov BYTE [es:BDA.bHDCount], 0 ; Set hard disk count to zero153 mov BYTE [es:BDA.bHDCount], 0 ; Set hard disk count to zero 155 154 .ContinueInitialization: 156 %endif 157 158 mov cx, [RAMVARS.wDrvCntAndFlopCnt] 155 %endif ; USE_AT 156 157 mov cx, [RAMVARS.wDrvCntAndFlopCnt] ; Our count of hard disks 159 158 mov al, [es:BDA.bHDCount] 160 add [es:BDA.bHDCount], cl ; Add our drives to the system count161 or al, 80h ; Or in hard disk flag162 mov [RAMVARS.bFirstDrv], al ; Store first drive number159 add [es:BDA.bHDCount], cl ; Add our drives to the system count 160 or al, 80h ; Or in hard disk flag 161 mov [RAMVARS.bFirstDrv], al ; Store first drive number 163 162 164 163 .AddFloppies: … … 170 169 dec ch 171 170 mov al, ch 172 js .NoFloppies ; if no drives are present, we store 0ffh171 js SHORT .NoFloppies ; If no drives are present, we store 0FFh 173 172 174 173 call FloppyDrive_GetCountFromBIOS_or_BDA … … 242 241 ;-------------------------------------------------------------------- 243 242 .ReadAtaInfoFromHardDisk: 244 mov si, BOOTVARS.rgbAtaInfo ; ES:SI now points to ATA info location243 mov si, BOOTVARS.rgbAtaInfo ; ES:SI now points to ATA info location 245 244 push es 246 245 push si … … 255 254 ; Fall to .ReadAtapiInfoFromDrive 256 255 257 .ReadAtapiInfoFromDrive: ; Not yet implemented258 ;call ReadAtapiInfoFromDrive ; Assume CD-ROM256 .ReadAtapiInfoFromDrive: ; Not yet implemented 257 ;call ReadAtapiInfoFromDrive ; Assume CD-ROM 259 258 ;jnc SHORT _CreateBiosTablesForCDROM 260 259
Note:
See TracChangeset
for help on using the changeset viewer.