File size: 535 Bytes
258148b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ErrorActionPreference = 'Stop'

$qemu = Get-Command qemu-system-x86_64 -ErrorAction SilentlyContinue
if (-not $qemu) {
    $qemuPath = 'C:\Program Files\qemu\qemu-system-x86_64.exe'
    if (-not (Test-Path $qemuPath)) {
        throw 'QEMU was not found. Install QEMU or add it to PATH.'
    }
} else {
    $qemuPath = $qemu.Source
}

if (-not (Test-Path 'target\micro-os-bios.img')) {
    cargo build
}

& $qemuPath '-drive' 'format=raw,file=target\micro-os-bios.img' '-serial' 'stdio' '-display' 'gtk' '-no-reboot'