Changeset 598 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src


Ignore:
Timestamp:
Jul 13, 2018, 10:23:54 AM (6 years ago)
Author:
Tomi Tilli
Message:

Windows 95 CMOS hack broke on last commit. Windows 95 DID require that CMOS byte 12h had drive 0 set. Drive 1 was not enough. Now there is detection for Award BIOSes and the CMOS hack won't be applied on those.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r597 r598  
    113113        mov     dl, HARD_DISK_TYPES
    114114        call    CMOS_ReadFromIndexInDLtoAL
    115         test    al, al
    116         jnz     SHORT .ContinueInitialization   ; CMOS byte 12h is ready for Windows 95
     115        test    al, 0F0h
     116        jnz     SHORT .ClearBdaDriveCount       ; CMOS byte 12h is ready for Windows 95
    117117        call    CMOS_Verify10hTo2Dh             ; Can we modify CMOS?
    118118        jnz     SHORT .ClearBdaDriveCount       ; Unsupported BIOS, use plan B
    119119
    120         ; Now we can alter CMOS location 12h. Important! We set type for drive 1
    121         ; (primary slave) and not for drive 0! Award BIOS locks if we set drive 0 type to Fh.
    122         ; We cannot set it to less either since that will fully set predefined hard drive type to the BIOS.
    123         ; Windows 95 only cares that the CMOS location 12h is non-zero.
     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
    124145        mov     dl, HARD_DISK_TYPES
    125         mov     al, 0Fh ; Drive 1 type 16...47 (defined elsewhere in the CMOS)
     146        mov     al, 0F0h    ; Drive 0 type 16...47 (supposed to be defined elsewhere in the CMOS)
    126147        call    CMOS_WriteALtoIndexInDL
    127148        call    CMOS_StoreNewChecksumFor10hto2Dh
Note: See TracChangeset for help on using the changeset viewer.