Commit graph

88 commits

Author SHA1 Message Date
bunnie
29ce54635b actually, make hosted the default implementation for crates.io 2022-10-03 00:03:10 +08:00
bunnie
88b059c560 add a default impl so packaging doesn't barf 2022-10-03 00:02:27 +08:00
bunnie
c0b6738b69 prep log server for upload to crates.io 2022-10-02 23:59:34 +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
fb29c9b2c1 refactor utra target line to use explicit feature targets
still need to rework the crate feature selection
2022-10-02 02:20:03 +08:00
bunnie
ecab0ba045 fix default-features in services 2022-09-27 02:44:46 +08:00
bunnie
d667d7e1f5 bump xous-ipc version 2022-09-27 01:14:43 +08:00
bunnie
f188e0f866 re-bump xous-ipc to 0.9.9 2022-09-26 16:50:38 +08:00
bunnie
d10683d29f contemplating splitting log-server itself into a crate, just to see what happens... 2022-09-26 14:58:05 +08:00
bunnie
114d60bc53 migrate logserver API to external package 2022-09-26 14:06:46 +08:00
bunnie
6811e23f20 remove unused/outdated artifacts 2022-09-26 11:26:03 +08:00
bunnie
e32ea4d3f5 fix #174 2022-06-10 21:36:53 +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
f0f1b72e0c log-server: refactor to use stack-allocated buffers
Instead of having a single, shared buffer, simply stack-allocate the log
buffers.

This paves the way in the future to allow for buffers that are
larger-sized and span multiple pages. But most importantly it alleviates
inter-thread locking and contention when passing messages.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-23 12:46:20 +08:00
Sean Cross
234c169809 log-server: allow maximum-length buffers to be printed
Previously, we would reject buffers that were the maximum allowed size.
This is reported in #141.

Allow these maximally-sized buffers to be printed, since they don't end
up causing a problem.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-23 12:45:27 +08:00
bunnie
faa51908d7 maybe, just maybe...we finally have version info baked into the kernel correctly. 2022-01-31 23:02:32 +08:00
bunnie
ea31f54a79 console escape codes working better
just couldn't let it go. figured out the issue is a race condition
in how the Litex UARTs are constructed...I don't know how Litex
normally handles this kind of situation but they have this funky
construction where reading the fifo doesn't advance it, you have
to...clear the pending bit. I think it was meant to be a "clever"
thing that saves an instruction or something like that since you
always have to clear the pending bit.

Anyways, the previous incarnation of this loop checked to see
if the pending bit was set again and if it was it'd run back
and fetch another character. This turns out to be a bad idea
because the pending bit goes through a multireg and other stuff
before it's readable which means it has a lot of delay on it.
This leads to a race condition.

This version actually checks if the fifo is empty and if it isn't,
it reads the character *and* pumps the pending bit (because
the FIFO doesn't auto-advance when you read it, you have to clear
the pending bit).

This works a lot better, but it's not at all well documented how
this works and it's very hard to tell from reading the source code
because it's written using really fancy migen abstractions that
are also poorly documented and have a lot of cursed constructions.

Anyways. At least the console doesn't die now when you type
a control character, *but* you do have the problem that the
escape codes get mis-interpreted sometimes. If it really really
becomes important later on to fix that it would involve tracing
out the sequence of keys that arrive at InjectKey and figuring
out if things are coming out of order or what is triggering the
bad escape codes.
2022-01-28 04:21:40 +08:00
bunnie
9cfffb18e9 some minor fixes to the console debug system to make it more consistent
there is still some mysterious problem involving a race condition
of the raw hardware console UART Rx path deciding it doesn't want
to report new characters anymore to the interrupt handler that
is triggered when multi-byte sequences are shoved down the
pipe. So long as you're typing simple commands it's fine, but
escape sequences tend to lock things up. I don't think there's
enough ROI to continue investigating this facility.
2022-01-28 03:36:14 +08:00
bunnie
226281c138 clean up commented out things 2022-01-25 16:39:45 +08:00
bunnie
e55154be69 add version info for ~~xous~~ to the shellchat command
this took...way too long to figure out. Latest versions
of `vergen` for whatever reason seem totally broken for
my build hosts.
2022-01-25 16:37:50 +08:00
bunnie
b3788a54af clarify the dependency policy 2022-01-10 16:50:10 +08:00
bunnie
995915ed4e nail down a couple more dependencies, and add a policy note to Cargo.toml
Each Cargo.toml now includes a comment which remnids maintainers
of the dependency policy for Xous (that is, nail down every dependency
to the minor number).
2022-01-10 15:54:27 +08:00
bunnie
dd943c5416 pin down versions and harmonize versions across servers
Versions are pinned down to the minor number. Yes, this means that
we don't automatically pull in features and bug updates from crates.io,
but it also means we don't pull in new attack surfaces and code that
hasn't been tested or reviewed. I'd like this process to be very deliberate
and not automatic for Xous.

