Windows XP · VMware · QEMU

Windows XP on an Apple M4, from VMware to 3Dfx Voodoo2 SLI

The converted disk matched the original byte for byte. The BIOS still reported a read error. Once XP booted, we used the same installation to find out whether a second emulated Voodoo2 would make Quake II faster on the M4.

Six stacked disk layers lead to a single disk layer on a virtual PC display.
The base VMDK and its five snapshots became one bootable disk for QEMU.
A disk read error occurred
The first boot from the converted disk stopped here, before Windows loaded.

I remembered the Athlon 64 3000+ that ran this VMware Workstation image sixteen years ago. It had 2 GB of RAM and a Radeon 9200 SE. When the archive turned up on an external SSD, the first question was which of those details XP needed to see again. Its VMware configuration recorded one virtual CPU, 1 GiB of RAM, virtual hardware version 7 and a legacy BIOS. Its last session had ended in suspend. On the M4 we wanted a cold boot, so we started with the disk.

Six files for one disk

The base VMDK held an earlier version of the machine. Five successive snapshots held writes made since then. Together they presented about 40 GB of disk space to Windows. We followed the parent links from the newest snapshot back to the base and checked that QEMU could read each layer.

Our first extractor, 7-Zip, reported Unsupported Method on the solid RAR. On the Mac, unar could read it. The commands use xp-lab as an example name. Set the archive path to your RAR and use the member directory and filenames printed by lsar. Keep the extracted files under their original names so each snapshot can find its parent. Start in a new working directory on a volume with room for the extracted chain and a second disk. The six VMDKs alone came to about 50.5 GB.

archive="/path/to/xp-lab.rar"
brew install unar
lsar "$archive"
unar -D -o extracted "$archive" 'xp-lab/*.vmx' 'xp-lab/*.vmsd' 'xp-lab/*.vmdk'
cd extracted/xp-lab
grep -Ei '^(ide0:0\.(present|fileName)|virtualHW.version|memsize|checkpoint.vmState) *=' xp-lab.vmx

ide0:0.fileName in the VMX named the disk attached when the VM was suspended. Ours was xp-lab-000005.vmdk. Its descriptor named 000004 as its parent and recorded the content ID it expected to find there. The numbers in the filenames were a hint. The parent links and matching IDs told us which files belonged together.

Three example sectors in different VMDK grains. A dot means the layer inherits that sector. Read down each column from the active snapshot until a value appears.

We checked that chain from two directions. Our inspector reads VMware's descriptors. QEMU can independently list the files it opens to satisfy a read from the active disk. Save the Ruby version of our inspector in the extracted directory. inspect.rb

On the first pass, the inspector remembers the disk capacity. At each parent it checks both the capacity and the content ID promised by the child. A mismatch stops the inspector before it reports a usable chain.

disk = descriptor(directory, name)
raise "Wrong parent: #{name}" if expected_id && disk[:cid] != expected_id
capacity ||= disk[:bytes]
raise "Capacity changed at #{name}" unless disk[:bytes] == capacity

Run the first three commands below to identify the active disk and choose a new output filename. Our inspector ended with 6 layers, 40353223680 bytes. Compare its list with qemu-img info --backing-chain. If the order agrees all the way to the base, run the parenthesized block. Giving convert the newest snapshot makes QEMU read through all five parents.

ruby inspect.rb xp-lab.vmx
leaf="xp-lab-000005.vmdk"
disk="xp-lab.qcow2"
qemu-img info -f vmdk --backing-chain "$leaf"
# Use a new destination. convert creates the output disk.
( set -e
test ! -e "$disk"
qemu-img convert -p -f vmdk -O qcow2 "$leaf" "$disk"
qemu-img check -f qcow2 "$disk"
qemu-img compare -p -f vmdk -F qcow2 "$leaf" "$disk"
qemu-img info "$disk"
)

