Commit Graph

16 Commits

Author SHA1 Message Date
Sam Leffler
88841cb7a7 DebugConsole: add autostart script support & make uart optional
- make kata-uart-client use dependent on a new "sparrow_uart_support"
  feature; this is needed for headless operation and for platforms
  without a working uart driver
- add a mechanism where an "autostart.repl" file is fetched  from the
  builtins (if present) and passed through the shell; output goes to
  the uart if configured, otherwise the kernel or /dev/nnull
- add a new "source" shell command that interprets the contents of a
  builtins file as console input
- rework the command interpreter to support autostart & source
- move the logging hookup to kata-debug-console so the system builds
  when no uart support is conffigured (need to add fallback to debug
  syscalls in case that works when no driver is present)

Change-Id: I5e6725c93488a48d212dfaca425ede37cbdb72e5
GitOrigin-RevId: 6f360cab71ea103af52e3c68ca240fc16e0f20bb
2022-10-18 15:36:33 -07:00
Sam Leffler
601e7f5c78 kata: compile-out debug & trace log calls in release builds
Change-Id: Ibde5a49141daa67c57e24340b73b436d08e68e7a
GitOrigin-RevId: 4a77833a6cd3e16850d2e4d90b7e7ed916770b50
2022-10-06 19:00:28 +00:00
June Tate-Gans
1a068b0143 kata: Prepend the Google copyright and Apache 2.0 license
This includes adding it to TOML files and CAmkES assembly files.

Change-Id: I263e7a566df91fccc04f9b2186edab13331290c5
GitOrigin-RevId: 48a35b06ca868a0a4d379f881068cc4dad491669
2022-10-06 18:59:16 +00:00
Cindy Liu
50cd809320 Merge changes If949288d,I9849065a,I121edee2
* changes:
  kata: LSC: rustfmt with global rustfmt.toml
  kata: update global rustfmt flags
  kata: Promote rustfmt.toml to all kata crates

GitOrigin-RevId: 452e66fa7231f39cff81dc2fbe37ad1a1fc62fb9
2022-10-06 18:57:32 +00:00
Cindy Liu
c9f36f4da8 Merge "Changes for updating the toolchain to nightly-1.58.0"
GitOrigin-RevId: 6eadbd3c3652d88b3079635f2649b43e370fe4bd
2022-10-06 18:54:11 +00:00
Sam Leffler
b8dfe92451 DebugConsole: clippy findings
Change-Id: I8e93e5441e5762171b4e32baa253ceba6d96855b
GitOrigin-RevId: 90106f4f236c27f88a59ea6286612bb6db378cfc
2022-10-06 18:47:07 +00:00
June Tate-Gans
57a4ee2f13 cargo: Bump to 2021 edition
Change-Id: Icb2deaff58da7f92970d8f57f7853349769323f5
GitOrigin-RevId: f8303df543a9d84c066b9a4a1bd1c0239eb75857
2022-10-06 18:42:30 +00:00
Matt Harvey
d70003982c Merge "Aligns UART API with Rust Read and Write"
GitOrigin-RevId: df407ae4bddb75b1bc43c35062947679c2b10c3a
2022-10-06 18:31:59 +00:00
Matt Harvey
66c03e7858 Merge "Ports zmodem to no_std and kata_io"
GitOrigin-RevId: 09bc871f7c4fdd64f3b4591a47cf5ba0bffa72c2
2022-10-06 18:12:52 +00:00
Sam Leffler
d97a78316e Misc cleanups.
- change early logging (pre kata-shell prompt) to trace level so by
  default nothing shows up unless kata-debug-console::pre_init sets
  log::set_max_level to Trace (default is Debug)
- log allocator init's in caller so log msgs identify per-component heap
  setups (all the same for now but at some point may diverge)
- shorten kata-shell prompt to "KATA> " - remove unused camkes control's
  and consolidate other early work in pre_init and <component>__init hooks
- cargo fmt components

Change-Id: I010eb5cc5af2e379691cb2e62d82dbab32a06bc3
GitOrigin-RevId: badddf46f5ba50fa60e9cbead9f6d99d5ff3808b
2022-10-06 18:03:53 +00:00
Sam Leffler
8ace3eb6f2 kata-logger: pass level through LoggerInterface and filter in DebugConsole
Components can reduce the number of rpc's if they set_max_level but by
default pass everything and let the DebugConsole decide what is logged.
With this the shell loglevel command now controls logging from all
components.

Change-Id: I72b77bbf02882ffdba0aaf0b9b88126bfd2e62a1
GitOrigin-RevId: d451e72cf67e41d6ee25ea2995098b5009cf8852
2022-10-06 18:01:22 +00:00
Matt Harvey
4043c8b5b7 Mutex guards kata-uart-client read and write
Change-Id: I5757dcf68f64359b743f458f336a813aeb43c069
GitOrigin-RevId: 1c6c85f95c6509cc915df1b82076942cd540c441
2022-10-06 18:01:13 +00:00
Matt Harvey
7c3cc70ab1 Splits UART tx/rx into separate CAmkES procedures
This ends the behavior where log messages would block on the prompt.

This change does not fix the potential race on dataports if
kata-uart-client read or write has multiple concurrent callers. A later
change will protect those using CAmkES mutexes, although the
alternative of having DebugConsole *own* the UART should also be
considered.

Change-Id: I8d5d8336cd58b9f22cca81ae6aca13b4ed57e7e4
GitOrigin-RevId: e781fd8454d22e0f829d788fe602e431551e259a
2022-10-06 18:01:04 +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
16d547d52d kata-uart-client: use correct type for dataports
Change-Id: I07224179314dbecc35f343e8e87b77886aa2108b
GitOrigin-RevId: 89e342f858475c1ab5695621ab1f46e70e6d45ca
2022-10-06 17:55:42 +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