Jump to content

Sysprep WinXP SP2 64-bit on pure UEFI PC (no CSM)


Recommended Posts

Necessary things:

  • graphics card with GOP firmware and drivers for WinXP 64-bit - I tested only one AMD HD7450
  • en_win_xp_pro_x64_with_sp2_vl_x13-41611.iso
  • Win7, 8 or 10 ISO image for disk partition by diskpart
  • SATA-USB case/adapter
  • signed Intel SATA controller drivers for WinXP 64-bit
  • signed AMD HD7450 drivers for WinXP 64-bit
  • UefiSeven 1.3.0 64-bit loader
  • efi files from beta 64-bit Windows Server 2008 Longhorn 6001.16497 (patched winload.efi)
  • BOOTICE v1.3.3 x64
  • Debian Live 6 x86
  • VMware Workstation 8

Target PC spec:

  • MB ASUS P8H61-M LE R2 (CSM disbaled, AHCI enabled)
  • CPU Sandy Bridge i3
  • HDD 2.5" SATA (tested with 60GB)
  • Graphics Card AMD HD7450 with GOP

Reference PC with VMware Workstation 8 installed (I use ThinkPad X61 with WinXP 64-bit :-) ) spec:

  • Virtual Machine WinXP Pro 64-bit
  • HW 5.x
  • CPU amount 2
  • RAM 1024MB
  • HDD IDE 3GB
  • CD/DVD IDE

Step-by-step instruction:

  • in VMware, create a WinXP Pro 64-bit machine:
    vm_spec.png.004163bf5f1a0a50aed14f2f75d91c9f.png
  • start the machine from ISO e.g. Win7 and partition the disk with diskpart:
    diskpart
    sel disk 0
    clean
    create par pri size=100
    create par pri
    active
    exit
  • install WinXP SP2 64-bit on partition 2 C: (format NTFS)
  • after installation, disable page file, system restore and automatic restart in System Properties
  • add an account with administrator privileges and restart the system to work with this account
  • format the D: partition (100MB) as FAT32
  • shut down the machine, close VMware, make a copy of the .vmdk file with WinXP installed (so as not to reinstall if something goes wrong)
  • start the machine and copy the necessary files to the appropriate locations - I have these files in the sysprep_V2.iso image, which I made with the UltraISO program:
    EFI directory with UefiSeven loader and BCD copy to FAT32 partition
    Sysprep dir
    with the appropriate sysprep.inf file copy to C:
    Drivers dir copy to C:
    winload.efi file copy to C:\WINDOWS\system32
    BOOTICEx64.exe copy to C:
  • run BOOTICE, click BCD tab, open file D:\EFI\Microsoft\Boot\BCD (Professional mode) and edit the values ApplicationDevice and OSDevice by setting the C: partition:
    bootice_edit.png.db7583a926edf1de6969e70b648da912.png
  • enable hidden files, remove display.inf from C:\WINDOWS\Inf
  • run regedit and delete services vga and VgaSave from HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  • run sysprep.exe from C:\Sysprep, select Quit and click Reseal and OK:
    sysprep_quit_reseal.png.f85ec722801ba06096eb9251a4383417.png
  • shutdown machine and close VMware
  • using a SATA-USB adapter, connect the target SATA 2.5 drive to the computer where you have VMware installed
  • start VMware and add this disk to the WinXP configuration as PhysicalDrive1 (Use entire disk):
    physical_drive1.png.a003fd58eeaa4f98d1a6ae8abc15c732.png physical_hdd.png.8011761457bbb0363447fc0bed550d59.png
  • mount the Debian ISO image and boot the WinXP machine from it - just don't let the machine boot from the hard drive where you have sealed WinXP - hit Esc quickly and select CDROM from the Boot Menu:
    vmware_bootmenu.png.cdb31b2874e4f9bd349cc7d40ad47c0d.png
  • now clone sda WinXP machine drive to connected real sdb drive (this will take a few minutes):
    fdisk -l (read Units bytes from sda drive and last cylinder sda2 partition - should be 8225280 & 392)
    fdisk_sda.png.a0667837834fb14570b928e452ad1310.png
    dd if=/dev/sda of=/dev/sdb bs=8225280 count=392
  • poweroff Debian, close VMware, Safe remove USB connected SATA HDD and disconnect the drive from the SATA-USB adapter
  • boot target computer (my ASUS) to bios and set disk controller operation mode to AHCI, disable CSM and disable integrated iGPU
  • connect the SATA drive with sealed WinXP to your target computer (me ASUS) and boot the computer from it

