From 9a9cd25414fd419b41a2a960a463e02dd3c70d22 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 10 May 2021 19:37:30 +0800 Subject: [PATCH] kernel: debug: add help screen to debug output Signed-off-by: Sean Cross --- kernel/src/debug.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/kernel/src/debug.rs b/kernel/src/debug.rs index 9701043aa..a35b37cdc 100644 --- a/kernel/src/debug.rs +++ b/kernel/src/debug.rs @@ -140,11 +140,11 @@ pub fn irq(_irq_number: usize, _arg: *mut usize) { let current_pid = system_services.current_pid(); for process in &system_services.processes { if !process.free() { - println!("PID {}:", process.pid); + println!("PID {} {}:", process.pid, system_services.process_name(process.pid).unwrap_or("")); process.activate().unwrap(); crate::arch::mem::MemoryMapping::current().print_map(); + println!(); } - println!(); } system_services .get_process(current_pid) @@ -159,7 +159,7 @@ pub fn irq(_irq_number: usize, _arg: *mut usize) { let current_pid = system_services.current_pid(); for process in &system_services.processes { if !process.free() { - println!("PID {}:", process.pid); + println!("PID {} {}:", process.pid, system_services.process_name(process.pid).unwrap_or("")); process.activate().unwrap(); crate::arch::process::Process::with_current_mut(|arch_process| { arch_process.print_all_threads() @@ -195,6 +195,14 @@ pub fn irq(_irq_number: usize, _arg: *mut usize) { }); println!("{} k total", total_bytes / 1024); } + 'h' => { + println!("Xous Kernel Debug"); + println!("key | command"); + println!("--- + -----------------------"); + println!(" r | report RAM usage of all processes"); + println!(" p | print all processes and threads"); + println!(" m | print MMU page tables of all processes"); + } _ => {} } }