-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecord_demo.ps1
More file actions
81 lines (64 loc) · 2.68 KB
/
record_demo.ps1
File metadata and controls
81 lines (64 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Record demo video of ToaruOS-Arnold kernel
# Captures multiple screenshots while simulating keyboard input
$frameDir = "C:\Users\Acer\Desktop\ToaruOS-Arnold\frames"
New-Item -ItemType Directory -Force -Path $frameDir | Out-Null
# Clean old frames
Get-ChildItem $frameDir -Filter "*.ppm" | Remove-Item
# Start QEMU with monitor
$qemuProcess = Start-Process -FilePath "C:\Program Files\qemu\qemu-system-i386.exe" -ArgumentList "-accel tcg,tb-size=64 -m 32M -vga std -kernel build/toaruos-arnold.elf -monitor tcp:127.0.0.1:4444,server,nowait" -WorkingDirectory "C:\Users\Acer\Desktop\ToaruOS-Arnold" -PassThru
# Wait for boot
Start-Sleep -Seconds 3
$client = New-Object System.Net.Sockets.TcpClient
try {
$client.Connect("127.0.0.1", 4444)
$stream = $client.GetStream()
$writer = New-Object System.IO.StreamWriter($stream)
$writer.AutoFlush = $true
# Capture initial frames (just the UI)
for ($i = 0; $i -lt 30; $i++) {
$filename = "C:/Users/Acer/Desktop/ToaruOS-Arnold/frames/frame_{0:D4}.ppm" -f $i
$writer.WriteLine("screendump $filename")
Start-Sleep -Milliseconds 100
}
# Send 'a' key (scancode 0x1E) - green indicator
$writer.WriteLine("sendkey a")
Start-Sleep -Milliseconds 200
for ($i = 30; $i -lt 50; $i++) {
$filename = "C:/Users/Acer/Desktop/ToaruOS-Arnold/frames/frame_{0:D4}.ppm" -f $i
$writer.WriteLine("screendump $filename")
Start-Sleep -Milliseconds 100
}
# Send 'b' key (scancode 0x30) - red indicator
$writer.WriteLine("sendkey b")
Start-Sleep -Milliseconds 200
for ($i = 50; $i -lt 70; $i++) {
$filename = "C:/Users/Acer/Desktop/ToaruOS-Arnold/frames/frame_{0:D4}.ppm" -f $i
$writer.WriteLine("screendump $filename")
Start-Sleep -Milliseconds 100
}
# Send 'c' key (scancode 0x2E) - blue indicator
$writer.WriteLine("sendkey c")
Start-Sleep -Milliseconds 200
for ($i = 70; $i -lt 90; $i++) {
$filename = "C:/Users/Acer/Desktop/ToaruOS-Arnold/frames/frame_{0:D4}.ppm" -f $i
$writer.WriteLine("screendump $filename")
Start-Sleep -Milliseconds 100
}
# Back to 'a' - green
$writer.WriteLine("sendkey a")
Start-Sleep -Milliseconds 200
for ($i = 90; $i -lt 120; $i++) {
$filename = "C:/Users/Acer/Desktop/ToaruOS-Arnold/frames/frame_{0:D4}.ppm" -f $i
$writer.WriteLine("screendump $filename")
Start-Sleep -Milliseconds 100
}
# Quit QEMU
$writer.WriteLine("quit")
$writer.Close()
$client.Close()
} catch {
Write-Host "Error: $_"
}
Write-Host "Frames captured. Creating video..."
# Wait for QEMU to exit
Start-Sleep -Seconds 2