mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Add a qemu-bios executable to start the BIOS disk image in QEMU
This commit is contained in:
@@ -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
12
src/bin/qemu-bios.rs
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user