Commit graph

57 commits

Author SHA1 Message Date
bunnie
67fc21fbdd harmonize hosted mode selection, but retain an explicit hosted flag
In general, hosted mode is assumed "by default" if the target
is not Xous. This allows packages to be built cleanly on command
lines that don't know to pass a --feature flag to specify a target.

However, an explicit "hosted" flag is still retained so that we
can confirm the build system intent. This saves us from the failure
mode that we thought we were building for target A, but accidentally
ommitted the flag, and instead we've been silently building for
"hosted" mode without any warning. The main consumer of the "hosted"
flag is now just the build.rs script inside of the utralib.
2022-10-25 17:21:02 +08:00
bunnie
4e40ae6c5d move from target selectors to feature selectors for back-ends
This will allow for e.g. xous on riscv32-imac but not a precursor
target, for example: by using feature selectors we get to have
a bigger range of targets that we support, such as for implementations
that haven't been upstreamed or have official target-triples.

The downsides are:

- patch override libraries don't absorb feature flags. so, for
example, the AES crate that is used to patch other crates won't
be aware of the target features without modifying the referencing
crates.

- features are normally meant to be additive, but target features
are mutually exclusive. The mutex is enforced by a check in
utralib that throws a panic on build if two targets are accidentally
selected at the same time.
2022-10-02 02:56:44 +08:00
bunnie
18abf7ca0a fix ordering issue in refcount increment for trng
want to add to the reference before claiming, so if
a drop happens while we're claiming we don't get
the connection being destroyed in the race.
2022-07-14 03:50:30 +08:00
bunnie
376d7a713b Merge branch 'main' into u2f 2022-05-31 14:39:08 +08:00
Sean Cross
3ae9d8abf0 apps/services: remove xous::xous_main macro usage
This macro will be removed, since it is no longer necessary. Remove this
macro across the project and replace it with a standard `main()`
function.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 13:33:30 +08:00
bunnie
268fe63cc1 Merge branch 'main' into u2f 2022-05-29 03:25:49 +08:00
bunnie
e14e6206ed include a getrandom implementation that allows us to use modern randcore
A lot of packages are depending on 0.6 api, which requires a crate
that has OS specific TRNG calls. This patch keeps the 0.5 calls
inside the TRNG crate as direct API calls, and migrates to support
a 0.6 api to a patched version of getrandom that supports Xous.
2022-05-29 02:47:51 +08:00
bunnie
844543f72d beginning of ecdsa port...need to resolve rand_core dependency
*everoyne* is relying on rand_core, a later version, that uses
a "getrandom" thing that tries to make the call for random
number generators generic.

I mean, it's kind of cool, but, it's also sort of a libc
non-pure-rust nightmare because basically it always delegates
to a C-style API for a variety of platforms.

Next step is to see if we can't...patch...getrandom to point
to a much simplified, xous-only version that is 100% pure Rust.
2022-05-28 23:38:23 +08:00
bunnie
c503316c3d refactor suspend/resume ordering
Add a "Later" stage, and have exactly one "Last" stage.

"Last" to suspend is the ticktimer -- this is crucial for
basically everything else to work. The other really
low level stuff that needs to work to the last minute is
now in the "Later" bin.
2022-03-30 02:30:39 +08:00
bunnie
827888ccbb fix up the REFCOUNT on connections
Was doing disjoint loads and stores on an Atomic, really, should
be using the fetch_add, fetch_sub variants to be proper.

