Commit graph

83 commits

Author SHA1 Message Date
bunnie
54c070b433 remove old comment that is no longer valid 2026-02-02 01:26:25 +08:00
bunnie
1255bf12d9 FLAG DAY: fix all names to harmonize around 'bao1x'
The code base had evolved through several code names, interim
names, company names and chip names that alternatively did or did
not exist.

Baochip is the definitive name of the company, and the Baochip1x
(full part number BAO1X2S4F-WA) is the definitivey part number of
the SoC. For convenience, the part number is shortened to 'bao1x'
in most feature flags and variable references.

This commit fixes all of the odd names and removes some unmaintained
early targets.
2025-09-18 21:25:51 +08:00
bunnie
4f14a67504 formatting changes due to changes in nightly rust
needed to get a clean check on gh
2025-02-01 22:26:40 +08:00
bunnie
043dfd84ae update formatting to latest nightly rules 2024-09-24 01:49:45 +08:00
bunnie
1d9316f9cd regex search/replace instances of xous_ipc::String to String
core xous services cluster
2024-09-22 14:18:49 +08:00
bunnie
9668179753 format services/xous-names 2024-01-14 22:57:09 +08:00
bunnie
ea2e0cfbac add cramium target to xous-names 2023-07-17 18:25:18 +08:00
bunnie
cf06035dcd emit a warning when xous-names blocks on a connect
otherwise we have a silent failure, which is a bit confusing.
2023-05-21 17:20:57 +08:00
bunnie
f2068f2c89 fix regression in xous-names blocking connect
The `libstd` implementation has a bug where it was going through
a vector and mutating it by removing items from the vector,
but not updating the indices.

This fix goes through the vector in reverse order, so that removed
items don't affect the position of the next items in iteration order.

This seems to make the blocking connect much more stable.
2023-01-31 15:06:27 +08:00
bunnie
c87ed72736 chore: fix typos 2023-01-31 01:31:15 +08:00
Sean Cross
3ca323f0bb xous-names: implement non-blocking TryConnect call
This call can be used by clients to try connecting to a service. If the
service is not available, this will fail to connect.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-11-07 18:46:02 +08:00
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
be87a92d7a select a default implmeentation for crates.io 2022-10-03 01:16:37 +08:00
bunnie
88af49eaa4 commit removoal of API features 2022-10-03 01:15:00 +08:00
bunnie
34020b4515 prep for push of xous-names implementation to crates.io 2022-10-03 01:14:28 +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
14e22d07b9 allow management token returns on servers with more than one connection
Mangement tokens were added to xous-names for the special case of
servers that had exactly 1 connection, so they could explicitly
control when they are disconnected (preventing e.g. griefing by
rogue processes).

This was a good idea except it also conflicts with the "eager TOFU"
model of Xous security when you have servers that act as plugins to
each other. Eager TOFU means Xous has a "trust on first use" model
for capabilities, and eager implies that anyone who will use
anything will claim it early on. This gives the important property
that one can ask, "has everyone eaten their TOFU?" before doing
anything really sensitive. If all the TOFU slots are used, then
you can conclude that no new rogue servers can inject themselves
into sensitive APIs and you can move forward.

In the case of a plugin API with multiple plug options, when
you unplug something, the previously eagerly occupied slot
now becomes unoccopied -- and this becomes a flag against
the TOFU check, disallowing sensitive operations to proceed.

This is *particularly* a problem with the predictive history
plugins for the IME. The architecture was created to allow
for multiple histories to be used. Up until now, only the shellchat
plugin was ever used, so, the eager TOFU check always passed.

However, in creating more applications, this flaw was uncovered
once we introduced a second plugin.

This means predictors can not delegate their security to Xous-names.
They must individually implement API tokens to control access
to the prediction history (to prevent rogue apps from e.g. connecting
to the predictor and then reading out the prediction history to
figure out what the most recent words were typed).

