Commit graph

511 commits

Author SHA1 Message Date
Sean Cross
f20e809d8c xous: add AdjustProcessLimit syscall
This syscal will be used to adjust various process limits. Currently
it only contains the ability to adjust the heap size and maximum.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-24 00:09:34 +08:00
Sean Cross
ed4763c714 xous: correct comments on IncreaseHeap and DecreaseHeap
These were behaving differently from what they were documented to do.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-15 12:35:05 +08:00
Sean Cross
f4f5418190 xous: envelope: handle MemoryReturned in forward()
Previously, we only handled messages that were forwarded. With this
patch, we also handle memory messages that were returned.

This fixes #165

Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-09 17:50:21 +08:00
Sean Cross
803667ba28 xous: add a small comment to nameserver
Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 14:51:21 +08:00
Sean Cross
2e516abd64 xous: bump to rust-2021 and version to 0.9.8
Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 13:45:14 +08:00
Sean Cross
4ed3b201d0 xous: remove xous::xous_main macro
This macro is now unused, and does not serve a purpose. Remove it to
improve build times.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 13:41:48 +08:00
Sean Cross
dd02fce340 xous: remove nearly all dependencies
This removes nearly all of the dependencies from `xous-rs`, making it
mostly self-contained.

There is one remaining dependency tree which is `xous-macros`. This is a
legacy feature from before a time we had main(). Attempts will be made
to remove it as well.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 12:29:23 +08:00
Sean Cross
58dd02c282 xous-rs: remove log, hex, and debug-here deps
The `xous-rs` library is used in many places, and should have as few
dependencies as possible. Remove these as dependencies.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 11:20:08 +08:00
Sean Cross
1d3cf25518 xous: remove hardcoded addresses from create_process_pre
These addresses were hardcoded, even after they became available from
the process args.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-30 11:27:17 +08:00
Sean Cross
93b6d9f2c5 Merge branch 'main' into spawn
Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-30 08:13:59 +08:00
Sean Cross
884edfb36d xous: process: specify stack, entrypoint, and base
Specify both the stack range and the process entrypoint, as well as the
load address of the text image.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-29 18:45:25 +08:00
Sean Cross
2e69ae8a12 spawn: compiles, but does not work yet
Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-28 05:10:48 +08:00
bunnie
4d1d132233 add a first-pass at what hardware CI automation strings might look like 2022-05-24 02:22:36 +08:00
bunnie
ca275308ef Merge branch 'usbdev' into main 2022-05-17 02:31:10 +08:00
bunnie
0aa2f21f0b make scheduler quantum a visible parameter, and adjust to 10ms down from 20ms 2022-05-12 17:49:03 +08:00
Sean Cross
d8eb7be352 process: finish implementing ProcessStartup as return
We now us `ProcessStartup` as the return type. This builds in tset
mode, hosted mode, and RISC-V mode.

Process Startup is still not implemented for RISC-V mode.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-28 22:43:42 -04:00
Sean Cross
5c4e76be2d test: get test building again -- it still fails
Get test to the point where it builds. There's still an odd timeout
issue we're running into, however.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-28 22:13:51 -04:00
Sean Cross
f031c0c25e xous: break ProcessStartup into its own type
This will be used when we launch a new process.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-28 22:05:14 -04:00
bunnie
9768503087 Merge branch 'main' into usbdev 2022-04-25 18:44:37 +08:00
Sean Cross
617e075c08 xous: handle forwarding of BlockingScalar messages
These are not automatically returned on their own, so handle the return
manually.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:52:09 +08:00
Sean Cross
7d8ff07caf xous: use the alloc API for allocating memory
Don't rely on the trick where we use a `Vec<u8>`. Call the `alloc` API
directly for all packet types.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
c956cb7da5 xous: add Envelope.forward() to forward messages
Messages should be able to be forwarded from one Server to another. This
is a wrapper around the machinery that would do that.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
d8a413b7c2 xous: add take_message() and send() calls to the envelope
Add a function to enable "regifting" a message that was sent to you.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
04e91b8c44 xous: messages: add set_id() to set Message ID
Allow setting a message's ID by adding a `set_id(&mut self, ...)`
function. This can be used when regifting a message.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
ddd7c6715a xous: hosted: use Vec as a memory backing
Use a `Vec<u8>` as a backing for memory across the entire project.