check catches broken QCOW2 metadata, such as an inconsistent cluster allocation. A structurally valid image could still contain an older snapshot. compare opens the active VMDK with all its parents and compares the bytes XP would read against the new disk.

Images are identical. The new QCOW2 had no backing file. That let us leave the snapshot chain and saved memory in the archive. It also gave us a useful clue when the new VM failed to boot.

How we ran UTM's copy of qemu-img on the Mac

Our UTM installation bundled QEMU 10.0.12's image tool as a framework. We used this small C launcher to load its entry point. If you already have a working qemu-img on your path, the commands above use it directly. To use our launcher, download the source into the current directory and run the following before conversion. qemu-img.c

mkdir -p tools
cc qemu-img.c -Wl,-rpath,/Applications/UTM.app/Contents/Frameworks -o tools/qemu-img
export PATH="$PWD/tools:$PATH"
qemu-img --version

The disk geometry that let XP boot

On the M4, UTM runs QEMU to emulate the x86 PC that XP expects. We registered the VM through UTM's AppleScript interface. For the same setup in the app, choose Create a New Virtual Machine → Emulate → Other, skip the installer ISO and save. With the VM stopped, remove the empty disk created by the wizard and use Drives → Import to attach the verified QCOW2 as the first IDE disk. These were our settings for the boot test.

The UTM configuration behind the first boot attempt
Setting Value we used
System x86_64 architecture, pc machine, phenom CPU, 2 cores, 1024 MiB
QEMU UEFI boot off, hypervisor off, force multicore on
Machine properties x-south-bridge=piix4-isa,vmport=on
Devices IDE hard disk, PS/2 input, vmware-svga display, network off

With those settings the boot stopped at A disk read error occurred. Old boot code can ask the BIOS for a sector by cylinder, head and sector number (CHS). Since the disk bytes already matched, we tried changing the numbers that described them. QEMU let us set both the geometry of the IDE device and the smaller geometry exposed through the legacy BIOS.

Disk geometry used for the successful boot
Interface Cylinders Heads Sectors per track
IDE disk 16,383 16 63
Legacy BIOS 1,024 16 63

We supplied those values and disabled automatic CHS translation with ide-hd.bios-chs-trans=none. In the stopped VM, open QEMU settings and add these arguments under Additional Arguments. Each row below shows an option and its value. UTM stores them as separate argument entries.

-global ide-hd.cyls=16383
-global ide-hd.heads=16
-global ide-hd.secs=63
-global ide-hd.bios-chs-trans=none
-global ide-hd.lcyls=1024
-global ide-hd.lheads=16
-global ide-hd.lsecs=63

We started the same disk again. This time XP reached the desktop. The cylinder counts above belong to this image. A different VMware disk can need different geometry.

Timing two and four cores

XP recognized all four cores when we enabled them. It also took over two and a half minutes to reach the desktop. We used a pre-cleanup clone to compare three configurations. For each one we timed a single startup and ran the same single-threaded VBScript arithmetic test three times.

We made the tuning clone after shutting down the working guest. On macOS the UTM CLI accepts a display name. In the example below, set vm to the name printed by utmctl list for your working copy.

ctl=/Applications/UTM.app/Contents/MacOS/utmctl
vm="XP lab"
"$ctl" list
"$ctl" status "$vm"
# Once status is stopped:
"$ctl" clone "$vm" --name "XP benchmark clone"

With the clone stopped between runs, we changed System → CPU and core count, left force multicore enabled, then cold-booted it. We timed from UTM startup to the first visible XP desktop. Once in XP we ran cscript //nologo D:\XPBENCH.VBS from our maintenance CD. The script used XP's built-in VBScript interpreter. Here is the workload that produced the table. XPBENCH.VBS

Option Explicit
Dim run, i, x, s, started, elapsed
WScript.Echo "XPBENCH BEGIN"
For run = 1 To 3
    started = Timer
    s = 0
    For i = 1 To 2500000
        x = Sqr(i)
        s = s + x
    Next
    elapsed = Timer - started
    If elapsed < 0 Then elapsed = elapsed + 86400
    WScript.Echo "XPBENCH " & run & " " & FormatNumber(elapsed, 2, -1, 0, 0)
