Commit graph

6955 commits

Author SHA1 Message Date
bunnie
e5dfd14daa fix bugs found by rustc
thanks, rustc, for finding these bugs!

this is why we cleanup warnings regularly.
2024-04-29 04:08:52 +08:00
bunnie
0131315e3a cleanup trng warnings -- it's going to be a while before this is fixed
I think I may have to be patient on waiting for docus on how to
tune the trng, so, turning off these warnings for now. trng tuning
will be "an event", I expect.
2024-04-29 04:07:52 +08:00
bunnie
39cf50aad6 cleanup unused vars, stripped out in previous edits 2024-04-29 04:07:28 +08:00
bunnie
7af47ec260 cleanup warnings, remove dead code 2024-04-29 04:07:08 +08:00
bunnie
f86b51a3b2 cleanup warning 2024-04-29 04:06:52 +08:00
bunnie
779d3c7c19 add pio elements to loader in lockfile 2024-04-29 03:45:03 +08:00
bunnie
506bcdc7b9 add pio tester feature flag 2024-04-29 03:44:46 +08:00
bunnie
431ca216f9 improve visibility of hal elements 2024-04-29 03:43:03 +08:00
bunnie
0adb20b3d8 add a test stub for the quantum timer in the loader
a little easier to do low level peripheral testing here than in
the kernel
2024-04-29 03:42:34 +08:00
bunnie
fa242696e5 fix the quantum timer service 2024-04-29 03:41:15 +08:00
bunnie
cb43368e7a add the quantum timer feature by default to the cramium config 2024-04-29 03:40:47 +08:00
bunnie
4926e61fec cleanup mut warning 2024-04-28 02:57:44 +08:00
bunnie
e3e3b3125c cleanup warnings 2024-04-28 02:57:24 +08:00
bunnie
863f17652d broaded scope of conditional compilation 2024-04-28 02:57:04 +08:00
bunnie
588e1cf9f1 add some debugging, convenience routines to trng driver 2024-04-28 02:44:10 +08:00
bunnie
fcf3dfb4cd adjust serial port for console 2024-04-28 02:43:43 +08:00
bunnie
07c9890919 fix location of kernel; attempt to debug loader 2024-04-28 02:43:11 +08:00
bunnie
36534b4e3a frequency now confirmed 2024-04-28 02:42:18 +08:00
bunnie
c57debcf1c adjust location of fontmap to match latest build 2024-04-28 02:41:58 +08:00
bunnie
ecf2396d0c put debug prints behind debug flags 2024-04-28 02:41:29 +08:00
bunnie
ced0b09881 add the console app to the default build 2024-04-28 02:41:06 +08:00
bunnie
c491c63e42 add PLL computation code 2024-04-27 22:24:27 +08:00
bunnie
2702b94c93 include signature block in kernel offset constant 2024-04-26 18:20:14 +08:00
bunnie
d85ff12ca2 rework the kernel offset 2024-04-26 18:19:59 +08:00
bunnie
6c2cb85a44 make sram-margin and boot delay feature flags 2024-04-26 18:16:56 +08:00
bunnie
a781b2e15d start to lay in code rework for booting on real chips 2024-04-26 18:16:12 +08:00
bunnie
05d2f3d6a9 configure boot addresses 2024-04-26 18:15:05 +08:00
bunnie
9d2218488b add jump past signature block
Make the first word in the signature block a jump past the block
this is for the cramium target, where the best memory efficiency
happens if we align the data to the bottom of the memory. This
means that the signature block ends up "in the way" of the boot
process, because the reset vector can only be configured to something
on a 16k-page boundary (e.g., we'd waste 15k of memory without this).

This will require some reworking of the existing code base for
checking signatures down the line.
2024-04-26 18:13:06 +08:00
bunnie
8746fc5a76 add --with-jump flag for image creation of cramium target 2024-04-26 18:12:47 +08:00
bunnie
c407db877e change DUART ports to accommodate jtag breakout 2024-04-22 11:00:06 +08:00
bunnie
73c834d067 start debugging of swap in kernel
switching contexts to bringing up hardware.
2024-04-22 10:58:37 +08:00
bunnie
c8f104326a Merge branch 'swap-kernel' of github.com:betrusted-io/xous-core into swap-kernel 2024-04-09 18:54:49 +08:00
bunnie
d0bb39c4ab add debugging to kernel while we work out the issues 2024-04-09 03:54:31 -07:00
bunnie
c8986c40cc
Merge pull request #529 from betrusted-io/fixes
chore: CI fixes
2024-04-09 03:53:28 -07:00
bunnie
799d1554ae chore: CI fixes 2024-04-09 18:51:36 +08:00
bunnie
0f8fabb0b2 add debugging to kernel while we work out the issues 2024-04-09 18:29:38 +08:00
bunnie
fe0fe0edef
Merge pull request #524 from betrusted-io/swap-image-loader
WIP: Swap image loader
2024-04-09 03:27:57 -07:00
bunnie
4ace363abc this resolves comments from @xobs' code review 2024-04-09 18:23:09 +08:00
bunnie
336e47eabe remove comment 2024-04-09 15:46:48 +08:00
bunnie
6735312444 add some more asserts & checks; undo kernel load last patch
kernel load last isn't necessary

add some asserts to help sanity check things. In particular,
the kernel mapped memory can't exceed 0xA000 in length, otherwise
it bumps into hard-coded constants in the kernel for where hardware
mapped pages should go (i.e., panic framebuffer, debug UART, etc.)
2024-04-09 15:30:21 +08:00
bunnie
d367c99a1f fix page mapping; allow kernel to load in arg order; swap_root breakout
Page mapping just can't be done during the phase 1 loading, because
we move the loading point by an unpredictable amount which messes
up phase 2. I mean, we could try to predict the amount, but it's easier
if we just stick with the current algorithm instead of trying to
do both at once. Basically, phase 1 must be "no-alloc" entirely
as it copies.

Phase 2 can allocate page table entries, because all the data
is copied to RAM and you know where that starts; and you can start
to append data to the end of that without affecting the loading
points of programs.

Undo a previous patch to force kernel to load last. Turns out
this is legal, it was only problematic because of other bugs.

Also, reflect swap_root in the BootConfig structure and not
in InitialProcess structure.

+ Various other debug fixes
2024-04-09 15:26:38 +08:00
bunnie
8c82d710bb reflect swap offset patches in atamsam5d27 arch 2024-04-09 15:25:59 +08:00
bunnie
8abb126577 break out swap_root & improve debug 2024-04-09 15:25:37 +08:00
bunnie
a66e4f5901 modify stack smash check to detect if non-PID is written
this is more robust, and should work across all architectures.

Note that the reliability of the check is slightly impacted
since we're now checking for a subset of valid numbers, so
the number of bytes checked is doubled.
2024-04-09 15:24:22 +08:00
bunnie
d6e7f7ce16 add debugging and asserts to detect stack smash in loader
In swap configuration, the loader does a lot more: it has
to decrypt full pages of RAM and hold them temporarily;
up to two pages at once, once for the decrypt of the source
swap image, and one for the encrypt to swap memory.

This causes a lot more stack to be used than the original loader.

Add some debugging for this, and an assert based on a heuristic
that the RPT (runtime page tracker) last few entries ought to
be 0. This I think is probably true on most platforms. If this
fails to be true, then, we can probably modify the assert to
fail if any number in the RPT is greater than the number of
processes: this should be true in *all* cases, but a stack smash
is very likely to write something in there that's larger than
the number of allowable processes in the system.
2024-04-09 15:17:49 +08:00
bunnie
630a81b185 we need more stack to decrypt memory in the loader. 2024-04-09 15:17:21 +08:00
bunnie
30202d962c don't build swap_root into the InitialProcess structure
the kernel doesn't use it, so it just ends up being wasted
space.
2024-04-09 15:16:26 +08:00
bunnie
9992d29b40 chore: cleanup warning in non-swap mode 2024-04-09 00:06:18 +08:00
bunnie
d318134bdc fix default flags for swap; add load checking for swap
load checking is aware of all three types of sections, and
can natively call the encrypt/decrypt ops to ensure that
the encrypted swap is set up correctly.
2024-04-09 00:04:47 +08:00
bunnie
62f1ad09f0 ensure that the kernel is loaded last, even after argument extension
The kernel is supposed to be loaded last, but, when we append
arguments that isn't true anymore. This fix makes sure the
kernel is loaded last.
2024-04-09 00:03:48 +08:00