-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move console into os module
Signed-off-by: Martin Kröning <[email protected]>
- Loading branch information
Showing
5 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use core::fmt; | ||
|
||
use one_shot_mutex::OneShotMutex; | ||
|
||
pub struct Console(()); | ||
|
||
impl fmt::Write for Console { | ||
fn write_str(&mut self, s: &str) -> fmt::Result { | ||
crate::arch::write_to_console(s.as_bytes()); | ||
Ok(()) | ||
} | ||
} | ||
|
||
pub static CONSOLE: OneShotMutex<Console> = OneShotMutex::new(Console(())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters