Add SeL4Debug component to expose sel4 debug syscalls.

- add a SeL4Debug component that wraps seL4DebugPutString and seL4DumpScheduler
  system calls that are marked static inline (so not callable from rust)
- connect seL4Debug to the DebugConsole and add a "ps" command to the shell
  that uses sel4DumpScheduler to print the tcb's on the console; e.g.

KATA_PROMPT> ps
Dumping all tcbs!
Name                                            State           IP                       Prio    Core
--------------------------------------------------------------------------------------
                     sel4debug:sel4debug                running 0x1017e                  254    0
                 sel4debug:fault_handler        blocked on recv 0x1046e                  255    0
                       sel4debug:control        blocked on recv 0x1046e                  254    0
                                drv:uart        blocked on recv 0x11dc4                  254    0
                       drv:fault_handler        blocked on recv 0x105d4                  255    0
                             drv:control        blocked on recv 0x105d4                  254    0
             debug_console:fault_handler        blocked on recv 0x10840                  255    0
                   debug_console:control        blocked on reply        0x12808                  254    0
                             idle_thread                   idle 0                          0    0
                              rootserver               inactive 0x10558                  255    0

Change-Id: I48496ec0002e3307aaeb5c779319d4beb87ae56b
GitOrigin-RevId: 8665f609bdb7efd3b814b4f40abf08c5dd1e863d
This commit is contained in:
Sam Leffler
2021-06-21 14:25:46 -07:00
parent d602aa29d5
commit c61d7890a7
7 changed files with 47 additions and 0 deletions

View File

@@ -1,6 +1,10 @@
import <SeL4DebugInterface.camkes>;
component DebugConsole {
control;
uses uart_inf uart;
dataport Buf tx_dataport;
dataport Buf rx_dataport;
uses SeL4DebugInterface sel4debug;
}

View File

@@ -74,6 +74,7 @@ fn dispatch_command(cmdline: &str, output: &mut dyn io::Write) {
"echo" => echo_command(cmdline, output),
"add" => add_command(&mut args, output),
"clear" => clear_command(output),
"ps" => ps_command(),
_ => Err(CommandError::UnknownCommand),
};
if let Err(e) = result {
@@ -100,6 +101,13 @@ fn echo_command(cmdline: &str, output: &mut dyn io::Write) -> Result<(), Command
}
}
/// Implements a "ps" command that dumps seL4 scheduler state to the console.
fn ps_command() -> Result<(), CommandError> {
extern "C" { fn sel4debug_dump_scheduler(); }
unsafe { sel4debug_dump_scheduler(); }
Ok(())
}
/// Implements a binary float addition command.
///
/// This is a toy to demonstrate that the CLI can operate on some very basic