csmwrap icon indicating copy to clipboard operation
csmwrap copied to clipboard

WinXP SP2 32-bit not work on iGPU

Open Gelip opened this issue 6 months ago • 30 comments

Asus B85M-E, Intel Haswell CPU 4Gen with integrated iGPU graphics card, second graphics card PCIe AMD6450, SATA IDE mode, CSM Disabled, CSMWrap 1.2.1 Disk prepared using diskpart in WinPE 3.1 (Win7) 100MB FAT32 with EFI\Boot\bootx64.efi UEFI Shell and 121.efi (CSMWrap) 10GB NTFS for OS

I'm trying to install original WinXP Pro SP2 32-bit. Installation and OS after install works well with AMD6450 PCIe graphics card using its VBIOS - in CMOS Primary Display: PCIe

Image

Unfortunately, with the Intel Haswell iGPU graphics card it does not work - in CMOS Primary Display iGPU. CSMWrap start, SeaBIOS runs OK - I see a distorted little XP logo for a moment at the top of the screen but hangs on black screen:

Image Image Image Image

If I use the patched Longhorn 5472 loader (bootmgr, winload.exe, BCD in Boot folder) then the system boots up OK on iGPU - I see that SeaVGABIOS is being used - desktop is 800x600 but on monitor is a different resolution and you can see the aurora logo underneath:

Image

but with Longhorn loader stuck on aurora boot screen on AMD6450 but OS work:

Image

Gelip avatar Jun 01 '25 07:06 Gelip

This is actually modesetting issue I mentioned in #3.

FlyGoat avatar Jun 01 '25 12:06 FlyGoat

But why CSMWrap not use legacy VBIOS from iGPU?

PCIe AMD6450 - legacy AMD VBIOS is used iGPU - SeaVGABIOS from CSMWrap is used

Gelip avatar Jun 01 '25 13:06 Gelip

But why CSMWrap not use legacy VBIOS from iGPU?

PCIe AMD6450 - legacy AMD VBIOS is used iGPU - SeaVGABIOS from CSMWrap is used

In this case I think UEFI doesn't expose legacy VBIOS as OpROM image. don't know if there is any alternative way to obtain VBIOS from UEFI.

FlyGoat avatar Jun 01 '25 13:06 FlyGoat

May be, that this is the problem with all graphiks in csmwrap.

@FlyGoat Is there a possibility, that SeaBios looks always for an legacy VGA Option Rom on a graphik card Dietmar

dietmarpapagei1 avatar Jun 01 '25 13:06 dietmarpapagei1

In this case I think UEFI doesn't expose legacy VBIOS as OpROM image.

But motherboard has CSM in BIOS and if Enabled legacy OS'es normal works (without CSMWrap):

Image Image XP see normal OpROM VBIOS from iGPU: Image

Gelip avatar Jun 01 '25 14:06 Gelip

I have no idea about how to obtain VBIOS blob in UEFI... Maybe it's exposed by some protocol instead of PciIo...

FlyGoat avatar Jun 01 '25 14:06 FlyGoat

May be, that this is the problem with all graphiks in csmwrap.

@FlyGoat Is there a possibility, that SeaBios looks always for an legacy VGA Option Rom on a graphik card Dietmar

This is already the current logic. It will try to obtain Legacy VGA ROM and use it if possible, then fallback to SeaBIOSVGA.

However sometimes we don't know how to obtain it, especially for iGPU, if it's not exposed via ROM BAR.

FlyGoat avatar Jun 01 '25 14:06 FlyGoat

@FlyGoat Does it boot XP if the machine is too new to have XP video driver?

ghostplant avatar Jun 02 '25 08:06 ghostplant

@ghostplant It really depends. We have a couple of fallback options, but none of them are working all the time.

FlyGoat avatar Jun 02 '25 08:06 FlyGoat

OK, so standard universal GOP for XP/2003 still remains a problem..

ghostplant avatar Jun 02 '25 10:06 ghostplant

@FlyGoat And does WinXP 32bit work if my machine is UEFI-x64 only?

ghostplant avatar Jun 02 '25 13:06 ghostplant

@ghostplant Yes in most cases. I can't give a universal answer because there are simply too much platform specific issues spanning from hardware to ACPI.

FlyGoat avatar Jun 02 '25 14:06 FlyGoat

That's amazing

ghostplant avatar Jun 02 '25 14:06 ghostplant

@FlyGoat I tested xp32 again with ntldr on iGPU. OS hangs after about 3 min, then in WinDBG error 0x4000008a probably caused by : ntkrpamp.exe and after about 10 min OS restart. I found that VGA Enable on bridge to which the graphics card is connected helps boot with black screen but OS work: https://msfn.org/board/topic/186793-csmwrap-boot-csm-on-uefi-only-systems/page/10/#findComment-1280453 https://msfn.org/board/topic/186793-csmwrap-boot-csm-on-uefi-only-systems/page/10/#findComment-1280449

My bridge is 00 01 00 so for VGA Enable I need this in UEFI Shell: mm 0001003e 8 -pci

Image

Gelip avatar Jun 06 '25 19:06 Gelip

@Gelip I actually have another project to deal with this issue. Just run this in efi shell before CSMWrap.

https://github.com/FlyGoat/vgaarb-efi

FlyGoat avatar Jun 06 '25 22:06 FlyGoat

@FlyGoat Maybe SeaVGABIOS is too new for WinXP. Can you compile CSMWrap using other version SeaVGABIOS e.g. from QEMU e.g. vgabios.bin or vgabios-stdvga.bin:

SeaVGABIOS_QEMU.zip

Gelip avatar Jun 10 '25 10:06 Gelip