Next
WScript.Echo "XPBENCH DONE"

Each pass sums the square roots of the integers from 1 to 2,500,000 on one guest thread. Timer measures elapsed seconds inside XP. We took the middle of the three script times. The desktop column comes from a separate host-side observation, one cold boot per setting.

Elapsed time on the test clone, in seconds
Emulated CPU vCPUs Time to desktop Median script time
Phenom 4 156.6 11.42
Phenom 2 104.5 8.06
UTM default (Skylake-Client) 2 102.5 8.75

Reducing the Phenom to two cores cut 52 seconds from the observed startup. Skylake reached the desktop two seconds earlier still. The two-core Phenom finished the script fastest, so we kept it and set memory to 1.5 GiB.

On an M4, QEMU's Tiny Code Generator translates the guest's x86 instructions into Arm instructions. Multiple emulated CPUs also have to synchronize shared state. We measured the combined effect on this XP installation. The timings alone do not tell us how much time went into synchronization.

Keeping the USB controllers in their PCI slots

Once XP could boot, we replaced VMware's emulated desktop adapter with qxl-vga in the stopped VM. We kept dynamic resolution off and added a removable IDE CD drive for the drivers. Our guest tools ISO contained XP-specific drivers for QXL and the VirtIO serial controller. On the Mac, this command lists both sets of installation files.

tar -tf utm-guest-tools.iso | grep -Ei 'Drivers/(qxl|vioserial)/xp/x86/.*\.inf$'

We put the driver files on small maintenance ISOs. An equivalent route is to mount the guest tools ISO in UTM's CD drive, run devmgmt.msc inside XP, open the display adapter and choose Update Driver → Install from a list or specific location → Have Disk. Point it at D:\Drivers\qxl\xp\x86\qxl.inf. Our INF reported version 5.1.0.10018. Repeat for the VirtIO serial controller with D:\Drivers\vioserial\xp\x86\vioser.inf. The paths use the CD letter assigned on our guest. Reboot, select 1024 × 768 in Display Properties, and check which driver XP actually loaded.

sc query qxl
wmic path Win32_VideoController get Name,CurrentHorizontalResolution,CurrentVerticalResolution

XP shipped with a driver for the Ensoniq ES1370 sound card. Adding that card brought back the hardware wizard for four USB controllers. QEMU had assigned the card a PCI address automatically, shifting the controllers to addresses XP had never seen. Our first attempt to set a global address property stopped QEMU from starting. Giving the card its own explicit device argument put it in a spare slot.

In UTM we removed the automatically generated sound device, then appended these two option/value pairs to our existing geometry arguments. Slot 0x0c was free on this machine.

-audiodev spice,id=xp-audio
-device ES1370,audiodev=xp-audio,addr=0x0c

The first argument creates the SPICE audio backend and gives it the name xp-audio. The second exposes an ES1370 sound card to XP, connects it to that backend and fixes its PCI address. That last field was the part that kept the USB controllers in place.

With the controllers back at their previous addresses, we selected XP's own %WINDIR%\inf\wdma_ens.inf for the sound card in Device Manager and rebooted. The hardware wizard stayed away. These guest commands show the sound-device status and list any devices with outstanding configuration codes. We had deliberately disabled the unused firmware configuration device and an old Hamachi adapter.

wmic path Win32_SoundDevice get Name,Status
wmic path Win32_PnPEntity where "ConfigManagerErrorCode<>0" get Name,ConfigManagerErrorCode

The present-device scan returned PRESENT 111 OK 109 DISABLED 2 PROBLEMS 0. Code 22 identified the two devices we had disabled.

What XP still loaded at Welcome