Previously we used `Vec<u8>` as a backing for MemoryMessages and used
`alloc` for all other messages. This unifies that to always use
`Vec<u8>`.

I'd prefer if we used `alloc` instead, however that has not been working
and I'm not sure why. Standardize on this for now and look into why
later.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
2084a9cda4 xous: split messages into a sub-module
The `Messages` types were getting hairy, and `definitions.rs` was really
long. Trim it down by moving types into their own files.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
bunnie
b58b8df398 add a maintainer's note 2022-04-22 02:43:49 +08:00
Sean Cross
e13bb426e3 xous: additional documentation on server errors
There are multiple reasons why a process might fail to create a new
server. Add notes on why this might be.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-05 12:45:03 +08:00
Sean Cross
9c68eb005a xous: definitions: update doc on Message.(valid|offset)
These fields are advisory, and may be repurposed to other uses.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-02 09:10:42 +08:00
Aaron Bieber
6f98940189 Switch to using env to find the path to bash.
Systems like OpenBSD and NixOS have bash in different locations. This
allows the various scripts to be run on those systems.
2022-03-28 16:43:47 -06:00
bunnie
64ad28cb18 quiet down hosted mode debug messages 2022-03-28 14:44:05 +08:00
bunnie
4f9ff8fb11 revert the locale 2022-03-11 18:59:46 +08:00
bunnie
c44f794dfe baseline before moving onto the next stage 2022-03-11 00:03:31 +08:00
bunnie
70b329f129 oops fix locale for push to main 2022-03-10 23:49:37 +08:00
bunnie
e8b13fcb44 integrate TTS into more dialog boxes and modals
also tighten up the `blocking` method for TTS for prompts that
absolutely should not be truncated or overriden.
2022-03-10 23:40:35 +08:00
Sean Cross
8b38663ad1 xous: remove impl Default for MessageSender
This is redundant and is removed at the suggestion of clippy.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-03 22:37:55 +08:00
Sean Cross
80df40d8fa xous-rs: implement UpdateMemoryFlags syscall
Implement this syscall and create a wrapper function
`update_memory_flags()`.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-07 13:37:23 +08:00
Sean Cross
3380a0e0ed xous: syscall: document returns of more syscalls
Add more documentation to various syscall returns.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-07 11:23:55 +08:00
Sean Cross
3355155445 xous: definitions: mark MemoryRange members as pub(crate)
Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-07 11:22:32 +08:00
bunnie
30910dbd4f add keyboard layout setting and retention
Keyboard setting is "the one and only" exception to user settings
that are saved without encryption. This is because you need your
keyboard layout to be set in order for you to type your password.
Thus, this needed a bit of a special-case to handle its storage record.

We decided to lop off 1 page from the loader and have it store
the keyboard layout code.

Let's hope we can have the discipline to really just store that
one word of information and not later be like "gee wally, you have
a whoooole 4092 unused bytes of space we can cram unencrypted
user settings in, sure would be a waste to not put those use those".
2022-02-03 02:46:37 +08:00
bunnie
002e098538 Fix issue #90
Turns out we didn't end up needing this capability, so, commenting it
out because it is a shy too powerful and is like packing a live
mortar shell in a storage unit: eventually, someone is going to
get hurt, even though it seems mostly harmless at the moment.

