Commit graph

351 commits

Author SHA1 Message Date
bunnie
8d0a1f2ae6 reminder to self about some tech debt 2024-05-24 23:57:47 +08:00
bunnie
3fd383a7aa approximate cram target better in precursor staging environment 2024-05-23 16:51:20 +08:00
bunnie
aa8d84f007 print a message if memory reads timeout 2024-05-23 14:48:11 +08:00
bunnie
818372a604 report timeouts during the SPIM test in the loader 2024-05-22 18:10:32 +08:00
bunnie
e705dba13f quite down swap debug in loader 2024-05-21 17:57:41 +08:00
bunnie
32a9413f34 cleanup warnings when debug-print is off 2024-05-21 17:57:24 +08:00
bunnie
bae408b466 fix app_uart default memory mapping
was pointing to the wrong uart initially >_<
2024-05-21 16:33:11 +08:00
bunnie
71d7a2a3ae update api in test routine 2024-05-21 16:33:03 +08:00
bunnie
2e1ad6e1a4 remove T:Copy bounds on bzero
not quite sure why it is even there, might just be a thing from
really old code we never removed. Removing this allows us to
specify pointer types to non-copy elements, making Rust do
the hard work of figuring out how big of a block we need to zero.
2024-05-21 16:02:59 +08:00
bunnie
0153b3b96e allow guard memory to be differentiated across platforms 2024-05-21 16:00:56 +08:00
bunnie
8b487361b2 clean up bzero
some errors were made in clearing memory because we weren't
using the Rust type system to our advantage. This cleans up
the phase 1 loader to use the native types of the block plus
the slice length we intend to create to block-zero the correct
region size.

also simplify mem::size_of to size_of
2024-05-21 15:58:10 +08:00
bunnie
a57945e2c0 add helper to extract vaddr prefixes (used by swapper to fliter candidates) 2024-05-21 03:46:29 +08:00
bunnie
b7becf27e7 quiet down warnings when debug-print is off
because the print! macro becomes a dummy when debug printing is
off, we get a bunch of warnings about unused variables because
the print! arguments aren't used. Add _ before variable names
to quiet these warnings.
2024-05-21 01:52:30 +08:00
bunnie
75e938680d fix page table explanation to match reality better 2024-05-21 01:03:19 +08:00
bunnie
37109b19a8 fix ordering of the SwapAlloc for BinaryHeap impl 2024-05-16 03:52:22 +08:00
bunnie
e75f6d80db tone down some debug output 2024-05-16 03:51:59 +08:00
bunnie
03515934df clarify function of the thread context area 2024-05-16 03:51:38 +08:00
bunnie
6d01e69faf fix debug formatting 2024-05-16 03:51:03 +08:00
bunnie
ef5388a30e ensure that process descriptors aren't swapped out 2024-05-15 02:38:24 +08:00
bunnie
f66debdd01 make susres page ownership not hard coded; mark PTs as wired
also marks the ProcessImpl page as wired too
2024-05-15 02:31:40 +08:00
bunnie
b138f63f93 fix swapalloc ordering
we want a max-heap, because pops are cheaper on the sorted vec.
2024-05-13 19:19:15 +08:00
bunnie
a94dce11f7 add loader support for rpt tracking/mapping
trying to condense most of the RPT API into the loader so
that the userspace can use a single dependency for this.

