Commit graph

223 commits

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