Code just commented out in case we need this feature in the future,
but, the main reason it was asked for (the PDDB) was accomplished
without it.
2022-02-02 00:37:57 +08:00
bunnie
797e5bd7c4 follow-on set of commits related to the previous revert 2022-01-17 23:52:58 +08:00
bunnie
80bf673731 massage the loader to work
however -- it is now very slow
2022-01-17 01:10:41 +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
fec180890b nail down dependencies in the related build toolchain flow
these are secondary attack surfaces -- code that isn't directly
in the kernel, but involved in the manipulation, handling, grooming
and preparation of source and binary files
2022-01-10 15:49:30 +08:00
bunnie
b3b6a9e8ec fix error in new length constant 2022-01-10 01:22:33 +08:00
bunnie
9a34de0065 rework flash memory locs; add command for re-creating a factory new device 2022-01-09 22:33:36 +08:00
bunnie
0a4c77520d fix test compilation issue 2022-01-08 00:46:59 +08:00
bunnie
ef6e45658a add comment to remind about alignment requirements of regions 2022-01-04 11:37:06 +08:00
bunnie
afd1086cda commit unsaved changes meant to be part of previous commit 2021-12-27 12:32:18 +08:00
bunnie
1fab068296 add seed setting from the XOUS_SEED environment variable 2021-12-27 12:29:29 +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
809dbbdbc2 fix a bug in the reserved amount of data in large keys 2021-12-26 16:29:35 +08:00
bunnie
0bd110c163 determinism achieved for testing. now to squash some bugs. 2021-12-26 01:50:30 +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
56e82f37d3 more thoughts on the pddb.
this is definitely a rough-draft implementation and is going to
need a v2 or v3 to plug all the serious holes.
2021-11-05 03:58:58 +08:00
bunnie
1e6134dc37 fix loader offsets after Rust 1.56 made things grow a bit.
hopefully this is the last of the "the compiler grew it" code extensions?

....
2021-10-28 22:52:39 +08:00
bunnie
c0ce66ee51 fix permissions. windows is sort of stupid and makes everything +x 2021-08-19 23:34:29 +08:00
bunnie
2a2c75f420 add a rustfmt.toml and run rust fmt on the project
notably directories written by bunnie are excluded.
2021-08-19 23:33:23 +08:00
Sean Cross
83f88f6fde xous: hosted: improve performance by removing a copy
Remove one copy step when receiving packets. This should improve
performance of Hosted mode by around 1.5x.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-18 18:22:07 +08:00
Sean Cross
7dee05082c xous: syscall: add function to modify memory ptr
Add a function to modify the pointer of a MemoryRange. This is used by
`hosted` mode in order to modify memory pointers when we receive them
from the remote client.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-18 18:21:19 +08:00
Sean Cross
034ab9a04c xous: test: fix unnecessary mut warning
This fixes a warning in test builds where a field was marked as `mut`
that didn't need to be.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 15:08:04 +08:00
Sean Cross
d705d6d14e xous: handle new syscall naming
The syscall function is now exported by the arch, rather than being a
magic name.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:23:59 +08:00
Sean Cross
c15cd45d64 xous: hosted: set the thread ID to 1 at startup
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:23:33 +08:00
Sean Cross
d126108412 xous: renamed WouldBlock to RetryCall
This gives a better idea of what this syscall does.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:22:24 +08:00
Sean Cross
1d0a952331 xous: hosted: redo control flow with condvars
This completely redoes the client-side of syscalls such that there is a
lot less lock contention. Processes now properly sleep rather than
spinning, unless they're waiting for a response due to a blocked server,
which rarely happens in practice.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:20:47 +08:00
Sean Cross
23ce9e5bf0 xous: arch: look for feature flag for tests
When running tests, `processes-as-threads` gets enabled. Look for this
feature flag to determine if we need to use that architecture.

Note that this change requires `resolver v2` to be enabled.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:19:53 +08:00
Sean Cross
5efe76f490 xous: arch: fix interface for test arch
Fix the interface for the `test` arch due to changes with the other
platforms.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:18:15 +08:00
Sean Cross
b17be29195 xous: make processes-as-threads a feature flag
The test module uses this feature to avoid having to spawn external
processes. Make this a feature flag since it doesn't make sense for any
other target.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:16:27 +08:00
Sean Cross
ae97ca4e14 xous: move rename native arch to riscv
This will enable adding more architectures later.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:16:06 +08:00
Sean Cross
c72ffc3dd4 Merge branch 'main' of github.com:betrusted-io/xous-core 2021-08-16 09:56:31 +08:00
bunnie
a19fc87687 clean up warnings, and fix some hosted mode issues 2021-08-15 00:46:16 +08:00
Sean Cross
dbbf85255d xous: split test into its own arch
The `test` arch works with TLS and allows for multiple servers and
processes per "process".

