Skip to content

Commit 17827c8

Browse files
committed
Test ksymbol via a log
1 parent db8f45d commit 17827c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

os/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#![feature(alloc_error_handler)]
2424
#![feature(str_from_raw_parts)]
2525

26+
use ksymbol::kernel_func_by_addr;
27+
2628
extern crate alloc;
2729

2830
#[macro_use]
@@ -67,6 +69,8 @@ pub fn rust_main() -> ! {
6769
println!("[kernel] Hello, world!");
6870
mm::init();
6971
println!("[kernel] back to world!");
72+
println!("rust_main addr={:#x} symbol = {:?}", rust_main as usize,
73+
kernel_func_by_addr(rust_main as usize).unwrap());
7074
mm::remap_test();
7175
trap::init();
7276
//trap::enable_interrupt();

0 commit comments

Comments
 (0)