Changeset 593 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
- Timestamp:
- Jun 30, 2018, 8:27:04 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r589 r593 95 95 ; FindDPT_ForDriveNumber will not find any drives that are ours. 96 96 ; 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 load proper IDE drivers. 101 ; 102 ; The Windows hack has two parts. First part is to try to alter CMOS address 12h as that 103 ; is what Windows 95 driver reads to detect IDE drives. Altering is not possible on all 104 ; systems since CMOS has a checksum but it's location is not standardized. We will first 105 ; try to detect valid checksum. If it succeeds, then it is safe to assume this system 106 ; 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 95 works 108 ; 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 112 %ifdef MODULE_WIN95_CMOS_HACK 113 mov dl, HARD_DISK_TYPES 114 call CMOS_ReadFromIndexInDLtoAL 115 test al, al 116 jnz SHORT .ContinueInitialization ; CMOS byte 12h is ready for Windows 95 117 call CMOS_Verify10hTo2Dh 118 jnz SHORT .ClearBdaDriveCount ; Unsupported BIOS, use plan B 119 120 ; Now we can alter CMOS location 12h 121 mov dl, HARD_DISK_TYPES 122 mov al, 0F0h ; Drive 0 type 16...47 but Windows doesn't care as long as this is not zero 123 call CMOS_WriteALtoIndexInDL 124 call CMOS_StoreNewChecksumFor10hto2Dh 125 %endif 126 127 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES 128 jz SHORT .ContinueInitialization 129 .ClearBdaDriveCount: 130 mov BYTE [es:BDA.bHDCount], 0 ; Set hard disk count to zero 131 .ContinueInitialization: 132 %endif 133 97 134 mov cx, [RAMVARS.wDrvCntAndFlopCnt] ; Our count of hard disks 98 135 mov al, [es:BDA.bHDCount]
Note:
See TracChangeset
for help on using the changeset viewer.