Aurora green wallpaper will appear, after about 1 minute the computer should restart and we have a working WinXP 64-bit on pure UEFI :hello:

aurora_uefi.thumb.png.a11809ce3d78ac59fa423eb63ec4796a.png

P.S. Who wants the sysprep_V2.iso image please write a private message.

Edited by reboot12
Link to comment
Share on other sites


@reboot12 If you use VGA emulator like FlashBootPro/UefiSeven, then it's no longer required to disable VGA. In fact, windows won't even display the screen if vga.sys/vgapnp.sys are disabled even if VGA emulator is used.

VGA-only drivers should be disabled only when VGA emulator is absent.

I can boot xp x64 from VirtualBox EFI using FlashBoot bootmgfw.efi and xp vga.sys with GUI boot disabled as long as the VGA emulator inside bootmgfw.efi is present.

UefiSeven works as well, but you can also see the BSOD on FlashBootPro bootmgfw.efi (on UefiSeven, BSOD doesn't show at all on CSM-disabled UEFI).

Edited by UsefulAGKHelper
Link to comment
Share on other sites

9 hours ago, George King said:

Is signed driver requirement only for winload.efi Driver signature enforcement problem?

Signed drivers AHCI, graphics etc. must be for sysprep.exe:

Note If the OEM-supplied drivers are not digitally signed, the mini-setup wizard postpones the installation of the device until an administrator logs on to the computer. This is referred to as client-side versus server-side installation, which occurs during mini-setup.

Link to comment
Share on other sites

6 hours ago, UsefulAGKHelper said:

If you use VGA emulator like FlashBootPro/UefiSeven, then it's no longer required to disable VGA. In fact, windows won't even display the screen if vga.sys/vgapnp.sys are disabled even if VGA emulator is used.

VGA-only drivers should be disabled only when VGA emulator is absent.

I have to check it again.

6 hours ago, UsefulAGKHelper said:

I can boot xp x64 from VirtualBox EFI using FlashBootPro bootmgfw.efi and xp vga.sys with GUI boot disabled as long as the VGA emulator inside bootmgfw.efi (generated by FlashbootPro or UefiSeven) is present.

Virtual machines operate differently from a real computer with pure UEFI and a graphics card that has a GOP. Virtual machines are not suitable for pure UEFI testing. UEFI in VirtualBox is not pure UEFI because legacy graphic bios is used in this mode:

vbox.png.09b8ce88905fc7158aa8f61916055ce8.png

Legacy VGA ROM in memory C0000: 55 AA 40 (40h*200=8000h=32768 bytes=32KB)

c0000.zip

 Qemu with OVMF pure UEFI bios use VGA emulator similar to UefiSeven:

000C0000   56 45 53 41 00 03 22 00 00 C0 01 00 00 00 27 00   VESA..".......'.
000C0010   00 C0 30 00 00 00 2B 00 00 C0 30 00 00 C0 3D 00   ..0...+...0...=.
000C0020   00 C0 51 45 4D 55 00 F1 00 FF FF 4F 56 4D 46 00   ..QEMU.....OVMF.
000C0030   51 45 4D 55 20 51 58 4C 20 56 47 41 00 4F 56 4D   QEMU QXL VGA.OVM
000C0040   46 20 49 6E 74 31 30 68 20 28 66 61 6B 65 29 00   F Int10h (fake).
000C0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
000C0060   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
Edited by reboot12
Link to comment
Share on other sites

15 hours ago, UsefulAGKHelper said:

VGA-only drivers should be disabled only when VGA emulator is absent.

That's not true. vga and VgaSave services must be disabled otherwise it will be the error 50 that caused the vga.sys file:

	
Microsoft (R) Windows Debugger Version 6.11.0001.404 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
	Opened \\.\com3
Waiting to reconnect...
Connected to Windows Server 2003 3790 x64 target at (Thu Aug 11 07:39:01.106 2022 (GMT+2)), ptr64 TRUE
Kernel Debugger connection established.
Symbol search path is: *** Invalid ***
****************************************************************************
* Symbol loading may be unreliable without a symbol search path.           *
* Use .symfix to have the debugger choose a symbol path.                   *
* After setting your symbol path, use .reload to refresh symbol locations. *
****************************************************************************
Executable search path is:
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntkrnlmp.exe -
Windows Server 2003 Kernel Version 3790 MP (1 procs) Free x64
Built by: 3790.srv03_sp2_rtm.070216-1710
Machine Name:
Kernel base = 0xfffff800`01800000 PsLoadedModuleList = 0xfffff800`019d5100
System Uptime: not available
	
Intel Storage Driver Ver: 11.2.0.1006
	
*** Fatal System Error: 0x00000050
                       (0xFFFFF800000C0200,0x0000000000000000,0xFFFFF80001CA664D,0x0000000000000000)
	Break instruction exception - code 80000003 (first chance)
	A fatal system error has occurred.
Debugger entered on first try; Bugcheck callbacks have not been invoked.
	A fatal system error has occurred.
	*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntkrnlmp.exe -
*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************
	Use !analyze -v to get detailed debugging information.
	BugCheck 50, {fffff800000c0200, 0, fffff80001ca664d, 0}
	*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
***** Kernel symbols are WRONG. Please fix symbols to do analysis.
	*** ERROR: Module load completed but symbols could not be loaded for mssmbios.sys
*************************************************************************
***                                                                   ***
***                                                                   ***
***    Your debugger is not using the correct symbols                 ***
***                                                                   ***
***    In order for this command to work properly, your symbol path   ***
***    must point to .pdb files that have full type information.      ***
***                                                                   ***
***    Certain .pdb files (such as the public OS symbols) do not      ***
***    contain the required information.  Contact the group that      ***
***    provided you with these symbols if you need this command to    ***
***    work.                                                          ***
***                                                                   ***
***    Type referenced: nt!_KPRCB                                     ***
***                                                                   ***
*************************************************************************
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for hal.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for VIDEOPRT.SYS -
*** ERROR: Module load completed but symbols could not be loaded for vga.sys
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for win32k.sys -
*** ERROR: Module load completed but symbols could not be loaded for vga.dll
*************************************************************************
***                                                                   ***
***                                                                   ***
***    Your debugger is not using the correct symbols                 ***
***                                                                   ***
***    In order for this command to work properly, your symbol path   ***
***    must point to .pdb files that have full type information.      ***
***                                                                   ***
***    Certain .pdb files (such as the public OS symbols) do not      ***
***    contain the required information.  Contact the group that      ***
***    provided you with these symbols if you need this command to    ***
***    work.                                                          ***
***                                                                   ***
***    Type referenced: nt!_KPRCB                                     ***
***                                                                   ***
*************************************************************************
*************************************************************************
***                                                                   ***
***                                                                   ***
***    Your debugger is not using the correct symbols                 ***
***                                                                   ***
***    In order for this command to work properly, your symbol path   ***
***    must point to .pdb files that have full type information.      ***
***                                                                   ***
***    Certain .pdb files (such as the public OS symbols) do not      ***
***    contain the required information.  Contact the group that      ***
***    provided you with these symbols if you need this command to    ***
***    work.                                                          ***
***                                                                   ***
***    Type referenced: nt!_KPRCB                                     ***
***                                                                   ***
*************************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
Probably caused by : vga.sys ( vga+56d9 )
	Followup: MachineOwner
---------
	nt!DbgBreakPointWithStatus:
fffff800`01826db0 cc              int     3
	

Link to comment
Share on other sites

2 hours ago, jaclaz said:

As a side note, the same is/was true for Windows 7, vga.sys needs to be disabled:

http://reboot.pro/index.php?showtopic=21108

It is an old thread, without using other tools, possibly the VGA emulators talked about change the situation.

jaclaz

Without VGA emulator, GOP native driver needs to be installed, vga output should be disabled from bcd and services (vga.sys/vgapnp.sys should be disabled).

With VGA emulator, this isn't the case on Windows 7 because I can run windows 7 x64 from uefi class 3 as long as I have VGA emulator enabled and vga.sys/vgapnp.sys enabled (even on safe mode).

I prefer to run VGA emulator with vga output enabled In order to be able to use safe mode and see a visible BSOD in case of issues.

Edited by UsefulAGKHelper
Link to comment
Share on other sites

@UsefulAGKHelper

First of all, GOP is not a Windows driver, but the UEFI firmware of the graphics card.

Second - not every graphics card and its driver for WinXP 64-bit works in pure UEFI with UefiSeven + winload.efi loader from beta Longhorn 2008

Third - WinXP can run under pure UEFI with UefiSeven and installed graphics driver and running vga and VgaSave services, but for Sysprep it is necessary to disable these services because at this point there is no graphics driver installed yet.

Sysprep installs the graphics card driver and only after restart WinXP works under pure UEFI. At this point it doesn't matter if vga and VgaSave services are started or not. It doesn't matter anymore.

Sysprep is necessary because you will not normally install WinXP from a CD/USB in UEFI mode.

Edited by reboot12
Link to comment
Share on other sites

@reboot12 Well George King has managed to implement your advice on a test iso (which you probably received already) by adding comamnds inside XP2ESD iso (inside boot.wim on setup.cmd to remove vgapnp.sys/vga.sys services (including display.inf) while using vga.sys/vgapnp.sys files are still intact and present in system32/drivers because if the drivers are not listed in services, windows wouldn't even be able to use the vga drivers even if they are present).

He has tried to backport MSBDD basicdisplay.sys drivers and said that it won't even work on Windows 7, let alone Windows XP.

The mistake with the code is that vga drivers will be removed even on legacy mode so there will be added an "if" command to ensure that the code works on uefi mode only.

Edited by UsefulAGKHelper
Link to comment
Share on other sites

21 minutes ago, UsefulAGKHelper said:

The mistake with the code is that vga drivers will be removed even on legacy mode so there will be added an "if" command to ensure that the code works on uefi mode only.

I'm only interested in WinXP SP2 64-bit in pure UEFI mode.

If the UEFI BIOS of the motherboard has CSM mode (Legacy), you do not need to use other loaders. Then NTLDR and NTDETECT.COM operates normally.

Please do not post in this topic on legacy WinXP and create your own topic on the forum.

I can help with legacy but not on this topic.

Edited by reboot12
Link to comment
Share on other sites

@reboot12

Ok I get now.

Anyway, i think something should be done to 16497 winload.efi so that at least we can see the BSOD when trying to boot XP from pure UEFI (with the scope of making those errors visible so that we can know how to solve them more easily). On windows 7/vista with pure uefi, BSOD can be seen while using FlashBootPro bootmgfw.efi on pure UEFI so maybe there's some hex code in 16497 kernel that allows bootvid to display.

If we can find that necessary code, then maybe bootivid and kernel dependencies from 16497 winload.efi can be removed using hex editor or disassembler to allow XP bootvid to display in order for the XP kernel to work properly on UEFI BCD.

Edited by UsefulAGKHelper
Link to comment
Share on other sites

@UsefulAGKHelper

To see BSOD just run debug mode in BCD, connect RS232 cable to other PC and run WinDbg. I've figured it out a some time ago, both in laptops with an RS232 ExpressCard and in desktops with an RS232 PCIe card (old Win-Raid forum):

winraid.thumb.png.95666e1766b1abf2a81a6bb8c5711977.png

and also on wincert.net:

https://www.wincert.net/forum/topic/18477-i-am-looking-for-a-pcie-card-for-winxp-debugging/

Edited by reboot12
Link to comment
Share on other sites

@reboot12 Welp, I have one computer so idk how to make XP x64 run on my Coffee Lake laptop.

Perhaps backporting system-type device generic drivers from Windows 7 and 8 (using NTOSKRNL EMU extender from github) that XP lacks may allow XP x64 to depend less on CSM just like windows 7 and Windows 8, perhaps maybe even allowing XP to run on new hardware with 8th core processors and beyond. If this doesn't work, then still I wouldn't be able to explain which specific drivers cause Windows 7 x64 to boot from Uefi Class 3 on modern hardware that would allow XP x64 to also work.

For more information about my hardware, here are the specs (maybe from the hardware IDs, we can backport the system-type generic drivers that would allow to run XP on my hardware etc):

DxDiag.txt

Edited by UsefulAGKHelper
Link to comment
Share on other sites

  • 5 weeks later...

@reboot12 I found something bizzare when running modified XP installation from XP2ESD-based iso on pure uefi with FlashBootPro on real hardware.

On serviwin I have noticed that a lot of critical drivers were enabled and disabled while XP was booting with the freezing screen.

The Auto-Sysprep software from XP2ESD has managed to change the service drivers even tho there's no display. Because of XP2ESD ported generic drivers, the OS may be able to boot but even with UefiSeven/Flashboot present, xp videoprt.sys, vga.sys and vgapnp.sys still doesn't show the screen on XP on modern hardware even while these VGA emulators are used.

If the problem I have is the same you have (error 50) then maybe I should try to use vbemp files by renaming vga files to see if vbemp really works on 8th gen hardware (and higher) on UEFI class 3 along with FlashBoot bootmgfw.efi.

Edited by UsefulAGKHelper
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...