Added bootloader
This commit is contained in:
20
bootloader/src/os/bios/macros.rs
Normal file
20
bootloader/src/os/bios/macros.rs
Normal file
@ -0,0 +1,20 @@
|
||||
/// Print to console
|
||||
#[macro_export]
|
||||
macro_rules! print {
|
||||
($($arg:tt)*) => ({
|
||||
use core::fmt::Write;
|
||||
#[cfg(feature = "serial_debug")]
|
||||
{
|
||||
let _ = write!($crate::os::serial::COM1.lock(), $($arg)*);
|
||||
}
|
||||
let _ = write!($crate::os::VGA.lock(), $($arg)*);
|
||||
});
|
||||
}
|
||||
|
||||
/// Print with new line to console
|
||||
#[macro_export]
|
||||
macro_rules! println {
|
||||
() => (print!("\n"));
|
||||
($fmt:expr) => (print!(concat!($fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
|
||||
}
|
||||
Reference in New Issue
Block a user