VOGONS


DIY Bios Modding guide Jan Steunebrink k6-2+/3+ 128gb

Topic actions

Reply 460 of 462, by Oerg866

User metadata
Rank Member
Rank
Member

Hello Jan,

thank you very much for your input!

Oh shoot, I knew I forgot something:

    ORG offset CODECAVE_ROMCopyright1
AMDCheck5x86:
; Previous condition holds true, so in case we land here from there
; skip our ammended checks
jz short AMDCheck5x86_Exit

cmp ax, 04E0h ; 4E0 = 5x86 Write Through
jnz short AMDCheck5x86_Not5x86_WT
mov dh, 030h ; 4x multi, Green CPU
jmp short AMDCheck5x86_SetID

AMDCheck5x86_Not5x86_WT:
cmp ax, 04F0h ; 4F0 = 5x86 Write Back
jnz short AMDCheck5x86_Exit
mov dh, 038h ; 4x multi, Green CPU, Write Back

AMDCheck5x86_SetID:
mov dl, ((CPU_5X86_STRING_TABLE_INDEX * 2) OR 081h)

AMDCheck5x86_Exit:
call CMOS_ApplyCPUFeatureBits
retn

CODECAVE_ROMCopyright1 = $

This should properly distinguish between WB and WT now. For the sake of keeping the effort to a minimum, I will refrain from overwriting other bits for now 😁

Best
Eric

EDIT:

Hidden menu item @ F4A37: STANDARD CMOS SETUP / Daylight Saving
Hidden menu item @ F58D6: BIOS FEATURES SETUP / Virus Warning
Hidden menu item @ F596C: BIOS FEATURES SETUP / Boot Up Floppy Seek
Hidden menu item @ F599E: BIOS FEATURES SETUP / Boot Up System Speed
Hidden menu item @ F5A66: BIOS FEATURES SETUP / System BIOS Shadow
Hidden menu item @ F5AE3: BIOS FEATURES SETUP / E0000-E7FFF Shadow
Hidden menu item @ F5AFC: BIOS FEATURES SETUP / E8000-EFFFF Shadow
Hidden menu item @ F6236: CHIPSET FEATURES SETUP / MA Drive Capacity
Hidden menu item @ F629A: CHIPSET FEATURES SETUP / DRAM Write Burst
Hidden menu item @ F62B3: CHIPSET FEATURES SETUP / Slow Refresh
Hidden menu item @ F62CC: CHIPSET FEATURES SETUP / Hidden Refresh
Hidden menu item @ F62E5: CHIPSET FEATURES SETUP / Internal Cache WB/WT
Hidden menu item @ F637B: CHIPSET FEATURES SETUP / Fast Reset Emulation
Hidden menu item @ F6394: CHIPSET FEATURES SETUP / Fast Reset Latency
Hidden menu item @ F63AD: CHIPSET FEATURES SETUP / Latch Local Bus
Hidden menu item @ F63C6: CHIPSET FEATURES SETUP / Local Bus Ready
Hidden menu item @ F63DF: CHIPSET FEATURES SETUP / Memory Hole Size
Hidden menu item @ F63F8: CHIPSET FEATURES SETUP / DMA Clock
Hidden menu item @ F6411: CHIPSET FEATURES SETUP / Memory Relocation
Hidden menu item @ F683B: POWER MANAGEMENT SETUP / PM Mode
Hidden menu item @ F6854: POWER MANAGEMENT SETUP / Break Switch
Hidden menu item @ F6903: POWER MANAGEMENT SETUP / Auto Doze
Hidden menu item @ F6935: POWER MANAGEMENT SETUP / Auto Standby

This BIOS has a lot of hidden options. That is inexcusable behavior and needs to be rectified immediately.

Reply 461 of 462, by Oerg866

User metadata
Rank Member
Rank
Member

If anyone wants to test it, my mod BIOS for the SY-025L is available here, provisionally, because everything may be broken 😀 we'll see

https://github.com/oerg866/TRW-BiosMods/tree/main/SOYO_025L

@Jan:

By the way, my notes are available here: https://github.com/oerg866/TRW-BiosMods/wiki/ … x-hacking-notes

Growing that document is a very slow process because doing is more fun than documenting. :^)

Reply 462 of 462, by Oerg866

User metadata
Rank Member
Rank
Member

Hello again!

Sorry for the spam 😀

But I think I found another slight bug in this BIOS.

The option for Internal Cache WB/WT is tied to a menu callback for the Chipset Features Setup page:

BIOS_F:5E28                 MenuItemCallback <offset stru_F62E5, offset loc_F675E>

That function is a little weird:

BIOS_F:675E MenuChipsetSetup_HandleInternalCacheWBWT: ; DATA XREF: BIOS_F:5E28↑o
BIOS_F:675E cmp al, 55h ; 'U'
BIOS_F:6760 jz short loc_F6770
BIOS_F:6762 call MenuChipsetSetup_CMOSIsWBCPU_Buggy
BIOS_F:6765 jz short loc_F6772
BIOS_F:6767 cmp al, 14h
BIOS_F:6769 jz short loc_F6770
BIOS_F:676B call DisableMenuItem
BIOS_F:676E stc
BIOS_F:676F retn

The function this calls goes like this:

BIOS_F:8E94 MenuChipsetSetup_CMOSIsWBCPU_Buggy proc near
BIOS_F:8E94 ; CODE XREF: BIOS_F:6762↑p
BIOS_F:8E94 ; sub_F8DAD+15↑p ...
BIOS_F:8E94 mov al, 0BDh
BIOS_F:8E96 call ReadCMOSByte_2
BIOS_F:8E99 and al, 7Eh
BIOS_F:8E9B nop
BIOS_F:8E9C nop
BIOS_F:8E9D cmp al, 24h ; '$'
BIOS_F:8E9F jz short locret_F8EAB
BIOS_F:8EA1 cmp al, 26h ; '&'
BIOS_F:8EA3 jz short locret_F8EAB
BIOS_F:8EA5 cmp al, 16h
BIOS_F:8EA7 jz short locret_F8EAB
BIOS_F:8EA9 cmp al, 18h
BIOS_F:8EAB
BIOS_F:8EAB locret_F8EAB: ; CODE XREF: MenuChipsetSetup_CMOSIsWBCPU_Buggy+B↑j
BIOS_F:8EAB ; MenuChipsetSetup_CMOSIsWBCPU_Buggy+F↑j ...
BIOS_F:8EAB retn
BIOS_F:8EAB MenuChipsetSetup_CMOSIsWBCPU_Buggy endp

This has some hardcoded CPU IDs that CMOS 3F is checked against, which obviously doesn't work well for us now.

I propose this change:

    ORG offset MenuChipsetSetup_CMOSIsWBCPU_Buggy
mov al, 0BFh
call ReadCMOSByte
and al, 08h
cmp al, 08h
retn

This reads CMOS byte 3F instead of 3D and then checks if the WB bit is set.

At least on my 5x86, this works correctly and reveals the menu item when the CPU is ran in WB mode.

Do you agree roughly with this finding / idea?

Thanks a ton!
Eric