Didn't seem to impact anything but maybe there's a future version
of me that high fives me for doing this.
2022-01-31 23:13:10 +08:00
bunnie
18130cddae fix suspend/resume regression
had to pin down the correct order of events to avoid lockups on suspend
2022-01-17 22:46:18 +08:00
bunnie
eb0c1c4377 fix some hosted mode brokeness that came with pinning crates
the rand api was downgraded to be in line with the ed25519 crate
which removed some "modern" conveniences. Small price to pay for
less code to review.
2022-01-10 17:13:00 +08:00
bunnie
c5fe1bc99b add sequencing to suspend/resume order of operations
this is necessary because we want to make sure that the SPINOR
service does not shut down before the PDDB service finishes syncing
its disks.
2022-01-10 13:45:56 +08:00
bunnie
489a26dd11 fix an issue where we don't decrement the connection counter on drop 2022-01-05 20:01:54 +08:00
bunnie
dd14dfc4c6 retrofit the seed into an atomicu64 so we can set it elsewhere 2021-12-27 02:49:08 +08:00
bunnie
66606ed3e0 initial attempt to make hosted mode more deterministic
replace all threadRng with a seeded Rng
2021-12-25 15:58:27 +08:00
bunnie
6360d1c902 tighten up the hard-coded locations for the trng test
these locations look good for a while, now that i see the
structure of data allocation (it's split between top and bottom)
2021-10-31 02:58:43 +08:00
bunnie
f6e91d6260 move the trng test bases to make space for more kernel 2021-10-30 03:12:58 +08:00
bunnie
fd4e047d62 move trng into the standardized formatting set with some exceptions 2021-08-20 00:00:15 +08:00
Sean Cross
b86e0a65cd services: recognize xous as a hardware OS
Support `xous` as a valid OS. This allows us to build the entire kernel
under this target.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-02 18:11:48 +08:00
bunnie
3ac17a99db reduce miniruns count to save on gates 2021-07-08 15:58:59 +08:00
bunnie
6efdb7e0db stash a version with XousEngine25519 traits in case we want it back later 2021-06-27 00:31:15 +08:00
bunnie
e8dc10977a clarify trng hosted mode messages, reduce noise 2021-06-21 22:21:40 +08:00
bunnie
eee9f4e765 refactor xous-names to permit only a fixed number of connections
this prevents less trusted processes from connecting to servers
after the kernel initializations are done.

this works so long as we don't have disconnects from the kernel
servers. In order to support disconnects we will also need a
way to re-enumerate the SID to guarantee that we don't have a re-use
problem. But for now, the kernel is not designed with any practical
disconnect mechanism; there is no code that calls the Quit mechanism
on any server.
2021-06-15 17:41:14 +08:00
bunnie
0db9ad9e6f add status bar extension to inform of security states
- inverted text indicates a trusted message. policy is enforced in the GAM.
- we don't have a way to lock the USB port yet; but at least now it's communicated.
2021-06-13 04:40:50 +08:00
bunnie
943c07e38b improve richness of error feedback from trng 2021-06-12 15:12:44 +08:00
bunnie
ad72c0ee7d update trng test ram locations
we're starting to fill up enough memory that we have to relocate
these buffers
2021-06-12 01:49:56 +08:00
bunnie
77cd652a0e minor bugs/typos in urandomtest path 2021-06-11 16:45:53 +08:00
bunnie
a70b858812 convert to using the urandom interface 2021-06-11 16:29:25 +08:00
bunnie
abbd1574e5 add trng test and management commands 2021-06-08 21:29:23 +08:00
bunnie
2174ab7677 upgrade TRNG with health tests and reporting facilities 2021-06-08 01:22:07 +08:00
bunnie
fadc9c29ab Merge remote-tracking branch 'origin/master' into bunnie-dev 2021-06-02 03:59:25 +08:00
bunnie
58edcc56f2 sha512 tests fully implemented, working through sus/res
note: sha512 will fail if a suspend is forced upon it!! but
it will vociferously complain if this happens.
2021-05-21 15:56:58 +08:00
Sean Cross
eb7895d601 xous: add a return code to TerminateProcess
As part of this refactor, make `terminate_process()` a divergent call.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-20 11:01:00 +08:00
bunnie
46fa8fa01e extend shellchat to allow for multiple callback registrations 2021-05-07 16:22:06 +08:00
bunnie
a55735fb1f add llio to suspend/resume set 2021-04-29 23:15:47 +08:00
bunnie
19847f8fd4 add suspend/resume to the TRNG 2021-04-29 17:24:31 +08:00
bunnie
3fe52b31c5 add some debug for the trng CI process 2021-04-27 01:37:58 +08:00
bunnie
e5343bceb9 retrofit system to use the new device-based CSR image 2021-04-20 19:27:29 +08:00
bunnie
ec2a87e306 make TRNG testing variants easier to configure 2021-04-20 03:21:53 +08:00
bunnie
ca349ec1b0 clean up minor bugs and other issues 2021-04-06 22:38:11 +08:00
bunnie
8c12dbe2af found a bug. 2021-04-06 01:52:26 +08:00
bunnie
9ba2fb134c refactor most major modules, but Xous now crashes 2021-04-05 23:50:00 +08:00
bunnie
659b050c0e put the borrow in the right place :-/ 2021-04-04 02:17:14 +08:00
bunnie
8786b6db7b should be borrowing the name server object to make connections 2021-04-04 02:15:29 +08:00
bunnie
25dc27f2f7 add drop implementation to servers 2021-04-02 22:01:40 +08:00
bunnie
da255cc1ab use macro expansion for argument extraction of scalars 2021-04-02 15:38:38 +08:00
bunnie
5a6ce66d7e clean up log messages now that we can identify the logging source 2021-04-02 03:10:13 +08:00
bunnie
68b9addd45 redo ticktimer/trng to use the new convenience functions 2021-04-02 02:45:00 +08:00
bunnie
fe2a464dd2 cleanup warnings in trng server 2021-04-02 01:56:22 +08:00