Commit graph

511 commits

Author SHA1 Message Date
Sean Cross
81351bed32 xous: syscall: support call.memory() for ReplyAndReceiveNext
Much of the hosted machinery requires the ability to access memory on
syscalls. This feature was overlooked in the previous implementation of
ReplyAndReceiveNext, which caused it to not properly return memory.

Implement the ability to call `.memory()` on ReplyAndReceiveNext
messages.

Note that this requires the use of a sentinal value in the
previously-unused `valid` field.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-05 11:53:59 +08:00
bunnie
36398810dd bump version numbers to absorb new syscalls 2022-12-30 15:24:36 +08:00
Sean Cross
d88254b1b1 xous: add reply_and_receive_next_legacy call
This call is used to return values while simultaneously listening for
new messages.

The -legacy suffix is used to disambiguate scalar values, so we know
whether to send Scalar1, Scalar2, or Scalar5 messages.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-12-29 21:00:35 +08:00
Sean Cross
64c88f9942 xous: add Message type
This type actually contains the message contents, and will be used to
return data to the caller.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-12-29 21:00:05 +08:00
Sean Cross
d463f9563f xous: rename Message to MessageEnvelope
This reflects the fact that up until now, the `Message` struct has
merely been the envelope that surrounds the message. It does not contain
any actual Message contents.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-12-29 20:58:51 +08:00
Sean Cross
be56af6303 xous: add wrapper for reply_and_receive_next
This wrapper enables userspace programs to use the new
ReplyAndReceiveNext syscall easily.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-12-29 16:26:37 +08:00
Sean Cross
36e6e6c30b xous: syscall: add ReplyAndReceiveNext call
Signed-off-by: Sean Cross <sean@xobs.io>
2022-12-29 16:26:34 +08:00
bunnie
5370ce396d bump all revs due to SoC artifact update 2022-12-12 16:07:20 +08:00
bunnie
1d1b3a35b7 commit version bump 2022-11-26 10:00:44 +08:00
bunnie
aa9977cc58 bump all the things because we changed utralib again 2022-11-17 22:13:40 +08:00
bunnie
dabbfd6c35 bump all the things to absorb the SoC change 2022-11-17 19:39:18 +08:00
bunnie
30583bdf07 bump versions with xous change 2022-11-06 03:48:12 +08:00
Sean Cross
c9f751f5f0 xous: add api support for scalar5
With the addition of scalar5, existing api calls must be updated to take
advantage of it. This will allow `send_message()` to return a `scalar5`.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-11-05 18:44:01 +08:00
Sean Cross
c8bb039c41 xous: add api support for Scalar5
Add syscall and return definitions for Scalar5, as well as
ReturnScalar5. This will enable us to pass up to five scalars as a
return from a blockingscalar call.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-11-05 18:39:06 +08:00
bunnie
ba28dd8795 bump to absorb utralib straggler configs 2022-10-28 15:11:17 +08:00
bunnie
dfb10ed7f2 bump crate numbers to publish lang-fr change into xous-rs 2022-10-28 14:01:09 +08:00
bunnie
0ee9ec1d80 bump version numbers for crate publication 2022-10-25 22:38:58 +08:00
Jean-Pierre De Jesus DIAZ
f5176ea380
Remove xous-rs unused features
The rationale is that xous-rs should have only architecture
specific code, e.g.: riscv, arm, x86, etc. To make other
crates that depend on it not specify the features.

This could be useful when using xous-rs with `libstd`
for example.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-10-25 13:29:15 +02:00
Jean-Pierre De Jesus DIAZ
14b92dede4
Remove baremetal cfg detection in build script
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-10-25 13:24:59 +02:00
bunnie
d331d405ee bump version numbers for publication 2022-10-25 17:23:40 +08:00
Sean Cross
6066619906 xous-rs: use target_os and target_arch cfgs
Look at `target_os` to determine whether to enter "hosted" mode or not.
If `target_os` is "xous", then the Xous standard library should default
to using builtin Rust libstd features.

If it is "xous", then we should instead use our arch-specific
implementations.