@Gelip Nah we are not using stdvga variant of SeaVGABIOS, we are using a special build designed for coreboot. stdvga SeaVGABIOS requires BOCHS DISPI VBE extension, which does not exist on any real hardware, hereby it won't work.

Sorry I'm really busy recently, will try to look into the issue once I get some time.

FlyGoat avatar Jun 10 '25 12:06 FlyGoat

@FlyGoat

we are using a special build designed for coreboot

Now I know why after replacing SeaVGABIOS in the hex editor in csmwrap.efi SeaBIOS does not start - yea I tried replacing in offset 270C0 - 2DEBF in csmwrap.efi 1.2.1

Gelip avatar Jun 10 '25 15:06 Gelip

@Gelip Wouldn't just loading iGPU legacy ROM along with VGA ARB fixes work ? I think sometimes the iGPU legacy ROM extracted from the BIOS is incomplete though (atleast on AMD) and gets initialized correctly by the firmware.

SeaVGABios is going to be buggy because it can't change any actual hardware modes. And afaik think on newer platforms like Alder Lake VGA ARB doesn't work too.

xCuri0 avatar Jun 10 '25 16:06 xCuri0

@FlyGoat In 2013 I build coreboot for Abit BF6. This also build seabios (128KB) in: coreboot\build\seabios\out\bios.bin Can I use this bios in CSMWrap.efi by swapping it in the hex editor in the appropriate offset?

SeaBIOS_coreboot.zip

Gelip avatar Jun 10 '25 16:06 Gelip

@Gelip I would recommend you not to do so. Maybe it's easier just to build the project...

FlyGoat avatar Jun 11 '25 08:06 FlyGoat

@Gelip Why can't you just use extracted iGPU vBIOS ? It's most likely going to just work.

If it comes from another systems BIOS (for example someone found a VBIOS compatible with a pure-UEFI IA32 tablet) then you might have to mess with Intel BMP tool to get it working though.

xCuri0 avatar Jun 11 '25 12:06 xCuri0

Why can't you just use extracted iGPU vBIOS ? It's most likely going to just work.

I extracted and replaced but unfortunately it doesn't work or I did something wrong. Besides, there is no legacy bios for the new iGPUs anyway so all that's left is SeaVGABIOS - it's almost good only it needs to be improved so that in xp, vista, 7 there is an image on the screen on the default loader and vga.sys

P.S. I'm the one who found legacy bios for BayTrail (ValleyView)

Gelip avatar Jun 11 '25 13:06 Gelip

@Gelip

I extracted and replaced but unfortunately it doesn't work or I did something wrong.

Did you recompile CSMWrap ? I don't think u can hex edit because different length.

SeaVGABIOS cbvga is always going to be buggy because it cannot change modes on the GPU so you're stuck with what you had when the UEFI exited. UefiSeven sets the mode to something compatible with Windows 7 to fix this I think, obviously anything that needs mode switching won't work.

You'd have to write a new VGA BIOS for those new iGPUs (so adding support for them in SeaVGABIOS), or maybe if it's possible figure out how to run the GOP driver in an emulated UEFI environment and translate the int10h calls into it but that would be highly complicated.

xCuri0 avatar Jun 11 '25 14:06 xCuri0

@xCuri0 I hex edit. Testing CSMWrap takes me a lot of time. I don't have time to prepare the system for compilation.

Gelip avatar Jun 11 '25 15:06 Gelip

Not going to work unless exact same length

xCuri0 avatar Jun 11 '25 15:06 xCuri0

Yea, using CSMWrap version support loading vgabios.bin from disk now WinXP boot OK using ntldr loader and no black screen :-) https://github.com/FlyGoat/CSMWrap/issues/37#issuecomment-3030665253

Gelip avatar Jul 03 '25 04:07 Gelip

@xCuri0 Why can't you just use extracted iGPU vBIOS ? It's most likely going to just work. If it comes from another systems BIOS (for example someone found a VBIOS compatible with a pure-UEFI IA32 tablet) then you might have to mess with Intel BMP tool to get it working though.

Hi xCuri0, it seem you may have some knowledges about modding VBIOS/VBT via intel BMP, could you help me with this? https://winraid.level1techs.com/t/configuring-a-cherry-view-vbios-via-intel-bmp-to-display-properly-on-built-in-lcd/109361 not sure if it's even possible as seems Cherry View vbios was discontinud by intel :\

xrayer avatar Jul 10 '25 20:07 xrayer

@xrayer if the VBT tables are the exact same size you should be able to just swap them if the different versions isn't an issue. intel_vbt_decode should help you with this to check if the sizes (and other data) are same.

But shouldn't you be able to set the timings and rotation in BMP ?

xCuri0 avatar Jul 11 '25 01:07 xCuri0

Don't remember the exact sizes now but it's definitely bad idea to mix varoius VBT versions. I tried import/export settings via intel BMP according to winraid tutorial but it ended badly, imported setting was unable to save complaining about invalid values etc. So I just copied settings manually between 2 opened BMP windows.

I can't find any menu entry about display rotation, you do? There are some cryptic binary fields for modes that I don't know the detailed structure.

I have also suspection that this kind of vbios may not perform full iGPU initialisation but it may rely on the code in GOP. Because this systems are always designed as UEFI based the could save some effort to strip down vbios code and let GOP do the jop as vbios woud take over later it can use already initialized iGPU. As I have different version of GOP and vbios it may cause some unexpected behavior. Maybe could I downgrade GOP to older version of VBT to have same version as in vbios? No idela, just thinking...

xrayer avatar Jul 11 '25 15:07 xrayer