Jump to content

Sysprep WinXP SP2 64-bit on pure UEFI - V3


reboot12

Recommended Posts

My target PC spec:

  • MB ASUS P8H61-M LE R2, bios version 1408 (CSM disbaled, AHCI enabled)
  • CPU Sandy Bridge i3
  • HDD 2.5" SATA 60GB
  • graphics card iGPU Intel HD2000 with GOP firmware connecting to the monitor via DVI-HDMI cable
  • integrated network card Realtek 8111F Gigabit LAN Controller

Please note that my PC has full support for WinXP 64-bit but for a newer PC that do not have support for WinXP 64-bit you need to use a modified acpi.sys and/or ported AHCI/NVMe/USB drivers

Reference PC:

Host: ThinkPad X61, WinXP SP2 64-bit, VMware Workstation 8

Guest: WinXP SP2 64-bit:

  • HW version default 8
  • 2 CPU or 1 CPU with 2 cores
  • RAM 1GB
  • HDD IDE 2GB
  • CD/DVD IDE
  • optional network card e1000 for make disk image over network

Necessary things:

  • graphics card with GOP firmware - no need drivers for WinXP 64-bit
  • original image ISO WinXP SP2 64-Bit, e.g. en_win_xp_pro_x64_with_sp2_vl_x13-41611.iso
  • pendrive with Win7, 8 or 10 installer for disk partition by diskpart (I use Macrium Reflect WinPE based)
  • SATA-USB case/adapter or software to make backup/restore disk image over network with added network and disk drivers of target PC (I use Macrium Reflect WinPE based)
  • signed and extracted WinXP 64-bit drivers Intel SATA controller located in the target PC
  • patched by FlashBoot 3.2 64-bit bootmgfw.efi 6.1.7601.17514 (win7sp1_rtm.101119-1850) to work in 1024x768
    or
    patched by FlashBoot 3.3n 64-bit bootmgfw.efi 11.1.7601.26316 (win7sp1_ldr_escrow.221214-1727) to work in native display resolution (developer of FlashBoot changed the version of the file from 6.1 to 11.1 so Windows 10/11 updates don't overwrite the file)
  • wgl4_boot.ttfwinload.efi (patched by me) from beta 64-bit Windows Server 2008 Longhorn 6001.16497
  • BOOTICE v1.3.3 x64
  • VMware Workstation 8.0.2 build-591240

Instead of a SATA-USB adapter, you can use Linux or other software to make backup/restore a disk image over the network:

  • Linux that supports UEFI and have network card drivers of target PC and mount.cifs command
  • Macrium Reflect Free 8.0.7279 not for commercial use based on WinPE with added disk and network driver of target PC - I build on the basis of WinPE 3.1 (Win7) changing loader to FlashBoot 3.3n. This program detects disk geometry and correctly restores the image to another disk on target PC:
    disk-geometry.png
    I used Acronis True Image 2021 for this before but I always had to fix options ApplicationDevice & OSDevice in BCD because there was a error loading winload.efi - it seems that 0xc0000225

Step-by-step instruction:

  • in VMware, create a WinXP Pro 64-bit machine - select Custom (advanced) - after create remove Floppy, USB Controller, Sound Card and Printer:
    vmware-machine.png
    Note! Despite the lack of FDD drive in the machine configuration, it will appear in WinXP. To prevent this, you need to turn off the FDD in the VMware bios. Run machine with Power On to BIOS then set:
    Main > Legacy Diskette A: [Disabled]
    Advanced > I/O Device Configuration > Floppy disk controller [Disabled]
  • start the machine from ISO e.g. Win7 and partition the disk with diskpart (press Shift+F10 to run CMD):
    diskpart
    sel disk 0
    create par pri size=100
    create par pri
    active
    exit
  • install WinXP SP2 64-bit (ESC to enter VMware Boot Menu and select boot from CD-ROM Drive) and press any key to boot from CD
    - select C: Partition2 [Unknown] 1947 MB and format to NTFS
    select-partition-for-install.png
    - enter your Regional and Language settings, add & set your Default input language and select Turn off advanced input text services
    - enter Name and Organization
    - enter Product Key
    - enter Administrator password
    - select your Time Zone
    - in Network Settings select Custom settings and uninstall QoS
  • after installation log in to Administrator account, add an account with administrator privileges (no password) then restart the system - after restart, OS automatic use this account
  • disable page file, system restore and automatic restart in System Properties - do not restart system
  • format the D: partition (100MB) as FAT32
  • set disk labels C: to OS and D: to Boot
  • run diskmgmt.msc (Win+r) and change drive letter D: to U:
  • turn off the machine, make a copy of the .vmdk file with WinXP installed
  • in VMware go to File > Map Virtual Disks... and Map... your WinXP .vmdk file, select Volume 100 MB, uncheck Open file in read-mode only (recommended) then copy EFI folder from my archive flashboot_SATA.zip to mapped disk and Disconnect
  • map .vmdk again in the same way but this time choosing a 1.9 GB volume then copy files:
    - into Drivers\SATA copy your unpacked (signed) SATA drivers and rename .inf file to iaAHCI.inf or change string iaAHCI.inf in C:\Sysprep\sysprep.inf to appropriate name your SATA .inf driver, also change PCI Vendor Device ID to your SATA controller:
    [SysprepMassStorage]
        PCI\VEN_XXXX&DEV_YYYY&CC_0106 = "C:\Drivers\SATA\iaAHCI.inf", "C:\Drivers\SATA"
    - copy all folders (without EFI) and files from my archive flashboot_SATA.zip to the mapped disk to appropriate locations then Disconnect
    Note: My sysprep.inf file have Polish Regional, Language and Input settings! - please adapt to your language.
  • start WinXP 64-bit vm machine and perform actions in this order:
    - run C:\Program Files\Bootice\BOOTICEx64.exe then open BCD in Professional mode and change ApplicationDevice and OSDevice <UnknownDevice> to C: then close app
    - run 1_hidden_U.reg - hiding U: drive
    - run 2_display_del.bat - deletes display.inf and display.PNF files to prevent try install vgapnp.sys driver by vga service
    - run 3_vga_del.reg - deletes vga service to prevent try install vgapnp.sys driver
    - run 4_VIDEO_del.reg - deletes random GUID's e.g. created by vga service during installation WinXP SP2 64-bit in VMware
    - run 5_23A_1024_768.reg - adds 23A... GUID for VgaSave service work in 1024x768 together with bootmgfw.efi patched by FlashBoot 3.2 (EFI\Boot\bootx64.efi)
    (instead of FlashBoot 3.2, you can use 3.3n to work in native display resolution - use same 23A_1024x768.reg file for this)
    - run regedit and Export key HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices to C:\UC.reg (because sysprep.exe in next step removes this key)
    - open CMD and run command mountvol to see GUID's volumes - they should be three volumes U: C: E:
    - right click on UC.reg, select Edit then delete data for E: \\??\\Volume and \\DosDevices\\ - only data for U: and C: is to be
    edited-UC-reg.png
    - run C:\Sysprep\sysprep.exe, click OK, select Shutdown mode: Quit, click Reseal and OK
    - wait for the window Sysprep is working ... disappear
    - run C:\UC.reg to add to registry only volumes U: and C:
    - turn off machine and close VMware

At this point, I use Macrium Reflect ISO which I make a disk image in VMware - just don't let the machine boot from the hard drive where you have sealed WinXP - hit Esc quickly and select CD-ROM from the Boot Menu
and Macrium Reflect USB flash drive to restore image on the target computer:
restore.png

Instead of Macrium, you can use a method with the SATA-USB adapter and Linux:

  • 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)
  • mount the Debian 9 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 CD-ROM from the Boot Menu
  • now check sda drive parameters - read Units bytes and last cylinder sda2 partition - should be 8225280 & 261 and clone sda WinXP machine drive to connected real sdb drive (this will take a few minutes):
    fdisk -l -u=cylinders
    dd if=/dev/sda of=/dev/sdb bs=8225280 count=261
  • power off Debian, close VMware, safe remove USB connected SATA HDD and disconnect the drive from the SATA-USB adapter
  • connect the SATA drive with sealed WinXP to your target computer (me ASUS), boot to UEFI bios, set disk controller operation mode to AHCI, disable CSM and reboot from this HDD

The system will be implemented that lasts about 1-2 minutes:
winload.png sysprep1.png sysprep2.png sysprep3.png

and after the restart we have working WinXP SP2 64-bit in pure UEFI :thumbup
uc.png deployed-xp.png

P.S. Please test and report. PM for flashboot_SATA.zip

Note1! Always reseal fresh system installation - use a .vmdk copy about which I wrote so as not to install the system from scratch!

Note2! Don't install VMware Tools !!! - because they install vmci, vmmouse, vmx_svga services and are launched even after uninstalling the tools. Then deploying the system does not work and hangs on the aurora boot screen with discoloration - I checked in WinDbg then BSOD 7E Probably caused by : ntkrnlmp.exe

*** Fatal System Error: 0x0000007e

(0xFFFFFFFFC0000005,0xFFFFF80001C3235D,0xFFFFFADFCA80F340,0xFFFFFADFCA80ED50)

Probably caused by : ntkrnlmp.exe ( nt!IoReportHalResourceUsage+260d )
                       

I fixed the problem by removing these services in ControlSet001\Services use WinPE > Regedit > Load Hive (C:\WINDOWS\system32\config\system) on target PC HDD

Edited by reboot12
Link to comment
Share on other sites

  • reboot12 changed the title to Sysprep WinXP SP2 64-bit on pure UEFI - V3