This is a special case, and warrants its own arch.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-13 09:30:08 +08:00
Sean Cross
32eb3c202c xous: add exception handler support
This has been tested end-to-end. We now have exception handler support.

There is a potential issue when passing messages to our own process in
an exception handler. This will need to be investigated.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-06 17:48:17 +08:00
Sean Cross
5dbf6a9964 xous: definitions: derive Debug on ExceptionType
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-06 12:35:55 +08:00
Sean Cross
b3cb5ff40a xous-rs: remove all remaining clippy warnings
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-06 12:21:24 +08:00
Sean Cross
c2bc966020 xous: locale: remove unnecessary &static lifetime
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-06 12:04:41 +08:00
Sean Cross
e900912e58 xous: stringbuffer: fix clippy warnings
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-06 12:04:21 +08:00
Sean Cross
d7a9b64d82 xous: add SetExceptionHandler syscall
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-05 16:59:06 +08:00
Sean Cross
5fcfd6a2aa xous: don't allow mutable slices from immutable ranges
If a MemoryRange is defined as immutable, don't allow `as_mut_slice()`
to be called. This is an API-breaking change.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-05 16:58:20 +08:00
Sean Cross
66005b8b6f xous: fix various clippy warnings
This stylistic cleanup fixes several clippy warnings.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-05 16:57:48 +08:00
Sean Cross
757a5c0f5e xous: add definitions for Exception handlers
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-05 16:17:47 +08:00
Sean Cross
95a70ba25f xous-rs: support riscv32imac-unknown-xous-elf
This target triple adds Xous as a recognized OS.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-02 18:10:31 +08:00
bunnie
b6c443145c extend modal functions; refactor status into its own server 2021-07-28 01:01:39 +08:00
bunnie
4affdabc73 password modal box now nominally works 2021-07-27 17:30:37 +08:00
bunnie
1a65cd3389 password dialog box basic layout is kind of there
a little ugly, but...this has already taken too long.
2021-07-27 04:40:12 +08:00
bunnie
53f35f9928 intermediate work toward getting the password box going
lots of changes, maybe finally getting out of the UX rathole now
that basic localization is in place
2021-07-26 00:51:22 +08:00
bunnie
806451fa0f add locale docs and move locale def file to an autogen-friendly location
CI will need to do an auto-build to generate different locales
for users to download/install.
2021-07-26 00:05:10 +08:00
bunnie
2b57e1c4f8 add static localization 2021-07-25 23:46:03 +08:00
bunnie
5280d232e5 figuring out which way is up on the RootKeys implementation 2021-07-21 19:47:09 +08:00
bunnie
01d3455a16 Merge branch 'main' into bunnie-dev 2021-07-18 12:33:16 +08:00
bunnie
8cb4362824 trying to merge...what are all these changes? 2021-07-18 12:31:29 +08:00
bunnie
91fe69ca27 add some real-hardware tests for spinor writes
definitely still bugs.

need to sleep on it.
2021-07-18 02:36:31 +08:00
bunnie
cc0f37a80e rewrite the spinor services
- you can only "patch" regions of memory. caller provides a slice
to the region of data they are patching, so that patches can be
computed by the lib-side code of the server.

- erasing is done with a "patch" with all 0xff's as the write data.
a sequence of pure 0xff for a page does not actually cause a write,
the condition is detected and the write is skipped after an erase.

- patches attempt to be somewhat intelligent and not re-write unchnaged
data, or erase blocks that don't need udpating. However, if a user
submits a "sparse patch" with just a couple bytes modified in a
megabyte region they can expect bad performance. Ideally, in that
scenario, each of the smaller modifications are submitted as
individual calls to the patch function, instead of regurgitating
all the data and hoping that hthe patch function does some intelligent
diffing to be as light-fingered as possible about updating the flash.

