feat(userspace): log server sole console holder; init boots from manifest; adapter loads only init+storage
This commit is contained in:
@@ -4,8 +4,13 @@ struct Writer;
|
||||
|
||||
impl fmt::Write for Writer {
|
||||
fn write_str(&mut self, s: &str) -> fmt::Result {
|
||||
// Without a console capability, output goes nowhere.
|
||||
if let Some(console) = crate::start::console() {
|
||||
// The log server first; a process without either prints nothing.
|
||||
// A call, not a send: the text is out before the caller goes on.
|
||||
if let Some(log) = crate::start::log() {
|
||||
for chunk in s.as_bytes().chunks(types::log::TEXT_BYTES) {
|
||||
let _ = crate::syscall::call(log, types::log::text_words(chunk), None);
|
||||
}
|
||||
} else if let Some(console) = crate::start::console() {
|
||||
for &b in s.as_bytes() {
|
||||
crate::syscall::debug_putchar(console, b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user