Files
uv-k5-v3-emulator/work/run-webui.ps1
T
mckero 2667e046e8 Emulator: multiboot slots from the page, flash controller, portable tests
flash controller: store ACR/OPTKEYR instead of swallowing them, which is what stopped the factory bootloader from starting

slots over the firmware's own serial protocol (0x0720 family); uvk5_socket/uvk5_testenv so a fresh checkout skips instead of failing; web UI slot table and Multiboot button; quick start, CONTRIBUTING, and stop tracking firmware images and radio dumps
2026-10-01 14:54:34 +08:00

38 lines
1.8 KiB
PowerShell

# Serve the web remote control.
#
# powershell -File work\run-webui.ps1 # the page starts the emulator
# powershell -File work\run-webui.ps1 -Attach # attach to run-emulator.ps1
#
# Owning the process is what puts the firmware's serial output in the page's log
# pane: the model prints it to stderr as "SERIAL ..." and the server reads QEMU's
# stderr. With -Attach the server never sees that stream, so the pane stays empty.
# Owning it also makes the On/Off buttons real.
param(
[int]$Port = 8080,
[int]$QmpPort = 4444,
[string]$Frame = '0x200012BE', # gFrameBuffer, proven against the firmware source
[string]$Status = '0x2000163E', # gStatusLine
[string]$Kernel = "$PSScriptRoot\f4hwn\EGZUMER+F4HWN-v5.9.0.CN.elf",
[string]$Flash = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\assets\flash.img"),
[string]$Qemu = 'F:\dsh-build\qemu-7.2.0\build\qemu-system-arm.exe',
[switch]$Attach
)
$ErrorActionPreference = 'Stop'
# The QEMU this server spawns is a native Windows build, so the MSYS2 mingw64 DLLs
# have to be on the child's PATH -- inherited from here, since the child gets this
# environment. Without it QEMU dies at load and "power on" reports only that the QMP
# port never appeared.
$env:PATH = 'F:\msys64\mingw64\bin;' + $env:PATH
$py = 'C:\Users\Administrator\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\python\python.exe'
Set-Location (Join-Path $PSScriptRoot '..')
$common = @('tools\webui.py', '--qmp', "127.0.0.1:$QmpPort",
'--frame-addr', $Frame, '--status-addr', $Status, '--port', $Port)
if ($Attach) {
Write-Host "attaching to an emulator already listening on 127.0.0.1:$QmpPort"
& $py @common --attach
} else {
Write-Host "the page will start: $Qemu"
& $py @common --qemu $Qemu --elf $Kernel --flash $Flash
}