In other words, the onus is on the calling server to format
patches intelligently. The patch server does only the simplest,
safest optimizations. You don't want to be shuttling megabytes of
redundant data anyways between servers for many other reasons....!
2021-07-17 02:04:22 +08:00
bunnie
7e7ae82156 pivot spinor implementation
realizing some core assumptions were wrong, so, scrapping and
restarting
2021-07-15 23:00:50 +08:00
Sean Cross
7b7be0fe9e hosted: fix MemoryRange refactor
This fixes the MemoryRange refactor where `.addr` and `.size` are now
private fields.

Previously it had only been tested on baremetal mode.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 18:02:28 +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
023918082b xous: add as_slice() and as_mut_slice() to MemoryRange
Add functions to obtain various slices from a `MemoryRange`. These
functions are safe because we know that the memory in the range is
valid, and we know the size of the type.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:02:47 +08:00
Sean Cross
977a175bb5 xous: mark MemoryRange::new() as unsafe
This function allows for creating arbitrary memory ranges. Mark this
function as `unsafe` in order to warn users that this can be used to
create invalid memory regions.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:02:02 +08:00
Sean Cross
80860f0a51 Merge remote-tracking branch 'origin/main' into debugger 2021-06-21 13:22:51 +08:00
Sean Cross
13204d1714 Merge branch 'master' into debugger
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-18 10:56:30 +08:00
bunnie
799bae0386 Merge remote-tracking branch 'origin/master' into ux-refactor 2021-06-16 18:38:50 +08:00
Sean Cross
00e9ead818 xous: definitions: dispose of Vec on hosted
When running on Hosted mode, reconstitute the Vec and dispose of it
rather than freeing the memory by passing it back to the kernel.

This is because the data was previously allocated by way of a vec, and
only a reconstituted vec knows how to properly dispose of the data.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-16 18:35:18 +08:00
Sean Cross
486d993c4c xous: hosted: don't over-allocate memory messages
Call `shrink_to_fit()` on the array that contains memory messages. This
is beacuse we throw away the `capacity` field, and we want to make sure
we can reconstitute the vector at a later stage.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-16 18:35:17 +08:00
Sean Cross
62623f995c Merge branch 'master' of github.com:betrusted-io/xous-core 2021-06-16 16:54:06 +08:00
bunnie
5301f4af20 major refactor of the Ux -- can create, redirect I/O contexts
getting ready for Precursor to do more than just one thing.
2021-06-16 04:50:26 +08:00
Sean Cross
651844ba20 Merge remote-tracking branch 'origin/master' into debugger 2021-06-06 19:21:18 +08:00
bunnie
bbfe0fb605 Merge remote-tracking branch 'betrusted/aes' into bunnie-dev 2021-06-02 14:49:11 +08:00
bunnie
fadc9c29ab Merge remote-tracking branch 'origin/master' into bunnie-dev 2021-06-02 03:59:25 +08:00
Sean Cross
b22ec0369e xous: asm: add aes calls for vexriscv
VexRiscv has accelerated AES instructions. This adds ASM hooks for these
instructions so they can be called from Rust.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-01 19:52:37 +08:00
Sean Cross
bbda4365ae wip commit
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-01 17:57:01 +08:00
bunnie
7c55925926 intermediate check-in on wfi 2021-05-30 23:07:16 +08:00
bunnie
7529628053 partial progress on EC updater 2021-05-24 04:34:50 +08:00
Sean Cross
18a86a9a19 xous: add homepage and repository fields to Cargo.toml
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 16:43:30 +08:00
Sean Cross
8d41777dc1 release 0.8.3
This implements the `JoinThread(tid)` syscall.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 16:41:13 +08:00
Sean Cross
a83cf9fe48 xous: document some more functions
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 16:40:33 +08:00
Sean Cross
ca53abbd25 xous: wire up wait_thread for baremetal
Now that we have a `JoinThread`, connect the `wait_thread` syscall.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 16:37:19 +08:00
Sean Cross
091a655a0a xous: document disconnect
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 16:32:27 +08:00
Sean Cross
6b70922381 xous: add JoinThread syscall
The `JoinThread` call will eventually be used to let one thread wait on
another.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 13:01:03 +08:00
Sean Cross
3b540e4e9a xous: tag 0.8.2
This contains some minor modifications to the ABI.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-20 11:53:02 +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
efe5a8b9e8 xous: tag v0.8.1
This adds the `stringbuffer` object.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 14:27:58 +08:00
Sean Cross
c516919479 xous: run cargo fmt
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 14:20:47 +08:00
Sean Cross
a1b16a74cb xous: definitions: add default constructors for Message
Enable creating new_lend() and new_scalar() messages.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 14:14:21 +08:00
Sean Cross
7fe10b6463 xous: stringbuffer: fix build in libstd
When building as part of libstd, we need to manually specify flags.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 14:13:38 +08:00
Sean Cross
04055c1bf5 xous: add StringBuffer
This is a simple lendable StringBuffer variant of String that is
suitable for sending across process boundaries.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-12 21:22:15 +08:00
Sean Cross
b74396cfe7 syscall: add return_memory_offset_valid()
This sets the `valid` field in addition to the `offset` field when
returning a MemoryMessage.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-12 21:22:15 +08:00
Sean Cross
32d740aa15 xous: run cargo fmt on definitions
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-12 21:22:15 +08:00
Sean Cross
0962453812 xous: definitions: make SID a [u32; 4]
This has a well-defined C representation, and is more portable than the
tuple format.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-10 14:37:33 +08:00
bunnie
fe86207469 make docs reflect the error message actually thrown 2021-05-06 00:41:38 +08:00
bunnie
e7e7711f2d remove unused buffer package 2021-05-05 01:37:03 +08:00
bunnie
cad9c15849 intermediate save of suspend resume
building an awful rube-goldberg contraption of a "clean-suspend"
record.
2021-04-28 19:28:04 +08:00
bunnie
ac40075140 add keyboard input via UART 2021-04-16 04:11:25 +08:00
bunnie
06f7f6ff7f add a define for the maximum CID 2021-04-14 03:20:30 +08:00
bunnie
01a0fcc73f Merge branch 'master' of github.com:betrusted-io/xous-core into bunnie-dev 2021-04-07 18:30:13 +08:00
bunnie
0f9eea10d9 flesh out callback handling of events in LLIO 2021-04-07 18:29:50 +08:00
Sean Cross
e2996935cf 0.8.0: tag release
This bumps version numbers to 0.8.0, indicating we're nearing final
release.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-04-07 16:34:16 +08:00
Sean Cross
c497cd4864 Revert "remove legacy buffer/string from xous-rs"
This reverts commit 628be639f6.