This enables third-party programs to directly use the `xous` crate
without specifying feature flags.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-25 15:50:53 +08:00
bunnie
9c4a39066d rollback the cache clear instruction in the asm entry
this causes instability when present with the older vex core.
2022-10-20 04:20:59 +08:00
bunnie
7b0f30c318 add Charles' flush command + recommended nops
the Vex has a custom flush instruction, after contacting
charles he recommends maybe adding some nops to make sure it
completes (maybe hardware bug? unclear. we're about to find out.)
2022-10-19 23:42:43 +08:00
bunnie
0584ad2f2c switch to local paths to see if this helps the build 2022-10-18 00:26:56 +08:00
bunnie
4b368d71db bump versions of crates 2022-10-15 01:31:54 +08:00
bunnie
63a87ca1bc bump all the versions 2022-10-14 16:54:43 +08:00
bunnie
ff30131f43 absorb more fixes into the kernel 2022-10-13 04:08:56 +08:00
bunnie
966cdef65f remove warning 2022-10-13 04:03:08 +08:00
bunnie
64b942f3b4 fix errors is the test module from PR#238 2022-10-13 04:01:43 +08:00
bunnie
51752aac9d
Merge pull request #239 from Foundation-Devices/baremetal
Use CARGO_CFG_TARGET_OS in build scripts.
2022-10-12 12:56:17 -07:00
bunnie
3503965f98 bump versions to absorb xous-rs changes 2022-10-13 03:41:16 +08:00
bunnie
84bdfa1d2f fix some escapes from #237/#238 due to xous-rs being on crates.io 2022-10-13 03:29:46 +08:00
bunnie
be239f9812
Merge pull request #238 from Foundation-Devices/from-into
Implement From instead of Into.
2022-10-12 11:49:19 -07:00
Jean-Pierre De Jesus DIAZ
955fbc8788
xous: Use CARGO_CFG_TARGET_OS in build scripts.
This allows for a more reliable detection of target_os configuration
in build scripts. The target is inconsistent between some architectures,
notably armv7a is `armv7a-none-eabi` skipping the `unknown` (the vendor,
I guess) part. This happen with some of the unrelated Cortex-M targets
present, and others may also be.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-10-12 19:03:46 +02:00
Jean-Pierre De Jesus DIAZ
3cbcf7b7e4
xous-rs: Implement Display instead of Into
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-10-12 15:39:02 +02:00
Jean-Pierre De Jesus DIAZ
c74d54f345
xous-rs: Implement From instead of Into
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-10-12 15:38:44 +02:00
bunnie
02b80425f5 bump xous-rs to absorb change in language specification 2022-10-10 03:07:44 +08:00
bunnie
3bca9de2a0 bump version numbers for xous-kernel patch
this fixes tests in CI
2022-10-05 23:51:35 +08:00
bunnie
32e3cf588f bump xous-rs to 0.9.11 to absorb feature flags into the kernel API 2022-10-05 18:26:58 +08:00
bunnie
0ae89626fe add default for crates 2022-10-05 17:20:26 +08:00
bunnie
644a52e784 defaults for cargo packaging 2022-10-05 17:18:54 +08:00
bunnie
586f2bddf6 bump xous-rs version to absorb feature flag changes from utralib 2022-10-05 17:15: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
147d55bdf8 bump xous-rs version 2022-09-26 11:08:22 +08:00
bunnie
ea37ce2ea1 add feature gate on v2p per xobs' request 2022-09-15 14:06:07 +08:00
bunnie
6d9848c239 add virt_to_phys syscall
this will help speed up performance profiling as we can
resolve the physical address of the performance buffer allocated
in RAM and use a USB command to read it out, instead of streaming
it over serial.
2022-09-14 18:09:13 +08:00
bunnie
d3337bdaba make constant naming consistent (prefix indicates the address space offset) 2022-07-13 04:36:17 +08:00
bunnie
fa21e01b94 add the location of the backup block 2022-07-12 03:31:37 +08:00
Sean Cross
20389e0941 xous: definitions: correct offsets for Result::from_usize()
The offsets were corrected with `to_usize()`, but hadn't been updated
for the other direction.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-05 23:12:22 +08:00
Sean Cross
c10541c0cc xous: definitions: fix discriminant shift for Results
The ServerID return type was placed in the middle of the results list,
which caused results 8-15 to be shifted by one to become results 9-15,
with result 8 being swapped with result 15.

This fixes this offset.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-04 16:54:32 +08:00
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