A subsequent commit will add the API tokens, but this commit simply
has xous-names return a mangament token even if servers with
more than 1 connection are created. The main downside of doing
this is the management token lose meaning in the context of
multiple servers; but, so long as the tokens aren't used for
anything in those situations, it's fine (cue burning building
meme).

More importantly, it allows the existing code to manage the xous-names
count to function even on a server that sets no explicit limit
on connection count, which is now going to be the case for the
prediction engines going forward.
2022-06-19 00:51:02 +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
Sean Cross
d738b9fd51 xous-names: add BlockingConnect opcode
This opcode allows a client to request a connection to the Server, and
will only return if there's an Error or a Connection.

This contains future support for AuthenticationRequests, however those
are not yet implemented.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-15 15:22:15 +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
489a26dd11 fix an issue where we don't decrement the connection counter on drop 2022-01-05 20:01:54 +08:00
bunnie
421a3814d8 clean up some warnings before moving on to further integration 2022-01-02 15:07:48 +08:00
bunnie
7f3d2e3ce3 move xous-names into standard formatting 2021-08-19 23:51:20 +08:00
bunnie
cf3ed935e7 add staging location lockout and xous-names completion checking 2021-08-10 04:30:45 +08:00
bunnie
ef671dd6a3 fix up xous-names and resolve issue #26 thanks to stdlib
also frees up about 24k of unused RAM, i'll take it!
2021-08-04 01:59:17 +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
2714c9eb13 link in some READMEs so that rustdoc pulls them in
also add some bread crumbs on the more user-facing APIs to
help beginners out. Need to do a good spring cleaning of the
rustdoc tree, though. looks pretty terrible as it is.
2021-08-01 16:08:27 +08:00
bunnie
b6c443145c extend modal functions; refactor status into its own server 2021-07-28 01:01:39 +08:00
bunnie
0f937037e4 just getting to the point of implementing defacement
menu now pops up. does nothing, but we can at least
change contexts for the Ux into a different Ux theme.
2021-06-18 16:20:56 +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
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
bunnie
21a5ddb40f sha512 hardware acceleration is working, now benchmarking
also need to extend hw implementation to sha512/256
2021-05-21 03:15:13 +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
b36865a893 add some delay on hosted mode for failed name requests
helps make startup a bit more orderly on multi-core systems
2021-05-16 01:22:25 +08:00
bunnie
a24803354c refactor xous-names to eliminate heapless
see issue #30
2021-05-08 23:34:08 +08:00
bunnie
391122823d refactor heapless version in attempt to debug issue that cropped up in xous-names
somehow, updating the toolchain has broken the FnvIndexMap implementation
2021-05-08 18:44:23 +08:00
bunnie
05df98d1c1 disable suspend/resume support in hosted mode
hosted mode doesn't have suspend/resume support, and it's
not worth debugging subtle issues on that side of the fence
that seem to be OS-dependent.
2021-05-02 16:10:51 +08:00
bunnie
20040c5e02 fix a bogus error path that primarily trips up hosted mode 2021-05-01 01:12:32 +08:00
bunnie
94505ae6c5 improve some error messages 2021-04-27 00:52:52 +08:00
bunnie
a4678ee95c remove dependency of xous-names on ticktimer; use d11ctimeout instead
this allows susres to manage ticktimer and have secured namespace
integration
2021-04-27 00:39:18 +08:00
bunnie
ca349ec1b0 clean up minor bugs and other issues 2021-04-06 22:38:11 +08:00
bunnie
9ba2fb134c refactor most major modules, but Xous now crashes 2021-04-05 23:50:00 +08:00
bunnie
25dc27f2f7 add drop implementation to servers 2021-04-02 22:01:40 +08:00
bunnie
2cb519b8ee cleanup logging 2021-04-02 17:58:20 +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
aab0bf459c update API to more compliant names 2021-04-01 16:43:22 +08:00
bunnie
dc2519c5ef trying out new API names 2021-04-01 03:47:10 +08:00
bunnie
23ae292e3d found the stupid bug 2021-03-29 05:20:21 +08:00
bunnie
c6371e86e7 fix other minor errors 2021-03-29 04:44:03 +08:00