Skip to content

Commit

Permalink
Fix serial output \n
Browse files Browse the repository at this point in the history
  • Loading branch information
equation314 committed Mar 27, 2022
1 parent f9f1b22 commit c0e8e9b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kernel/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ static PRINT_LOCK: Mutex<()> = Mutex::new(());
impl Write for Stdout {
fn write_str(&mut self, s: &str) -> fmt::Result {
for c in s.chars() {
console_putchar(c as u8);
match c {
'\n' => {
console_putchar(b'\r');
console_putchar(b'\n');
}
_ => console_putchar(c as u8),
}
}
Ok(())
}
Expand Down

0 comments on commit c0e8e9b

Please sign in to comment.