diff --git a/Cargo.toml b/Cargo.toml index a566af24..0c3e136a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "blog_os" version = "0.1.0" edition = "2021" +default-run = "blog_os" [workspace] members = ["kernel"] diff --git a/src/bin/qemu-bios.rs b/src/bin/qemu-bios.rs new file mode 100644 index 00000000..663bd512 --- /dev/null +++ b/src/bin/qemu-bios.rs @@ -0,0 +1,12 @@ +use std::{ + env, + process::{self, Command}, +}; + +fn main() { + let mut qemu = Command::new("qemu-system-x86_64"); + qemu.arg("-drive"); + qemu.arg(format!("format=raw,file={}", env!("BIOS_IMAGE"))); + let exit_status = qemu.status().unwrap(); + process::exit(exit_status.code().unwrap_or(-1)); +}