From ce3e2c55df239d614669a8eb44bc446e68d8561b Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 4 Sep 2023 21:12:36 -0400 Subject: [PATCH] Store QEMU files in local qemu directory --- .gitignore | 1 + Rsconscript | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 703311f..65564b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .rscons* /x86_64-elf-gcc/ /build/ +/qemu/ diff --git a/Rsconscript b/Rsconscript index bc2b456..b3f780b 100644 --- a/Rsconscript +++ b/Rsconscript @@ -187,15 +187,15 @@ 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 -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.