XP reached Welcome and then sat there. The installation still loaded Avira, SUPERAntiSpyware and ATI Catalyst software from its life on the old PC. We removed those packages on the offline guest, trimmed Java, Google and Adobe startup items, and set Windows Update to manual. We timed the combined changes.

VMware Tools 8.1.4 presented a different problem. Its uninstaller checked for a VMware host, and the machine now ran under QEMU. We backed up the cached installer package, skipped its VM_CheckRequirements action during removal and let Windows Installer remove the drivers and files.

For the antivirus and Catalyst cleanup, our helper looked up each vendor's registered uninstall command. We ran it from the XP maintenance CD as an administrator and selected the graphics-only removal in the ATI utility. The second helper looked up the installed VMware Tools product code and cached MSI on that machine. Both scripts are included here. To reproduce the CD on macOS, save the two files in an empty service-cd directory and build the ISO. XPCLEAN.VBS / VMSVC.VBS

hdiutil makehybrid -iso -joliet -o XP-maintenance.iso service-cd

Mount that ISO in UTM. In an XP administrator command prompt, run each line separately and finish each vendor dialog before continuing.

cscript //nologo D:\XPCLEAN.VBS list
cscript //nologo D:\XPCLEAN.VBS avira
cscript //nologo D:\XPCLEAN.VBS super
cscript //nologo D:\XPCLEAN.VBS ati
cscript //nologo D:\VMSVC.VBS audit

On our 8.1.4 package the audit found exactly one VM_CheckRequirements row in InstallExecuteSequence. After the normal uninstall had failed on that check, we ran the version-specific workaround below on the backed-up VM. The helper saves the original MSI, sets that one row's condition to 0, then calls msiexec /x with verbose logging. It attempts to restore the cached MSI if removal fails.

cscript //nologo D:\VMSVC.VBS remove VM_CheckRequirements
cscript //nologo D:\VMSVC.VBS audit

During removal, the installer showed zero seconds remaining while its verbose log kept recording work on shared runtime components. We waited for VMWARE UNINSTALL EXIT 0. The second audit then returned VMWARE TOOLS ABSENT.

A 49.7-second boot to the XP desktop

Back on the working VM, we timed a cold boot before and after removing the old software. With the same two-core Phenom configuration, the desktop appeared after 108.7 seconds before cleanup and 49.7 seconds afterward with the maintenance disc ejected. About seven seconds of the latter boot went into the Welcome screen. Notepad opened in 4.6 seconds.

Cold boot to the desktop on the same two-core Phenom VM. Cleanup cut the observed wait by 59 seconds.

That gave us a usable XP desktop with QXL graphics. We compacted this working disk before cloning it for the Voodoo experiments.

Getting 12.2 GiB back on the Mac

Free space inside XP and free space on the Mac told different stories. NTFS reported 14.68 GiB free. The QCOW2 still occupied 32.4 GiB because it retained blocks XP had once written. On a read-only copy we found a 1.5 GiB hibernation file and about 271 MiB of removable caches outside Firefox. Inside XP we disabled hibernation, stopped the update services, cleared the inventoried directories and shut down. These are the guest commands for part of that cleanup.

powercfg /hibernate off
if not exist C:\hiberfil.sys echo HIBERNATION FILE ABSENT
net stop wuauserv
net stop bits
del /a /f /s /q "C:\WINDOWS\SoftwareDistribution\Download\*"
del /a /f /s /q "C:\WINDOWS\Temp\*"
shutdown -s -t 0

With XP stopped we exported the standalone QCOW2 as raw, compared it with the source, then made an APFS clone of the raw file. The clone gave us a place to release blocks while preserving the original for comparison. Here $disk is the full path to the installed QCOW2 inside the stopped UTM bundle. The following commands show what the Ruby driver does in its working directory. The complete driver and its invocation are below.

qemu-img convert -f qcow2 -O raw "$disk" original.raw
qemu-img compare -f qcow2 -F raw "$disk" original.raw
cp -c original.raw work.raw

