Commit graph

3156 commits

Author SHA1 Message Date
bunnie
34cfc7db5b temporarily allow more graphics server connections
this is for early testing and debug -- there's a note to
revert this in the console log once we're done with that.
2024-05-23 14:51:11 +08:00
bunnie
4efd227b70 add an extra reserved page for the swapper
on cramium-soc an extra page of stack ends up being used to
accommodate the page buffer needed for SPIM implementation
2024-05-23 14:48:37 +08:00
bunnie
79484224f6 start the keyboard emulator service
the service isn't fully implemented but its existence allows
other processes to make forward progress on boot for testing
2024-05-23 14:46:07 +08:00
bunnie
622652393c refactor TRNG reseed code
refcell leads to some panics in multithreaded code.
Use an atomic usize to track reseed interval, which is a bit
safer.
2024-05-23 14:44:10 +08:00
bunnie
01a5d0aba9 create context list for cramium target 2024-05-23 14:42:16 +08:00
bunnie
1faaf2c092 note timeouts on read in the HAL driver 2024-05-22 18:15:03 +08:00
bunnie
fa707646dc incorporate the new APIs at the top level
also clean up crate names to conform with names used in other crates
2024-05-22 02:32:06 +08:00
bunnie
0fbf1ecf22 add TRNG user API
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.
2024-05-22 02:29:38 +08:00
bunnie
4c4e1c99c3 add keyboard API itself 2024-05-22 02:29:27 +08:00
bunnie
9767b29380 add hw drivers to HAL & keyboard driver
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.
2024-05-22 02:27:34 +08:00
bunnie
7d6bd3f086 add api module for more HAL services & keyboard API
this is meant to emulate the Precursor API on cram targets
2024-05-22 02:26:24 +08:00
bunnie
1fa0a3de20 fix quantum timer to 10ms; adjust api names 2024-05-22 02:25:03 +08:00
bunnie
b1e3e81a6f add patches to GAM for cramium-soc compatibility 2024-05-22 02:24:10 +08:00
bunnie
bfef60a0b1 add a configuration that works
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.
2024-05-21 18:38:37 +08:00
bunnie
362bb4ff7e for some reason, these debug flags must be on for the target to run. 2024-05-21 18:07:35 +08:00
bunnie
e5452d3692 tune swapper; add candidate filtering
- 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!
2024-05-21 03:48:28 +08:00
bunnie
f0584e7f1d and test tuning notes 2024-05-21 03:48:05 +08:00
bunnie
751042e202 quite down debug in swapper 2024-05-21 02:56:27 +08:00
bunnie
b781cb9e1f modify the swapper tester to hard-OOM
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.
2024-05-21 01:42:57 +08:00
bunnie
2ea6c83bf0 implement the userspace side of hard-oom and oom-doom handlers
see the comments added in the main.rs file for a discussion of all
the things.
2024-05-21 01:42:19 +08:00
bunnie
52d629308b make loader dependency only for hardware targets 2024-05-18 00:10:29 +08:00
bunnie
d2d982b9f2
Merge branch 'main' into swap-opt 2024-05-16 14:56:02 +05:30
bunnie
f8f163d531 update todo list 2024-05-16 03:59:38 +08:00
bunnie
e3b3960a40 add a "debug-verbose" option on the swapper
we'll surely need this again someday...
2024-05-16 03:58:03 +08:00
bunnie
55ebb556ba quite down some ll debug 2024-05-16 03:57:45 +08:00
bunnie
c1b68018e1 lots of debuggening 2024-05-16 03:57:29 +08:00
bunnie
ff42e1ab20 better handling of oom_doom; wired page handling; fix bugs 2024-05-15 02:39:06 +08:00
bunnie
cec4a06174 debugging eviction
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.
2024-05-13 21:04:30 +08:00
bunnie
b5f0c262e7 add some debug for the precursor target 2024-05-13 21:03:56 +08:00
bunnie
b2b31a2713 cleanup and re-org code 2024-05-13 17:26:38 +08:00
bunnie
258fa8c1c3 heavily refactored swapper core 2024-05-13 14:23:48 +08:00
bunnie
1bd07d7657 remove dependencies that we decided not to use 2024-05-13 14:04:54 +08:00
bunnie
c41889b22f update comments 2024-05-13 14:04:33 +08:00
bunnie
9101abf2c4 make swap resume-compatible 2024-05-12 21:51:14 +08:00
bunnie
65caa55407 bump to minifb 0.26.0
solves #538
2024-05-12 12:32:45 +08:00
bunnie
52e5d21e6f work around white screen issue on Windows 11 (#538)
This is the work-around suggested at

https://github.com/emoon/rust_minifb/issues/351

until a new release is tagged.
2024-05-10 00:33:59 +08:00
bunnie
87b53e77a4 map offset tracker into swapper state
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!
2024-05-09 02:09:43 +08:00
bunnie
933a9a342d start to bring in more LRU; put shared state in Box 2024-05-08 07:23:27 +08:00
bunnie
a031eeba4e add the skeleton of LRU tracking data
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...
2024-05-08 02:06:27 +08:00
bunnie
64bc1aa074 test the get free memory call 2024-05-07 04:13:11 +08:00
bunnie
9e66c1bee2 commit the version bump 2024-05-07 01:03:05 +08:00
bunnie
0f79056ac7 refactor spim divider equation to reflect reality 2024-05-06 03:32:41 +08:00
bunnie
12327ab255 adjust ticktimer to reflect real time 2024-05-06 02:43:30 +08:00
bunnie
e76c1d9172 adjust delay 2024-05-06 02:43:18 +08:00
bunnie
bd3dbd6772 absorb API changes 2024-05-06 02:30:25 +08:00
bunnie
9052d05657 cleanup debug 2024-05-06 02:30:11 +08:00
bunnie
d5b9036531 allow for alternate pin mapping on graphics server
use the SPIM port that is broken for QSPI for the display...
2024-05-06 02:29:34 +08:00
bunnie
a7e38f1fb9 turn off default feature flags on hal dependency 2024-05-06 02:29:09 +08:00
bunnie
7006f92e6f clean up an error with a gratuitous print 2024-05-05 21:52:28 +08:00
bunnie
76c1f9cb55 fix debug in precursor configs 2024-05-05 16:31:57 +08:00