diff --git a/Makefile b/Makefile index 426a2f8d4..ee191869d 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,6 @@ setup: build: @make --no-print-directory -C src/ramdisk @cd src && cargo kbuild - @cd src && cargo kimage tools: @cd src/services/comp-sys && cargo install --path cargo-component diff --git a/src/.cargo/config.toml b/src/.cargo/config.toml index ac3b67b29..c61484f37 100644 --- a/src/.cargo/config.toml +++ b/src/.cargo/config.toml @@ -5,7 +5,6 @@ runner = "cargo run --package jinux-boot --" [alias] kcheck = "check --target x86_64-custom.json -Zbuild-std=core,alloc,compiler_builtins -Zbuild-std-features=compiler-builtins-mem" kbuild = "build --target x86_64-custom.json -Zbuild-std=core,alloc,compiler_builtins -Zbuild-std-features=compiler-builtins-mem" -kimage = "run --target x86_64-custom.json -Zbuild-std=core,alloc,compiler_builtins -Zbuild-std-features=compiler-builtins-mem -- --no-run" krun = "run --target x86_64-custom.json -Zbuild-std=core,alloc,compiler_builtins -Zbuild-std-features=compiler-builtins-mem" ktest = "test --target x86_64-custom.json -Zbuild-std=core,alloc,compiler_builtins -Zbuild-std-features=compiler-builtins-mem" component-check = "component check --target x86_64-custom.json -Zbuild-std=core,alloc,compiler_builtins -Zbuild-std-features=compiler-builtins-mem" diff --git a/src/boot/src/main.rs b/src/boot/src/main.rs index 92b943a25..55a0ae3b7 100644 --- a/src/boot/src/main.rs +++ b/src/boot/src/main.rs @@ -16,30 +16,24 @@ const COMMON_ARGS: &[&str] = &[ "virtio-blk-pci,bus=pci.0,addr=0x6,drive=x0", "-device", "virtio-keyboard-pci", + "-monitor", + "vc", "-serial", "mon:stdio", "-display", "none", ]; -const RUN_ARGS: &[&str] = &["-s"]; +const RUN_ARGS: &[&str] = &[]; const TEST_ARGS: &[&str] = &[]; const TEST_TIMEOUT_SECS: u64 = 30; fn main() -> anyhow::Result<()> { - let mut args = std::env::args().skip(1); + let mut run_args = std::env::args().skip(1); let kernel_binary_path = { - let path = PathBuf::from(args.next().unwrap()); + let path = PathBuf::from(run_args.next().unwrap()); path.canonicalize().unwrap() }; - let no_boot = if let Some(arg) = args.next() { - match arg.as_str() { - "--no-run" => true, - other => panic!("unexpected argument `{}`", other), - } - } else { - false - }; #[cfg(feature = "limine")] call_limine_build_script(&kernel_binary_path).unwrap(); @@ -56,10 +50,6 @@ fn main() -> anyhow::Result<()> { a.join(str.add(".iso")) }; - if no_boot { - println!("Created disk image at `{}`", kernel_iso_path.display()); - return Ok(()); - } #[cfg(windows)] let mut run_cmd = Command::new("qemu-system-x86_64.exe"); #[cfg(not(windows))] @@ -74,7 +64,8 @@ fn main() -> anyhow::Result<()> { if binary_kind.is_test() { args.append(&mut TEST_ARGS.to_vec()); run_cmd.args(args); - println!("running:{:?}", run_cmd); + run_cmd.args(run_args); + println!("testing:{:?}", run_cmd); let exit_status = run_test_command(run_cmd)?; match exit_status.code() { @@ -84,6 +75,7 @@ fn main() -> anyhow::Result<()> { } else { args.append(&mut RUN_ARGS.to_vec()); run_cmd.args(args); + run_cmd.args(run_args); println!("running:{:?}", run_cmd); let exit_status = run_cmd.status()?;