Between conversions we read the NTFS allocation bitmap. We punched holes in work.raw only for complete, aligned 64 KiB blocks whose underlying 4 KiB NTFS clusters were all free. A second pass compared both raw files and checked every changed block against the original bitmap. This step accounts for most of the space recovered. The two conversions alone would also copy stale contents from free clusters.

qemu-img convert -f raw -O qcow2 work.raw compact.qcow2
qemu-img check compact.qcow2
qemu-img compare -f raw -F qcow2 work.raw compact.qcow2

One NTFS bitmap bit describes one 4 KiB cluster. A zero bit means XP can reuse that cluster. The partition on this disk starts at sector 63, so an NTFS cluster boundary and a 64 KiB QCOW2 boundary can fall at different offsets. Rounding a free range inward leaves a little space on the table and keeps both ends inside the free range.

The Ruby version reads the bitmap from the original raw export using the Sleuth Kit's icat. It then checks each changed block against that same bitmap. Here is the test from disk.rb. Subtracting the partition start converts a byte offset in the disk image into an offset inside NTFS. Dividing the cluster number by eight locates its bitmap byte, and the remainder selects its bit.

def free_block?(offset)
  return false if offset < @start || offset + BLOCK > @limit
  first = (offset - @start) / CLUSTER
  last = (offset + BLOCK - 1 - @start) / CLUSTER
  (first..last).all? { |i| (@bitmap.getbyte(i / 8) & (1 << (i % 8))).zero? }
end

For example, a 64 KiB block beginning at disk byte 327,680 covers NTFS clusters 72 through 88 on this image. Both edge clusters overlap the block only partly. We check all 17 bits. During verification we also require the replacement block to read back entirely as zeroes. If a changed block falls outside the partition or overlaps even one occupied cluster, verification stops and reports its disk offset.

Each character inside a cluster represents one 512-byte sector. The marked sectors belong to the same 64 KiB block. Even the single sector in cluster 88 makes its allocation bit count.
Run the Ruby compaction and verification

Save compact.rb and disk.rb together on an APFS volume with room for the raw export and compacted image. The driver runs the shell conversions shown above as well as the bitmap step. Start here in a fresh directory if you want to reproduce the whole procedure. It creates a fresh xp-compaction directory for its outputs. It uses Ruby 3 or later, qemu-img on your path, and icat from the Sleuth Kit. The space figures come from the original recovery. This Ruby version repeats its allocation and verification checks.

brew install sleuthkit
ctl=/Applications/UTM.app/Contents/MacOS/utmctl
"$ctl" list
# Example bundle and disk names. Substitute yours.
library="$HOME/Library/Containers/com.utmapp.UTM/Data/Documents"
bundle="$library/XP lab.utm"
disk="$bundle/Data/xp-lab.qcow2"
vm_id=$(plutil -extract Information.UUID raw -o - "$bundle/config.plist")
"$ctl" status "$vm_id"
ruby compact.rb "$disk" "$vm_id"

The driver matches the disk and UUID to the same UTM bundle, checks that the VM is stopped, and verifies the disk layout. The helper reads NTFS metadata from a single MBR partition of type 7, checks that the NTFS dirty flag is clear and extracts its allocation bitmap. After the raw-file check, qemu-img compare reads the compacted QCOW2 against the verified raw copy. Success prints Images are identical. and the output path. The installed disk stays in place while you inspect the result.

The compacted QCOW2 compared equal to work.raw. We had separately checked that every block changed from original.raw belonged entirely to NTFS free space. With XP shut down, we put the compacted disk in place. Its size on the Mac fell from 32.4 to 20.2 GiB. Inside XP, NTFS reported 16.45 GiB free. The Firefox profile and cache hashes matched the copy we took before cleanup.

A Voodoo2 for Quake II

