Commit graph

305 commits

Author SHA1 Message Date
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