Explanation of how the screen works in WinXP SP2 64-bit

Before I wrote the guide sysprep V3, I tested the WinXP SP2 64-bit installation in Legacy mode with various graphics cards. Depending on the graphics card (her VBIOS), WinXP SP2 64-bit Legacy boots either on the vgapnp.sys (vga service) or on the vga.sys (VgaSave service):

  • AMD HD7450 PCIe - vga.sys
  • Intel iGPU HD2000 integrated CPU - vgapnp.sys
  • VMware 8 - vgapnp.sys

On pure UEFI with FlashBoot AMD HD7450 always use vga.sys and work after sysprep if set 23A GUID 1024x768 but iGPU Intel HD2000 always use vgapnp.sys and after sysprep V2 have no desktop screen - stay only aurora bootscreen because in regedit in Hardware Profiles key GUID no have display parameters:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO\GUID...

vga service (vgapnp.sys) is problematic because make always random, unknown GUID in Hardware Profiles

VgaSave service (vga.sys) has always same GUID {23A77BF7-ED96-40EC-AF06-9B1F4867732A} in Hardware Profiles

In sysprep V3 I forced the system to always start on VgaSave services (vga.sys) in 1024x768 using FlashBoot 3.2 or 3.3n patched bootmgfw.efi from Win7 SP1 - to do this you have to do:

  • delete display.inf and vga service to block the system trying to install vgapnp.sys graphics driver and prevent make random unknown GUID
  • delete any random GUID created by the vga service during installation WinXP SP2 64-bit in VMware
  • add 23A GUID 1024x768 for VgaSave service
Edited by reboot12
Link to comment
Share on other sites

  • 1 month later...
On 10/22/2023 at 12:31 AM, reboot12 said:

Explanation of how the screen works in WinXP SP2 64-bit