The `rand` crate is almost pinned down to a single version, except
for an odd dependency that's pulled in by hosted mode that depends
on rand 0.8.4 via a subordinate dependency via the `tempfile` crate.
Pondering if it's worth it to try and eliminate that, because the
0.8.4 version doesn't get compiled into any version that touches
real hardware. It just makes it harder to analyze the Cargo.lock
file, mostly. I think I'll leave it as-is.
2022-01-10 15:39:55 +08:00
bunnie
e06d946bcd simplify error handling code
confirmed that ignoring the error on a write is probably what we want --
it will truncate the string
2021-10-10 20:55:54 +08:00
bunnie
5fa8f2a6a3 discard errors on log write
this at least removes a panic that crashes processes. it does
mean that some log messages can get silently lost, but this is
better than crashing if the arguments to the logger can't be
parsed for some reason?
2021-10-10 18:32:00 +08:00
Sean Cross
e38366c99a log-server: refactor to remove rkyv and custom Strings
This removes all custom string formatting from the `log-server`.

This should improve performance, because we're not roundtripping between
various archive formats. We instead do a single copy and operate
directly on that buffer. We also now write bytes directly, as opposed to
creating intermediate strings.

This fixes a memory issue that was introduced recently.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-11 10:59:31 +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
Sean Cross
a99839ecd6 xous: mark MemoryRange fields as private
Mark the private fields in a `MemoryRange` struct as being private. This
allows us to perform operations on the memory range armed with the
knowledge that the entire range is valid and unaliased.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:41:16 +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
Sean Cross
ca1b9aa35c log-server: fix implementation of stdout/stderr
The buffer was incorrectly sized.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 20:56:32 +08:00
Sean Cross
b13b458b11 log-server: validate operation with libstd
This makes minor changes to the panic behavior when operating with a
libstd client.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 14:12:01 +08:00
Sean Cross
a8e9492560 log-server: implement opcodes and stdout
This allows the log server to support various opcodes, and gives us
stdout as a suitable command.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-12 21:22:15 +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
b17753ce8b retrofit the rest of the servers for suspend/resume
we can now do suspend/resume in the xous chat!
2021-05-02 01:38:44 +08:00
bunnie
ac40075140 add keyboard input via UART 2021-04-16 04:11:25 +08:00
Sean Cross
ac9570a767 log-server: remove UB in log server init
Previously, the log server would call `setup` on an uninitialized
struct. This is very undefined behavior, and risked running into
optimization errors.

This reworks the log server such that the singleton is protected by a
`None` value that gets initialized.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-04-12 17:47:26 +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
44899d073e clean up some efforts to fix log trace level 2021-04-04 18:25:53 +08:00
bunnie
6d4916972b keyboard refactor now working 2021-04-04 18:23:26 +08:00
bunnie
7210f100f4 upgrade log server to pass rich message types 2021-04-02 01:54:17 +08:00
bunnie
85fdb7453d remove unused code 2021-04-01 17:24:13 +08:00
Sean Cross
fdce58d06e ipc: convert project to use xous-ipc
This rewrites the entire project so that most runnable projects now use
`xous-ipc` instead of `xous::String` where possible.

This also removes `rkyv` from the list of dependencies in `xous-rs`.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 20:22:33 +08:00
Sean Cross
4cbfe5f90f services: log-server: use create_thread_1()
This moves away from the deprecated `create_thread_simple()` call.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:54:22 +08:00
bunnie
835bee2c75 lay in foundations to support the sleep function 2021-03-11 01:45:54 +08:00
bunnie
9a2bce24cb clean up timing and cosmetic issues on status updates 2021-03-02 21:47:23 +08:00
bunnie
4b0f50293f another intermediate commit 2021-03-02 21:15:40 +08:00
bunnie
4640dc404f make panic messages a bit more helpful 2021-03-01 13:45:36 +08:00
bunnie
463e2ad77d fixup GAM APIs to latest rkyv standard, fix drawable computation 2021-02-26 03:37:48 +08:00
bunnie
5b80b3fb42 get fcc-agent working again 2021-02-23 04:01:01 +08:00