Add a qemu-bios executable to start the BIOS disk image in QEMU

This commit is contained in:
Philipp Oppermann
2023-05-01 14:20:01 +02:00
parent 98da4b2f9a
commit ba8b0392b8
2 changed files with 13 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
name = "blog_os"
version = "0.1.0"
edition = "2021"
default-run = "blog_os"
[workspace]
members = ["kernel"]

12
src/bin/qemu-bios.rs Normal file
View File

@@ -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));
}