This file is still in use by at least one project, and will be used by
the libstd implementation.
2021-04-07 16:30:08 +08:00
bunnie
628be639f6 remove legacy buffer/string from xous-rs 2021-04-07 00:50:11 +08:00
bunnie
35353f38dd bring benchmarks to v0.8 and record benchmark results 2021-04-07 00:45:11 +08:00
bunnie
ea43e236ee refactor fcc-agent for v0.8 2021-04-06 23:09:33 +08:00
bunnie
b9162fda3d gettin' there! major modules now mostly working under v0.8 2021-04-06 19:32:35 +08:00
bunnie
9ba2fb134c refactor most major modules, but Xous now crashes 2021-04-05 23:50:00 +08:00
Sean Cross
03bed02393 xous: make terminate_process divergent
This allows for terminating a process when something goes wrong.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-04-05 18:19:33 +08:00
bunnie
4a504943dc part-way through the GAM refactor 2021-04-05 05:47:17 +08:00
bunnie
75a6f779f8 initial refactor of ime-frontend 2021-04-05 03:39:14 +08:00
bunnie
bd54b48f8f initial cut of a major refactor of the keyboard server
- debounce is now in hardware (requires latest version of betrusted-soc)
- key events originate from an interrupt context and propagate through
  to the listeners as messages
- attempt to reduce the use of heapless::Vec; there is an awkward
interposer step still between the array methodology and the Vec
methodology

I'm not sure if trying to eliminate the Vec is a good idea,
because...I'm finding that we're just re-implementing Vec, but
much worse.

