Skip to content

Commit ae8e7db

Browse files
committed
add log
1 parent cea816c commit ae8e7db

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

modules/axfs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cfg-if = "1.0"
2828
crate_interface = {version = "0.1", optional = true}
2929
lazyinit = "0.2"
3030
log = "0.4"
31-
lwext4_rust = {git = "https://github.com/Josen-B/lwext4_rust.git"}
31+
lwext4_rust = {git = "https://github.com/Josen-B/lwext4_rust.git", tag ="v1.0"}
3232

3333
[dependencies.fatfs]
3434
default-features = false

modules/axhal/src/dtb.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ use fdt_parser::{Fdt, FdtHeader};
33
use core::fmt::Write;
44
use lazyinit::LazyInit;
55

6-
static BOOTARGS_STR: LazyInit<heapless::String<256>> = LazyInit::new();
6+
static BOOTARGS_STR: LazyInit<heapless::String<1024>> = LazyInit::new();
77

88
pub fn bootargs_message() -> Option<&'static str> {
99
let fdt_addr = crate::get_bootarg();
1010

1111
if fdt_addr == 0 {
1212
return None;
1313
}
14-
14+
info!("fdt_addr = {:#x}", fdt_addr);
1515
let virt_addr = crate::mem::phys_to_virt(crate::mem::PhysAddr::from(fdt_addr)).as_usize();
16-
16+
info!("virt_addr = {:#x}", virt_addr);
1717
let fdt_header = unsafe {
18-
let header_size = core::mem::size_of::<FdtHeader>();
1918
let ptr = virt_addr as *const u8;
19+
let header_size = core::mem::size_of::<FdtHeader>();
2020
core::slice::from_raw_parts(ptr, header_size)
2121
};
2222

@@ -39,10 +39,12 @@ pub fn bootargs_message() -> Option<&'static str> {
3939
if let Some(chosen) = fdt.chosen() {
4040
if let Some(bootargs) = chosen.bootargs() {
4141
// Store bootargs in static variable
42-
let mut bootargs_str = heapless::String::<256>::new();
42+
let mut bootargs_str = heapless::String::<1024>::new();
4343
if write!(bootargs_str, "{}", bootargs).is_ok() {
4444
BOOTARGS_STR.init_once(bootargs_str);
4545
return Some(BOOTARGS_STR.as_str());
46+
} else {
47+
error!("Failed to write bootargs to static string");
4648
}
4749
}
4850
}

0 commit comments

Comments
 (0)