Commit Graph

60 Commits

Author SHA1 Message Date
Adam Jesionowski
b9cc80a929 kata: MLCoordinator and VectorCoreDriver
Add a VectorCoreDriver component that handles setting vector core CSRs.

Rewrite MLCoordinator to conform to other Kata components. The old code
wasn't useful.

Add `test_mlexecute` command for running ML. Add plumbing from shell to
coordinator.

Change-Id: I3d563f1a343361c95d3ad5b78231fbe9df32b851
GitOrigin-RevId: f3c38839f708743de596339d1b8173315283b772
2022-10-06 18:00:17 +00:00
Sam Leffler
b9e209b008 Overhaul ProcessManager support.
- Split support into three levels:
  o kata_proc_manager::process_manager is a single-threaded implementation
    of ProcessManagerInterface and PackageManagerInterface that uses an
    abstract manager interface to carry out low-level work (used mainly
    to inject fakes for unit testing).
  o kata_proc_manager is a thread-safe wrapper around process_manager that
    has the manager interfaces bound to KataOS; this is the level at which
    we integrate with external components.
  o kata_proc_component is the top-level glue code for the ProcessManager
    camkes component; it has a pre_init function to setup rust support
    (logger, allocator, etc), a run function for the component's control
    block, and wrapper functions for the camkes ProcessControl and
    PackageManagement interfaces.
- Add install, uninstall, start, stop, and bundles shell commands for
  exercising ProcessControlInterface & PackageManagementInterface.

Specifics:
- Bundle id's are now treated internally as SmallString's with &str
  used for passing bundle id's through api's. The BundleId type is
  temporarily used for get_running_bundles() to return information (but
  see below about RawBundleIdData).
- ArrayVec's are replaced with a hashbrown::HashMap
- Bundle objects are Box'd instead of holding refs (now that we have an
  allocator); this eliminates lifetime constraints.
- The manager interface is Box'd to eliminate lifetime constraints.
- Purge ProcessManager::empty(), it's infeasible with the hashmap and
  is not needed with kata_proc_manager support for static decls.
- Add RawBundleIdData support for serialize+deserialize of BundleIdArray;
  no more leaking internal data types to client code.
- Remove bounds check on #bundles recorded; set a nominal capacity
  and fallback to dynamic allocation of the hashmap.
- Manually update ProcessManagerBindings.h (using cbindgen).

Change-Id: I08deaecc997ea96cb794808036540bedd58b3fa4
GitOrigin-RevId: 6e0826940b43b1295d39769b57812a9494b5a4cb
2022-10-06 17:59:52 +00:00
Sam Leffler
1595b3ad6c kata-shell: add loglevel command
Syntax: loglevel [off, info, debug, warn, error, trace]

Change-Id: I6b480626783cd4bf069a7741d7f4670e96c967b6
GitOrigin-RevId: 527aefa1f2b00d17f7f703d43923463b660caa7e
2022-10-06 17:59:29 +00:00
Sam Leffler
64da97a4a6 Merge "Add kata-panic support."
GitOrigin-RevId: 86b4cf1b25c2796fff0b2f90da6ef76d773c80a9
2022-10-06 17:59:05 +00:00
Sam Leffler
c5e8722a24 Merge "Add LoggerInterface for logging msgs on the console."
GitOrigin-RevId: 256da9ba28b31f1ac3a87cce0098a52ac918de13
2022-10-06 17:58:54 +00:00
Sam Leffler
8d7e4bf44a Add a simple rust global allocator to each component.
- add a linked_list_allocator::LockedHeap instance to each component that
  might want to allocate memory and init the allocator with a fixed-size
  memory block in the component post_init hook
- add an alloc_test shell command that exercises the allocator

This does not dynamically add memory or support sharing memory between
components; this is an intermediate step to simplify bringing in crates
that want to allocate memory (e.g. hashbrown)..

Change-Id: Idaf11fb5d4999218c75bf932133df24de35e3053
GitOrigin-RevId: 7c9b14bf9463239ce030c374b58a140f0835759e
2022-10-06 17:57:56 +00:00
Sam Leffler
c61d7890a7 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
2022-10-06 17:56:12 +00:00
Austin Appleby
d602aa29d5 Merge "Remove the Kanji prompt character and add a printf when the repl starts up so we can see it in the Renode log."
GitOrigin-RevId: cd401621c05352bbdd10a70fbf788c58bc2efa10
2022-10-06 17:56:01 +00:00
June Tate-Gans
fa1c3cecd6 shell: Update prompt with Kanji character for kata
Change-Id: If76d7a83798f49e463cb7af24ee5e14320b0aed0
GitOrigin-RevId: dc142976c68a9d7af3027de8ff2d6cb566812c83
2022-10-06 17:54:31 +00:00
Matt Harvey
fd2bebb81f Replaces processmanager with a one-app CAmkES assembly for the entire Kata OS
This also adds a skeleton for the DebugConsole CLI taking IO from a UART
via some Rust wrapper functions, also defined in this change
(kata-uart-client).

Change-Id: I56856c14992010483da58c45f6550c0a4c9987b0
GitOrigin-RevId: e1b2d65ed3a7f627a9f7377caa407151fc943864
2022-10-06 17:54:23 +00:00