Commit graph

25 commits

Author SHA1 Message Date
bunnie
03d67de1f6 kernel in -fpga variant uses duart 2025-01-01 22:48:32 +08:00
bunnie
9662f13d31 raw pointer dance for kernel TRNG 2024-12-02 19:05:24 +08:00
bunnie
64612352d3 raw pointer dance for debug UART 2024-12-02 19:04:37 +08:00
bunnie
bb7209508b update formatting on the published crates
not doing a reformat of the entire project to match
nightly formatting changes, but capturing the published
crates so we can maybe save a version bump later on to get
the project clean.
2024-09-23 01:43:02 +08:00
bunnie
a9b0ba2666 improve documentation on how the CSPRNG is reseeded from the TRNG. 2024-06-22 21:18:24 +08:00
bunnie
7a821a836f cleanup comments 2024-06-18 00:07:43 +08:00
bunnie
ec41c73aa9 harden kernel TRNG
apply the same techniques in the loader key generator to
the kernel TRNG. Every pull of data from the kernel reseeds
the TRNG state as well. This makes server ID creation somewhat
more expensive, but should greatly improve the security of
the system in the case of a TRNG with occassional drop-outs.
2024-06-15 00:40:04 +08:00
bunnie
53f8a9f1d6 apply entropy hardening on boot to kernel as well
Shoot for 256 bits minimum entropy in the seed pool, gives us
some safety margin over our required 128.

note that the pool only gets more entropy over time, as every
call to the pool folds more entropy in (roughly 2 bits per call).
2024-06-14 16:12:17 +08:00
bunnie
a5322eaa7a add sampling countermeasures to the kernel
this evolves the TRNG state further after reporting any raw samples
for QC to make it harder to reason about the TRNG state after QC.
2024-06-13 15:41:30 +08:00
bunnie
a07ab0e121 update comments and add license headers 2024-05-13 14:21:53 +08:00
bunnie
5df2e27447 add production TRNG to cramium target for kernel 2024-01-20 16:16:07 +08:00
bunnie
f9fc3d0d4b ok, format the kernel now that all in-line assembly has been checked 2024-01-14 19:27:14 +08:00
bunnie
710c45969f Revert "format the kernel"
This reverts commit 1f69e6aa39.

this has in-line assembly, let's fix that before we format
2024-01-14 19:24:33 +08:00
bunnie
1f69e6aa39 format the kernel 2024-01-14 19:11:19 +08:00
bunnie
5116d51de5 move kernel UART to DUART port
using the DUART means we don't get console input on the kernel
(because the DUART is incapable of this) but it's a decent compromise
I think because the DUART is fast and efficient, and mostly we want
it to capture kps?

Eventually we'll need an input mode but for now, this will get us
moving.
2023-09-15 15:21:18 +08:00
bunnie
3c13516d57 kernel integrations for cramium 2023-07-17 18:49:21 +08:00
bunnie
2903de5b7b
Merge pull request #363 from betrusted-io/lcdpanic
kernel: initial lcdpanic implementation
2023-04-10 15:31:02 +08:00
Sean Cross
31235c2547 kernel: initial lcdpanic implementation
Panic to the LCD when the kernel panics.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-10 14:42:59 +08:00
bunnie
cb875cf54e various fixes to gdb-stub
these are from @xobs via issue #361
2023-04-09 22:15:57 +08:00
Sean Cross
7b36f33ef9 kernel: gdbuart: disable IRQs during destruction
Disable IRQs during destruction, but only if constructed with
`GdbUart::new()`. This allows characters to buffer when the GDB bridge
is destroyed while avoiding the double-free error we were getting from
creating a new UART in the IRQ handler.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
a34733e5e9 kernel: basic version of gdb serevr
This adds a basic gdb server. Currently, it is possible to list
processes and inspect memory and threads. It is not yet possible to
actually interact with code (e.g. no breakpoints and no single
stepping).

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
13029a76a2 kernel: initial gdb-stub reimplementation
Add an initial reimplementation of the gdb-stub using the gdbstub
backing crate.

This supports process enumeration and basic thread investigation.
Processes will pause when the debugger is inspecting them. Memory and
registers can be investigated. Threads can be listed and selected.

It does not yet support breakpoints.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:45:42 +08:00
eupn
38a02f9dbb
kernel: split precursor and sama5d2 platform modules 2023-03-14 18:30:07 +04:00
Jean-Pierre De Jesus DIAZ
d8807e6cea
kernel: Move rand driver to platform module.
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-11-02 14:36:41 +01:00
Jean-Pierre De Jesus DIAZ
b334e5bc31
kernel: Split debug shell and uart driver.
I've added a `platform` module to store all platform specific code, (not
architecture specific) as some platforms will require custom drivers, e.g.
for debug output and for the random number generation code.  The platform
code is in charge of mapping any peripherals needed to work, also to
initialize any other parts of the kernel that require drivers, for example
the debug shell.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-11-02 14:30:31 +01:00