Avoid deadlocks in println/serial_println

This commit is contained in:
Philipp Oppermann
2018-10-20 16:44:40 +02:00
parent 68ffc3cd59
commit 66d940559f
4 changed files with 118 additions and 7 deletions

View File

@@ -164,7 +164,11 @@ macro_rules! println {
/// Prints the given formatted string to the VGA text buffer through the global `WRITER` instance.
pub fn print(args: fmt::Arguments) {
use core::fmt::Write;
WRITER.lock().write_fmt(args).unwrap();
use x86_64::instructions::interrupts;
interrupts::without_interrupts(|| {
WRITER.lock().write_fmt(args).unwrap();
});
}
#[cfg(test)]