The first time we ran a 3dfx demo, QEMU counted triangles and buffer swaps. The UTM window stayed black. The distinction had been simpler on a real PC. The primary graphics card drew the Windows desktop, and a Voodoo2 took over the monitor when a game opened Glide, 3dfx's 3D API. We had emulated the second card. We still had to get its picture to the same window as the desktop.

Adding the first Voodoo2 beside QXL

We shut down the recovered VM and cloned its disk. Stock UTM 5.0.8 offered QXL, so we kept it for the desktop and built a separate copy of UTM for the experiment. We ported the Voodoo2 PCI device from 2ksbox, which uses the 86Box rasterizer, to the x86 QEMU backend shipped with that release. The Mac still launched the VM from UTM.

The QEMU source and patch we used

Start in an empty directory with the Voodoo2 port and Metal patch. Apply UTM's QEMU changes first, then copy in the device source and apply our single-card patch. For the two-card build, also apply the SLI patch below before compiling.

git clone -b v5.0.8 --depth 1 https://github.com/utmapp/UTM.git
git clone -b v10.0.12-utm --depth 1 https://github.com/utmapp/qemu.git
git clone https://github.com/Roboport-Tecnologia/2ksbox.git
git -C 2ksbox checkout 7419e4860a8d3169b36f07a20fddff98de27d364
git -C qemu apply ../UTM/patches/qemu-10.0.12-utm.patch
cp -R 2ksbox/voodoo qemu/hw/voodoo
gzip -dc voodoo2-utm.patch.gz > voodoo2-utm.patch
git -C qemu apply --check ../voodoo2-utm.patch
git -C qemu apply ../voodoo2-utm.patch

We configured QEMU against UTM's matching macOS arm64 dependencies, with --target-list=x86_64-softmmu --enable-shared-lib --enable-tcg --enable-spice among the options. In the configured build directory, ninja libqemu-x86_64-softmmu.dylib produced the backend. We packaged it in the experimental app's qemu-x86_64-softmmu.framework and signed that framework and the app for local use. UTM's macOS build notes cover its dependency and signing setup.

In the clone's UTM settings we kept qxl-vga under Display. Under QEMU → Additional Arguments we added the two entries below, one per line. Slot 0x0d was free next to our sound card at 0x0c. The startup log reported a 4 MiB framebuffer and 4 MiB per texture unit.

-device
voodoo2,addr=0x0d,recompiler=off,texmem=4

XP found PCI\VEN_121A&DEV_0002. We mounted the extracted FastVoodoo2 4.0 XP Gold Edition driver files on an IDE CD, including the XP fix for glide3x.dll. Our installer matched voodoo2.inf to that PCI ID through Windows SetupAPI. The equivalent manual route is Device Manager → Update Driver → Have Disk. When XP asked for the installation media again, we pointed it at the extracted driver directory. After the restart we ran this in an XP command prompt. Both the FastVoodoo2 and Red Hat QXL rows returned configuration error code 0.

wmic path Win32_PnPEntity get Name,ConfigManagerErrorCode | findstr /i "FastVoodoo2 QXL"

Getting the frame into UTM

The driver kit came with two versions of the same textured doughnut. We copied the demo directory to XP with its Data folder and ran each executable from that directory.

donut_glide2x.exe -res 640x480 -ref 60
donut_glide3x.exe -res 640x480

The Glide 2 executable returned zero, and the emulator logged texture uploads and frame swaps. That narrowed the black window down to presentation. The Windows QXL driver sent desktop drawing commands through SPICE, the display connection to UTM. Writing Voodoo pixels into a QEMU display surface alone left that connection showing the desktop or a black frame.

Our first fix made the game visible, then stalled on the way back to the larger XP desktop. The working version kept a separate display surface for the Voodoo2 picture, saved the QXL desktop image and sent finished 3D frames to SPICE as bitmap copies. QXL could keep its own dimensions when the game closed. With that change the Glide 3 demo showed the rotating, textured torus. Part of the last frame could still linger until XP repainted it.