However, for the purpose of movement of data across
IPC boundaries, it's more robust to use primitive types,
because serializing Vec is not possible without either
forking the heapless crate to derive the rkyv traits; or, we'd
have to do some probably quite dangerous conversion of the Vec
to a raw slice which also doesn't feel nice.
2021-04-04 01:42:30 +08:00
bunnie
b9ff993845 refactor graphics server 2021-04-03 00:53:30 +08:00
Sean Cross
461d6f23ee syscall: add wrapper functions for destroy_server and disconnect
Signed-off-by: Sean Cross <sean@xobs.io>
2021-04-02 17:33:36 +08:00
Sean Cross
0230ccb252 xous: syscall: add definitions for Disconnect and DestroyServer
Signed-off-by: Sean Cross <sean@xobs.io>
2021-04-02 17:30:32 +08:00
bunnie
0e936eaee3 add a macro to help reduce the burden of unpacking messages
The syntax to pattern-match a message is a pretty heavy cognitive
burden. Try to ease that by introducing a macro.

The main coin-toss here is whether to include the "what you do
with the message" expression within the macro, or to allow it to
be a block that trails it.

The main benefit of including the body inside the macro is that
we can append an "else" clause that spits out an error message
in case the template didn't match. The drawback is the awkwardness
of putting curly braces inside the parens of the macro expansion.

I think Rust coders are probably more OK with that awkwardness,
even though I find it visually unappealing; and the benefit is that
scalars sent to opcodes expecting blockingscalars (and vice versa)
don't go to a "black hole" -- you'll get an error message.

