1
0
Fork 0

improve debug messaging

This commit is contained in:
Sebastien Bourdeauducq 2020-04-26 16:10:09 +08:00
parent b7eacaeac7
commit 44b37aba7d
2 changed files with 5 additions and 3 deletions

View File

@ -3,7 +3,7 @@ use core::fmt;
use core::cmp::min;
use core::cell::RefCell;
use alloc::rc::Rc;
use log::{warn, error};
use log::{debug, warn, error};
use num_derive::{FromPrimitive, ToPrimitive};
use num_traits::{FromPrimitive, ToPrimitive};
@ -105,6 +105,7 @@ async fn write_header(stream: &TcpStream, reply: Reply) -> Result<()> {
async fn handle_connection(stream: &TcpStream, control: Rc<RefCell<kernel::Control>>) -> Result<()> {
expect(&stream, b"ARTIQ coredev\n").await?;
debug!("received connection");
loop {
if !expect(&stream, &[0x5a, 0x5a, 0x5a, 0x5a]).await? {
return Err(Error::UnexpectedPattern)

View File

@ -125,6 +125,7 @@ pub fn main_core1() {
ptr::write_bytes(__bss_start as *mut u8, 0, (_end - __bss_start) as usize);
}
current_modinit = Some(__modinit__);
debug!("kernel loaded");
core1_tx.send(Message::LoadCompleted)
},
Err(error) => {
@ -134,13 +135,13 @@ pub fn main_core1() {
}
},
Message::StartRequest => {
debug!("starting");
debug!("kernel starting");
if let Some(__modinit__) = current_modinit {
unsafe {
(mem::transmute::<u32, fn()>(__modinit__))();
}
}
debug!("stopping");
debug!("kernel terminated");
}
_ => error!("Core1 received unexpected message: {:?}", message),
}