Skip to content

Commit 44c7616

Browse files
committed
Add serial output to test framework
For printing error messages.
1 parent 9312d95 commit 44c7616

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/default_settings.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ fn run_test_binary(bin_name: &str) {
1717
cmd.arg("--bin").arg(bin_name);
1818
cmd.arg("--target").arg(" x86_64-example-kernel.json");
1919
cmd.arg("-Zbuild-std=core");
20+
cmd.arg("-Zbuild-std-features=compiler-builtins-mem");
2021
assert!(cmd.status().unwrap().success());
2122
}

tests/test_kernels/default_settings/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ edition = "2018"
77
[dependencies]
88
bootloader = { path = "../../.." }
99
x86_64 = "0.12.2"
10+
uart_16550 = "0.2.10"

tests/test_kernels/default_settings/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ pub fn exit_qemu(exit_code: QemuExitCode) -> ! {
1919
nop();
2020
}
2121
}
22+
23+
pub fn serial() -> uart_16550::SerialPort {
24+
let mut port = unsafe { uart_16550::SerialPort::new(0x3F8) };
25+
port.init();
26+
port
27+
}

0 commit comments

Comments
 (0)