Commit ae314a5d authored by Jonathan Schwender's avatar Jonathan Schwender Committed by Stefan Lankes
Browse files

aarch64: Add feature to use stdout via qemu special address



- Since the feature is only used in aarch64 subsystem no need to additionally check for aarch64 target
Signed-off-by: default avatarJonathan Schwender <schwenderjonathan@gmail.com>
parent b1d83a23
......@@ -41,13 +41,14 @@ name = "measure_startup_time"
harness = false
[features]
default = ["pci", "acpi", "fsgsbase", "smp"]
default = ["pci", "acpi", "fsgsbase", "smp", "aarch64-qemu-stdout"]
vga = []
newlib = []
pci = []
acpi = []
smp = []
fsgsbase = []
aarch64-qemu-stdout = [] # Doesn't do anything on x86
[dependencies]
bitflags = "1.3"
......
......@@ -149,6 +149,7 @@ pub fn get_cmdline() -> VirtAddr {
pub fn message_output_init() {
percore::init();
#[cfg(not(feature = "aarch64-qemu-stdout"))]
if environment::is_single_kernel() {
// We can only initialize the serial port here, because VGA requires processor
// configuration first.
......@@ -159,6 +160,11 @@ pub fn message_output_init() {
}
pub fn output_message_byte(byte: u8) {
#[cfg(feature = "aarch64-qemu-stdout")]
unsafe {
core::ptr::write_volatile(0x3F20_1000 as *mut u8, byte);
}
#[cfg(not(feature = "aarch64-qemu-stdout"))]
if environment::is_single_kernel() {
// Output messages to the serial port and VGA screen in unikernel mode.
unsafe {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment