this is a shim on top of the kernel-owned TRNG port, which uses the
SID generator function to seed a ChaCha8 CSPRNG. The CSPRNG is seeded
with 64 bits of randomness, and every 32 accesses to the CSPRNG it
gets re-seeded with 32 bits more randomness from the TRNG for better
forward secrecy.
this is currently just a stand-in to provide API compat with
with precursor keyboards. eventually we'll need to patch the console
UART (which is output to the log crate) into the keyboard as
an injector source.
for some reason a debug-print is essential for the system to run
stably. It smells like we're violating some minimum time between
accesses of SPIM interface, or else we're encoutnering some weird
optimization bug.
- make a hard OOM more agressive about clearing memory
- add a filter on OOM Doom to de-proritize code and message
segments, meaning unused heap/stack will tend to be swapped
before code gets evicted.
This can, of course, be tuned down the road!
allocate more memory than we can possibly process in a single
vector, to force the swapper to cycle through pretty much every
page of memory in order to service the computation.
currently able to trigger an eviction and it seems like some of
the pages actually go out, but there is some imprecision in the
syscall implementation for eviction that is causing the userspace
code to re-enter in a bad state after a few iterations of
the call.
checking code in as an intermediate checkpoint.
this is allocated by the loader for the swapper. This should
be the last big piece of state we need to get the swapper to work...
honestly, it's already a pretty heavy bit of code :( we should
probably optimize out the RPT hand-off to not include all of
the non-swappable memory pages, which is quite substantial in
the case of some SoCs.
also refactor to use the loader's computation function for
the MAC offset in swap, instead of copying this hairy bit of
logic like....8 times over throughout the code base, yeaaach!
1. add a method to aggregate and export advisories into userspace
2. add an LRU cache to absorb the advisories
LRU cache still needs init'ing
aggregation method for advisories could be mirrored into the
kernel (sans heapless dependency) for even better efficiency...