Compare commits

...

2 Commits

Author SHA1 Message Date
4e46b98efc Capture QEMU serial port output 2023-09-04 21:13:35 -04:00
ce3e2c55df Store QEMU files in local qemu directory 2023-09-04 21:12:36 -04:00
2 changed files with 16 additions and 8 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.rscons*
/x86_64-elf-gcc/
/build/
/qemu/

View File

@ -187,15 +187,22 @@ hello_env = env "hello", use: %w[ldc2 x86_64-w64-mingw32-gcc] do |env|
end
task "run", desc: "Run HOS in QEMU" do
Dir.mktmpdir do |tmpdir|
img = hello_env.expand("^/HOS.img")
FileUtils.cp(img, tmpdir)
ovmf = "OVMF.fd"
if File.exist?("/usr/share/edk2/x64/OVMF.fd")
ovmf = "/usr/share/edk2/x64/OVMF.fd"
end
sh %W[qemu-system-x86_64 -cpu max -bios #{ovmf} -drive file=#{tmpdir}/HOS.img,format=raw -device qemu-xhci -device usb-tablet]
FileUtils.rm_rf("qemu")
FileUtils.mkdir_p("qemu")
img = hello_env.expand("^/HOS.img")
FileUtils.cp(img, "qemu")
ovmf = "OVMF.fd"
if File.exist?("/usr/share/edk2/x64/OVMF.fd")
ovmf = "/usr/share/edk2/x64/OVMF.fd"
end
sh %W[
qemu-system-x86_64
-cpu max
-serial file:qemu/serial.out
-bios #{ovmf}
-drive file=qemu/HOS.img,format=raw
-device qemu-xhci
-device usb-tablet]
end
# See README.md for how to set up VirtualBox for HOS.