Metal handled texture decoding and supported color and depth clears. The 86Box code still rasterized the triangles on the CPU. An offscreen test checked the cleared pixels against a reference, including the pixels just outside the rectangle. During the game the backend logged one of the operations that actually reached the GPU.

voodoo2: texture decode completed on Apple M4 (256 x 256, format 10)

Checking which renderer Quake II loaded

We installed the Quake II demo only after Glide worked. From the demo directory in XP, we selected the OpenGL renderer and the game's bundled 3dfxgl.dll. Mode 3 selected 640 × 480. Logging gave us a way to check which driver had drawn the level after we quit.

quake2.exe +set vid_ref gl +set gl_driver 3dfxgl +set gl_mode 3 ^
  +set vid_fullscreen 1 +set logfile 1 +demomap q2demo1.dm2
findstr /c:"GL_RENDERER:" baseq2\qconsole.log
GL_RENDERER: 3Dfx Interactive Voodoo(tm)
Quake II demo playback in the UTM window, with a soldier across the room and the player's weapon and HUD in view.
The Quake II demo from id Software, running at 640 × 480 in the recovered XP guest. The renderer string came from this game's log.

How two Voodoo2 cards draw one frame

Once Quake II ran on one Voodoo2, we had a way to test a second. On this generation of 3dfx hardware, SLI meant scan-line interleave. Picture a triangle that covers the first four rows of the screen. Both boards receive the triangle. One draws the pixels on rows 0 and 2. Its partner draws rows 1 and 3. The primary reads the rows from the two framebuffers in display order and presents one picture.

Four rows of one triangle, exaggerated so you can see the split. Each # is a pixel. A dot marks a row owned by the other board.

Giving the driver a pair

We added a partner on a second PCI slot and emulated the cable-detect and write-snooping behavior the driver expects. When snooping is enabled, a write addressed to the primary also reaches the partner. To build this version, download the incremental patch beside the single-card patch and run these commands on the Mac, after applying the single-card patch and before building the QEMU framework. SLI and per-board Metal patch

gzip -dc voodoo2-sli-metal.patch.gz > voodoo2-sli-metal.patch
git -C qemu apply --check ../voodoo2-sli-metal.patch
git -C qemu apply ../voodoo2-sli-metal.patch

In the stopped graphics clone, we kept QXL and replaced the single Voodoo2 argument pair with these four UTM entries. sli-role selects primary or partner. threads=1 gives each board one host render worker. The VM still has two emulated Phenom cores for XP. recompiler=on enables the ARM64 renderer for the Voodoo pixel pipeline.

-device
voodoo2,addr=0x0d,sli-role=1,texmem=4,recompiler=on,threads=1
-device
voodoo2,addr=0x0e,sli-role=2,texmem=4,recompiler=on,threads=1

XP reported two healthy FastVoodoo2 devices. Glide exposed one logical rendering target, so counting devices in the game's menu told us little. We wrote red into an even row on one board and green into the next row on its partner. Reading through the primary returned red followed by green. Race, Valley of Ra and Wizard of Tower needed the Arcade Toolbox runtime and a small Glide adapter beside each executable. When a demo passed a null window handle, the adapter supplied its existing XP window and forwarded the call to the vendor DLL. During all three demos, the emulator also recorded interleaving enabled and triangles processed on both boards.

Where Metal enters the picture

Each 12 MiB board has a 4 MiB framebuffer for color and depth. Its two texture mapping units (TMUs) have 4 MiB each. Both boards need the same textures to shade neighboring rows, so a texture uploaded to both occupies space on both. The two boards together have six memory banks. We backed each with a separate shared Metal buffer. Each board has a command queue on the same physical M4 GPU.

Each queue sends two kinds of work to Metal. One kernel decodes eligible textures. Another clears eligible color or depth rectangles. The CPU can address the same buffers. It samples the decoded textures and writes the shaded triangle pixels into the board's rows.

We could check the boundary directly. A test put a different color in each of the four texture banks and decoded them on the M4 GPU. All four colors survived. A second test cleared a rectangle and checked the untouched pixels on either side. The one-row case caught an easy mistake. Clearing an odd row must leave its even neighbor untouched.

Where SLI gained speed

We started each comparison from the same powered-off XP disk and changed the board configuration. Each board had one render worker with the ARM64 pixel recompiler enabled. We kept the same two guest CPU cores, 1.5 GiB of RAM and image quality, disabled audio and ran one VM at a time. Both configurations used memory-mapped writes for the command FIFO, the queue that carries work from XP to the card. The pair needs to observe those writes to keep both boards in step.

For Quake II we played the same 633-frame demo at 800 × 600. Run this in the demo directory in XP and read the first complete score in baseq2\qconsole.log. To repeat the second row, add +set gl_swapinterval 0 before +demomap.

quake2.exe +set vid_ref gl +set gl_driver 3dfxgl +set gl_mode 4 ^
  +set vid_fullscreen 1 +set s_initsound 0 +set logfile 2 ^
  +set timedemo 1 +demomap q2demo1.dm2 +set nextserver quit
One Voodoo2 versus SLI on the Apple M4. Each row uses the same resolution on both sides.
WorkloadOne cardSLIRatio
Quake II, 800 × 600 (fps)41.338.80.94×
Quake II, same demo, swap interval set to 0 (fps)38.336.40.95×
Race, 640 × 480 (swaps/s)47.244.90.95×
Glide blending, 800 × 600 (million pixels/s)252.5449.61.78×

Each game figure comes from one run per configuration on a Mac that was also in use. Race counts 600 Glide buffer swaps after 120 warm-up swaps and waits for queued work to finish at the timing boundaries. Those units tell us how often the game swapped buffers. The display can present them at a different rate.

The last row isolates the work SLI divides. We drew 1,200 translucent layers over the whole screen, 576 million pixel blends per batch. We timed three batches on each setup, waiting for the renderer to finish and keeping buffer swaps outside the timed interval. The median fell from 2.281 to 1.281 seconds. That is where the second board came close to doubling throughput.

Repeat the 800 × 600 Glide pixel test

Download and unpack the pixel test source and build script. On our Apple Silicon Mac, sh build.sh in the extracted directory used Clang, Homebrew LLVM 22 and LLD 22 to build FILL.EXE for 32-bit XP. Inside XP, create C:\GlideLab and run the executable from a command prompt with the working Glide 2 driver available. It warms up with 120 full-screen quads and writes three elapsed times in milliseconds to C:\GlideLab\FillTime.txt.

One card    2281  2281  2360 ms
Two cards   1234  1281  1313 ms

Quake II gave us a clue to the gap. In one five-second sample, each board received the same 17.3 million writes and processed about 301,000 triangles. Only the rows of pixels were divided. The XP game loop, command traffic and triangle setup still took time. In a single-card Race sample, its render worker was waiting for work in 124 of 154 observations. Neither game showed a frame-rate gain in these runs.

Two cars on a bend in the 3dfx Race demo, shown in side-by-side views in the recovered Windows XP guest.
Race running from its XP shortcut in the custom UTM app. The two side-by-side views belong to the demo. Each Voodoo2 drew alternating horizontal rows across both views.

Sources

  1. QEMU's multi-threaded TCG documentation
  2. UTM's Windows guest tools
  3. QEMU's firmware configuration device
  4. Broadcom's note on uninstalling VMware Tools after migration
  5. The 2ksbox Voodoo2 device and 86Box rasterizer used for the port
  6. FastVoodoo2 4.0 XP Gold Edition release notes and installation procedure
  7. Apple's shared storage mode for Metal resources
  8. The 3dfx Arcade Toolbox demos and their Voodoo2 SLI compatibility
  9. 3dfxzone's Windows XP Glide library fix