This error message will probably save someone an hour of debugging
someday, so we'll go with the awkwardness.
2021-04-02 15:34:39 +08:00
bunnie
d21c0fa3e7 refactor of COM
this was much harder than I liked.
2021-04-02 05:43:47 +08:00
bunnie
3c34517632 add a convenience method for creating messages
reduces the cognitive load of writing library functions
2021-04-02 02:44:24 +08:00
bunnie
a3adf797b0 refactor TRNG server to new API 2021-04-01 17:20:36 +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
16ea102e94 xous: string: allow any stringlike thing to be used
Anything that can be turned into a string can now be used in
`from_str()`.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 17:14:26 +08:00
Sean Cross
32ebee0b8f xous: String: implement AsRef<str>
This allows xous Strings to be used in functions that expect to be able
to stringify arguments.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:31:59 +08:00
Sean Cross
cf1fc44f7e xous: return buffer offset as part of MemoryMessages
When a MemoryMessage goes out of scope, update the buffer offset and
valid fields. This allows the caller to see what's changed.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:14:16 +08:00
Sean Cross
364cd94326 xous: definitions: don't allow mutable refs to lends
lends are non-mutable, so don't allow them to be mutably borrowed.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 23:38:20 +08:00
Sean Cross
c7b2b2cab0 xous: add offset and valid to returned memory
This will enable us to have more information about the result that is
returned when mutable memory is modified by a server.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 13:16:15 +08:00
Sean Cross
d3879d36ac xous: use try_into when converting messages to syscalls
This moves message internals back into the message struct.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 11:58:50 +08:00
Sean Cross
5410d62ef5 xous: fix create_thread_[2..4] arg count
These functions assumed there was only one argument, which was
incorrect.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:53:50 +08:00
Sean Cross
cecd78fd61 xous: hosted: implement create_thread_n()
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:53:32 +08:00
Sean Cross
2b97ea25ab xous: add create_thread_n functions
These are used to create threads with between 0 and 4 arguments.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:42:49 +08:00
Sean Cross
27c35223cd xous: run cargo-fmt
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-18 20:10:26 +08:00
Sean Cross
071f2047f8 xous: return TID and PID from current_tid() and current_pid()
These should return the raw values, rather than the Result values.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-18 20:10:01 +08:00
bunnie
6677d79834 initial RTC framework 2021-03-18 16:22:08 +08:00
bunnie
2d5c1dd6db leverage min_const_generics and cleanup
the spoils of a hard fought battle to refactor to rkyv 0.4.1
2021-03-18 04:00:38 +08:00
bunnie
ea8b208a15 finalize rkyv 0.4.1 refactor 2021-03-18 03:54:48 +08:00
bunnie
8fbd900a4c Merge branch 'hardware-no-cb' into rkyv-refactor
Bring the two branches up to date, while also laying the groundwork
for XousServerName to be used as a native index type in xous-names
so we aren't burdening xous::String with a hasher
2021-03-17 16:06:06 +08:00
bunnie
d68e3e8cf4 an attempt to refactor to rkyv 0.4.1
unfortunately, it looks like deserialize requires an alloc??
2021-03-16 02:02:53 +08:00
Sean Cross
55a09990f0 hosted: pre-allocate buffers for performace boost
Buffers have a known size. We can avoid reallocations by preallocating
buffers to this known size.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-14 18:29:45 +08:00
Sean Cross
ff8a839ac0 xous: string: implement as_str() for ArchivedString
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-13 18:06:23 +08:00
Sean Cross
9c8b562711 hosted: set tcp_nodelay
This might have a performance impact, but it's unclear.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-13 18:05:11 +08:00
Sean Cross
b742dcade2 xous: make macros optional
These are not used when building libstd.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-12 09:19:39 +08:00
Sean Cross
a0c82ee25c xous: initial draft of xous target support
This is an initial cut of the library as it will be included in the
libstd.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-11 12:27:55 +08:00
Sean Cross
530e105fe4 xous: add GetProcessID and GetThreadID syscalls
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-11 11:19:51 +08:00
Sean Cross
f4e8e73887 xous: tag 0.1.1
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-11 10:48:25 +08:00
Sean Cross
e00b958308 hosted: transmit PID to clients
Prior to this patch, all clients assumed they were PID 1.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-10 17:35:57 +08:00
bunnie
4f74ad9470 add string appending feature 2021-03-10 04:19:25 +08:00
bunnie
b5411851fd rudimentary shellchat -- commit for help on debug Move message 2021-03-09 03:52:39 +08:00
bunnie
8a8c1e6a66 foundations for predictive text display 2021-03-08 00:57:50 +08:00
bunnie
49d6018e5e new feature: backspace (*gasp* iknowrite?)
harder than it looks with utf8 and variable-width characters
2021-03-06 19:37:22 +08:00
bunnie
161b1943eb fix push() function on string
didn't hnadle variable length encoding of the utf8 correctly
2021-03-06 02:55:14 +08:00
bunnie
5ea2a21d2d tighten up APIs, implement a very 0th-order input loop
this is where the debugging begins of the beginning of
the API. it's like finally finding the start of a roll
of clear tape.
2021-03-04 19:02:56 +08:00
Sean Cross
5a0533d6bc xous: definitions: add Display to MemoryType
Useful in debugging and error messages.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-03 21:16:45 +08:00
bunnie
8f809c2a51 start layering in the IME front end and prediction APIs 2021-03-03 14:53:33 +08:00
bunnie
d1609d2a31 another commit checkpoint. somehow, i have a race condition now. 2021-03-01 15:08:08 +08:00
bunnie
66902b6bfb cleanup minor formatting detail 2021-03-01 13:47:06 +08:00
bunnie
4640dc404f make panic messages a bit more helpful 2021-03-01 13:45:36 +08:00
bunnie
c5e6391e22 remove mention of Sendable and the ipc.rs module 2021-02-18 02:01:11 +08:00
bunnie
0af72ffb6d clean up Sendable references and warnings 2021-02-17 23:29:20 +08:00
Sean Cross
14f661f565 xous: remove id field from lend()
This argument is no longer used.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 20:54:08 +08:00
Sean Cross
c349345ce8 xous: get rid of most warnings
Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 20:40:27 +08:00
Sean Cross
f361bd6e7e xous: buffer: impl Drop for Buffer
This will release a Buffer to the kernel when it goes out of scope.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 20:31:02 +08:00
bunnie
2b003f8a7d intermediate checkin 2021-02-16 00:28:44 +08:00
bunnie
2a46f541f2 add PID identification facility to help with debugging 2021-02-15 19:15:58 +08:00
bunnie
af012c48dc getting a little further with the port, but still crashing on a borrow message 2021-02-15 04:42:30 +08:00
bunnie
fc8290cdb4 futzing around and something is kind of working on xous-string port to rkyv 2021-02-15 00:05:42 +08:00