Before I wrote the guide sysprep V3, I tested the WinXP SP2 64-bit installation in Legacy mode with various graphics cards. Depending on the graphics card (her VBIOS), WinXP SP2 64-bit Legacy boots either on the vgapnp.sys (vga service) or on the vga.sys (VgaSave service):

  • AMD HD7450 PCIe - vga.sys
  • Intel iGPU HD2000 integrated CPU - vgapnp.sys
  • VMware 8 - vgapnp.sys

On pure UEFI with FlashBoot AMD HD7450 always use vga.sys and work after sysprep if set 23A GUID 1024x768 but iGPU Intel HD2000 always use vgapnp.sys and after sysprep V2 have no desktop screen - stay only aurora bootscreen because in regedit in Hardware Profiles key GUID no have display parameters:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO\GUID...

vga service (vgapnp.sys) is problematic because make always random, unknown GUID in Hardware Profiles

VgaSave service (vga.sys) has always same GUID {23A77BF7-ED96-40EC-AF06-9B1F4867732A} in Hardware Profiles

In sysprep V3 I forced the system to always start on VgaSave services (vga.sys) in 1024x768 using FlashBoot 3.2 or 3.3n patched bootmgfw.efi from Win7 SP1 - to do this you have to do:

  • delete display.inf and vga service to block the system trying to install vgapnp.sys graphics driver and prevent make random unknown GUID
  • delete any random GUID created by the vga service during installation WinXP SP2 64-bit in VMware
  • add 23A GUID 1024x768 for VgaSave service

Instead of deleting the display.inf file, rename it to display.inf.old to prevent the installation. I prefer methods that only disable and do not remove the files and services in case of problems (for backup purposes).

Edited by UsefulAGKHelper
Link to comment
Share on other sites

On 10/22/2023 at 12:31 AM, reboot12 said:

Explanation of how the screen works in WinXP SP2 64-bit

Before I wrote the guide sysprep V3, I tested the WinXP SP2 64-bit installation in Legacy mode with various graphics cards. Depending on the graphics card (her VBIOS), WinXP SP2 64-bit Legacy boots either on the vgapnp.sys (vga service) or on the vga.sys (VgaSave service):

  • AMD HD7450 PCIe - vga.sys
  • Intel iGPU HD2000 integrated CPU - vgapnp.sys
  • VMware 8 - vgapnp.sys

On pure UEFI with FlashBoot AMD HD7450 always use vga.sys and work after sysprep if set 23A GUID 1024x768 but iGPU Intel HD2000 always use vgapnp.sys and after sysprep V2 have no desktop screen - stay only aurora bootscreen because in regedit in Hardware Profiles key GUID no have display parameters:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO\GUID...

vga service (vgapnp.sys) is problematic because make always random, unknown GUID in Hardware Profiles

VgaSave service (vga.sys) has always same GUID {23A77BF7-ED96-40EC-AF06-9B1F4867732A} in Hardware Profiles

In sysprep V3 I forced the system to always start on VgaSave services (vga.sys) in 1024x768 using FlashBoot 3.2 or 3.3n patched bootmgfw.efi from Win7 SP1 - to do this you have to do:

  • delete display.inf and vga service to block the system trying to install vgapnp.sys graphics driver and prevent make random unknown GUID
  • delete any random GUID created by the vga service during installation WinXP SP2 64-bit in VMware
  • add 23A GUID 1024x768 for VgaSave service

Btw I realized that in the vgapnp.sys and VGA.sys windows 7 generic drivers, they're still the same because the vgapnp.sys (from win 7) I have for XP has vga.sys as internal filename and has same size as the vga.sys file.

Link to comment
Share on other sites

21 hours ago, UsefulAGKHelper said:

Btw I realized that in the vgapnp.sys and VGA.sys windows 7 generic drivers, they're still the same because the vgapnp.sys (from win 7) I have for XP has vga.sys as internal filename and has same size as the vga.sys file.

That's why I wrote that you don't need any VGA files from Win7.

Link to comment
Share on other sites

  • 2 weeks later...