We can't condense the kernel API into the loader unfortunately,
because the kernel actually uses a different type for representing
a process. This is probably a mistake, and is something that
may be fixed later so we can merge the representations.
2024-05-13 14:03:00 +08:00
bunnie
8606d0ae83 add some more tracking to the loader
this will give us some more pages to swap out beyond the initial
set of free pages.
2024-05-12 22:29:50 +08:00
bunnie
6bef111bf2 fix RPT/XPT alloc in swap; make swap resume-compatible 2024-05-12 21:50:53 +08:00
bunnie
903c903b2f split memory allocs into RAM and peripheral tables
RAM allocs can be augmented with more tracking data in the case of
swap.
2024-05-12 20:22:51 +08:00
bunnie
f657caa176 changes to atsama5d27 target for new kernel boot args
@eupn this could use a review, I have no way to test this
2024-05-12 20:22:07 +08:00
bunnie
6080bc45d8 attempt to re-type the runtime page tracker to something we can use for swap
This is too expensive to use generically - we're going to have
to split the RPT, but checking in this change as a checkpoint
2024-05-12 16:27:30 +08:00
bunnie
f6bfddcf20 add swap usage tracking via offset flags and fix bugs in RPT init
also optimize amount of memory used in RPT copy by just tracking
the data that is swappable,i.e. main RAM
2024-05-10 13:32:58 +08:00
bunnie
64071661a5 clarify variable roles 2024-05-10 13:32:19 +08:00
bunnie
95c27c765e refactor loader to use a single function to swap MAC offset in swap
also pre-map some pages to handle offset increment in swapper
2024-05-09 02:08:51 +08:00
bunnie
1523fb6b83 cleanup warning from rust 1.38 2024-05-07 17:07:36 +08:00
bunnie
5ab014e715 cleanup the offsets for decrypt_src_page_at()
We had a "coincidence" before that allowed things to work,
where we had some data line up that we happened to think
was some other header data, so we "fixed" it by
subtracting the offset of the header data.

Actually, it wasn't.

Clarify that decrypt_src_page_at() offsets are relative
to the beginning of encrypted data, and not relative
to the absolute beginning of the disk.

Image creation is now fixed so that stuff lines up to what
this routine expects, and some asserts added to try and
save ourselves in the future as we try to fix other bugs
we discover over time.

loaders are hard.
2024-05-06 18:55:11 +08:00
bunnie
cbcd27c7eb add missing clock commit 2024-05-06 03:59:04 +08:00
bunnie
0f79056ac7 refactor spim divider equation to reflect reality 2024-05-06 03:32:41 +08:00
bunnie
05844c7646 reflect API changes in code 2024-05-06 02:28:11 +08:00
bunnie
f6dd848ef4 this wasn't supposed to be checked in 2024-05-06 02:25:49 +08:00
bunnie
10d613b95d add some tests for the SPIM memory interface 2024-05-05 21:51:48 +08:00
bunnie
8ceaa1afe4 fix page tracking bug on physical swap addresses 2024-05-05 21:51:17 +08:00
bunnie
fe0db3e29a more stack space is needed due to the increased size of the RPT 2024-05-05 21:50:09 +08:00
bunnie
0a3375722b add an experimental routine to try and print the exception vector
this is in the loader and only valid for the cramium-soc target.
2024-05-05 16:30:45 +08:00
bunnie
bb4b01b04b facilitate access for debug access to CSR by adding riscv package 2024-05-05 03:28:13 +08:00
bunnie
64f5531ae6 fix dummy cycle bug on SPIM flash read
bus is running at 50MHz (or less!), so we can use the shortest
dummy cycling
2024-05-05 03:27:01 +08:00
bunnie
82be129df1 fix typo 2024-05-05 03:26:21 +08:00
bunnie
5fa955f507 fix typo, enforce alignment on the RawPage structure
I think i recall somewhere that an alignment of 16 is required
for certain structures in Rust for the RV32 target; since anything
could be put in there, let's enforce that.
2024-05-05 03:25:08 +08:00
bunnie
7ebfdf3ecd shorten boot wait 2024-05-05 03:24:50 +08:00
bunnie
62d16bb77f fix minor bugs 2024-05-04 22:07:16 +08:00
bunnie
dbd33ad220 don't commit the redacted fonts section
this is just for very early bringup to reduce blob size
and improve cycle time for experimentation.
2024-05-04 21:45:03 +08:00
bunnie
829ac28072 fixes for cramium target 2024-05-04 21:41:38 +08:00
bunnie
a6a3d29836 more warning cleanup, moving around app_uart visbility part 2 2024-05-04 01:46:05 +08:00
bunnie
721129781a cleanup some warnings 2024-05-04 01:45:36 +08:00