@reboot12 Have you tested it with FlashBoot 3.3p too?

	Changelog
	Jun, 24 of 2023 Minor update 3.3p released.
	Hardware compatibility improvements for "Windows 7 installation to the modern computers" feature.
	Starting from this version, VGA emulation patch for UEFI loader skips GOP video modes which are advertised by UEFI firmware but do not fit into the firmware-allocated framebuffer. This fixes black screen problem for recent nVidia GPUs whose UEFI Option ROM truncates UEFI GOP framebuffer to 1024x768 but leaves higher-resolution video modes in the UEFI GOP mode table.
	

Link to comment
Share on other sites

@reboot12 Regarding your solution of always using vga.sys at first deployment, you can also change the service in your video driver by changing the Service string to the name of VgaSave from Vga inside the enum key, to the key that matches that hardware ID of the driver (change permissions in the Enum key to edit the contents inside the Enum key).

If the installation of any driver has removed the service needed by that driver (due to inf errors etc), the keys can be added to the key matching your hardware ID (assuming that the service was present but didn't integrate properly in the driver's enumeration entry) to prevent future errors in the respective driver (as you see in your enum key, the keys match the hardware IDs of the driver you're looking for). For example, I use vbemp legacy vga driver (as the VgaSave service instead of the ms vgasave) and it's always loaded on the device manager without errors. I disabled pnp vbemp (to prevent delay at bootscreen) and I used only the non-pnp vbemp driver that is named vga.sys.

y1wLDj4.png

Edited by UsefulAGKHelper
Link to comment
Share on other sites

  • 2 weeks later...
On 12/9/2023 at 10:18 PM, UsefulAGKHelper said:

to prevent future errors in the respective driver

I don't understand what future errors ???

There will never be any errors. You implement the WinXP in my way (FlashBoot + vga.sys) and then you can install the right driver - if you have for WinXP using the Device Manager.

Anyway the correct graphics card driver can also be implemented immediately using sysprep - see my instruction SysprepV2

Copy driver files to the Drivers\Video folder and add the path in the sysprep.inf file in OemPnPDriversPath:

;SetupMgrTag
[Unattended]
    OemSkipEula=Yes
    OemPnPDriversPath=Drivers\Chipset;Drivers\Video
    ConfirmHardware=No
    DriverSigningPolicy=Ignore
    OEMPreinstall=Yes
    UpdateInstalledDrivers=Yes

When I wrote the instruction SysprepV2, I did not know that there was a loader FlashBoot.

P.S. In WinXP 32-bit there is no such thing as the vga service and vgapnp.sys driver - there is only VgaSave service and vga.sys driver. In WinXP 64-bit Microsoft has unnecessarily added the vga service which introduces only confusion.

Edited by reboot12
Link to comment
Share on other sites

16 hours ago, reboot12 said:

I don't understand what future errors ???

There will never be any errors. You implement the WinXP in my way (FlashBoot + vga.sys) and then you can install the right driver - if you have for WinXP using the Device Manager.

Anyway the correct graphics card driver can also be implemented immediately using sysprep - see my instruction SysprepV2

Copy driver files to the Drivers\Video folder and add the path in the sysprep.inf file in OemPnPDriversPath:

;SetupMgrTag
[Unattended]
    OemSkipEula=Yes
    OemPnPDriversPath=Drivers\Chipset;Drivers\Video
    ConfirmHardware=No
    DriverSigningPolicy=Ignore
    OEMPreinstall=Yes
    UpdateInstalledDrivers=Yes

When I wrote the instruction SysprepV2, I did not know that there was a loader FlashBoot.

P.S. In WinXP 32-bit there is no such thing as the vga service and vgapnp.sys driver - there is only VgaSave service and vga.sys driver. In WinXP 64-bit Microsoft has unnecessarily added the vga service which introduces only confusion.

By errors I can also mean things not working they way they should like the display freezing but the OS still loading.

Btw, I am only talking about XP x64 on UEFI x64.

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...