Commit graph

3321 commits

Author SHA1 Message Date
bunnie
f494da21cc absorb new xous-ipc version 2024-09-23 22:05:50 +08:00
bunnie
2e9b19d62d fail, don't panic on serialization failure
this allows us to handle the error. probably should propagate
on to xous-ipc
2024-09-23 19:02:19 +08:00
bunnie
8cd1cef679 cleanup bulk read on PDDB
we don't have to pass a "size" field anymore; since we're end-offset
from pos, just pass pos and use that to chain records.
2024-09-23 18:07:50 +08:00
bunnie
921be1cf8b add bounds checking to a TextView string length
Before xous-ipc's fixed-length string guaranteed this thing
fit into a single page. Now, we can send potentially unbounded
amounts of text between servers.

I don't think it makes sense to send more than a few k of text to
render on the screen at once, given our screen sizes, so I've added
a patch that truncates the text to the previous length that things
would truncate to.

The behavior is the same as before, except that you will
over-allocate memory on the heap in the sending process
as you shove more string data into a TextView than can be rendered.
Previously, the TextView would just truncate the data and discard
the data.

The truncation happens at the point where you try to hand the
record off to another process, so, one could in theory try
to make this recoverable by adding a layer that splits the
textview into more manageable chunks or pages the data, but that
is an exercise for another day.
2024-09-23 17:35:27 +08:00
bunnie
e61a2e3238 reformat shellchat with the latest alphabetization rules 2024-09-23 17:22:47 +08:00
bunnie
1ec66137be port cramium target to xous-ipc 0.10 2024-09-23 14:35:51 +08:00
bunnie
7ea1400843 fixup cram-console for xous-ipc 0.10 2024-09-23 14:31:00 +08:00
bunnie
cdc841124d fix a xous-ipc change but now conflated with reformatting 2024-09-23 14:18:45 +08:00
bunnie
ec43c4622c print the debug info for trng pump 2024-09-23 14:18:16 +08:00
bunnie
9ebb61c68c update test on cram side too 2024-09-23 14:17:56 +08:00
bunnie
e9ab865e09 port trng server to use flatipc 2024-09-23 14:17:31 +08:00
bunnie
cbe9aa05be redo lib api to use flatipc; has a question for xobs 2024-09-23 13:38:38 +08:00
bunnie
75954de8d6 commit the version bump 2024-09-23 01:46:25 +08:00
bunnie
2f8604299c remove test for deprecated rkyv 2024-09-23 01:17:17 +08:00
bunnie
5973e48bf4 missed a case that is in hosted mode 2024-09-23 01:16:59 +08:00
bunnie
840964d33b track xous-tt-backend release bump 2024-09-23 00:33:03 +08:00
bunnie
4c7c9312c1 change xous-ipc api to 0.10.0 2024-09-23 00:24:48 +08:00
bunnie
5cad1a3bcf more xous_ipc cleanup 2024-09-23 00:03:49 +08:00
bunnie
3c0140bf2d final cleanup on shellchat xous-ipc abstractions
the implementation relied on a quirk of xous-ipc where the message
ID is 0 for string send/receives. This cleans it up so that the API
is transparent and consistent with other API calls in the system.
2024-09-23 00:01:32 +08:00
bunnie
8424d19ea9 fixup API to not rely on copy, instead use borrow
also some more regex fixup
2024-09-23 00:00:41 +08:00
bunnie
ef718853b2 cleanup borrow issues in com 2024-09-22 23:59:52 +08:00
bunnie
95a31a369c fix Copy derive and related issues in net 2024-09-22 21:55:20 +08:00
bunnie
e423bfd347 fix lines that missed the regex in DNS 2024-09-22 21:54:58 +08:00
bunnie
15aaf55e93 fix borrow for argument parsing 2024-09-22 21:54:24 +08:00
bunnie
4eb504bb43 more typecast cleanup 2024-09-22 18:51:06 +08:00
bunnie
839923967c git rid of a .clone() that crept in, now fixed by prior commit 2024-09-22 18:50:38 +08:00
bunnie
7141a02e10 ah yes. This was the kind of xous-ipc abuse I was worried I would have done.
And I did it! and it's now fixed.

I was using xous-ipc String to make a fixed-length string in a
structure that's not strictly an IPC structure.

The solution to this is to just implement a fixed length string
directly.
2024-09-22 18:49:26 +08:00
bunnie
6e4eec99a3 more cleanup on usb crate 2024-09-22 18:48:55 +08:00
bunnie
1b5eacdb68 manually cleanup a flat accessor in USB crate 2024-09-22 15:49:39 +08:00
bunnie
be227adde1 removed sized strings from pddb interchange structures
I think this is safe to do because no strings can be directly
serialized into the PDDB's structures. The place to check for
this is inside the backend/ directory. For example, `DictName`
is where the name field is serialized into a structure that
goes onto the disk. It's explicitly length-checked.

What this means is that we could have calls into the pddb crate
with invalid length strings, however, if you check the lib
implementation, all of the APIs also pre-flight the length of
arguments to ensure they fit into the destination string.

So mostly what we're losing is the constraints on the intermediate
IPC representation, but the length is still checked on either side.
2024-09-22 15:44:05 +08:00
bunnie
34e6f46d63 formatting changes that resulted from the regex search
a bunch of lines are shorter or different length now which
triggers a mandatory reformat. this patch cleans that up,
so that going forward the manual rework patches are clearer and
not tied up with formatting patches.
2024-09-22 15:31:14 +08:00
bunnie
0cdbfdfcc3 format cleanup & copy remove
a bunch of code has to be re-formatted because spacing changed
and we have a strict formatting rule
2024-09-22 15:29:23 +08:00
bunnie
f6f7cbdc98 bunnie-review: fix borrows in modals main loop
note for more review by bunnie down the road to make sure
that I have not changed any behaviors accidentally in fixing
the loss of Copy on a core structure
2024-09-22 15:28:11 +08:00
bunnie
af35f6e118 more cleanup of copy trait 2024-09-22 15:13:46 +08:00
bunnie
dfd7272773 review-needed: modify the alert modal prompt loop
The original loop takes advantage of the copy-trait that is
no longer available. I think the intent of the loop was to
mutate a field within the copy through each iteration so you
can update the prompt to handle field validations that failed
without re-allocating the ManagedPromtWithTextResponse structure.

This has been rewritten to alloc that each iteration to avoid
the borrow error, and instead the `prompt` itself is a string
that's initialized with the initial prompt message and is updated
on each iteration if the form validation fails.

@gsora git seems to say you wrote this code, maybe I could use
your help to review this patch.
2024-09-22 15:10:31 +08:00
bunnie
58527ea38b manual cleanup Copy derive: gam crate
There isn't a simple regex to deal with the loss of Copy when
deprecating xous_ipc, so this has to be a manual pass.

Losing the copy trait means (maybe) some loss of efficiency
in the API because we have to clone some structures instead
of copying them, although, I think actually what might have
been happening under the hood anyways is the copy was implemented
as a clone-under-the-hood for the xous-ipc.

Either way, this happens in the high level management structures
for modals, so it's not the end of the world to incur a clone
on the description of the structures -- we'd have to pay
more attention if this happened e.g. at the pixel shuffling
level, but a few UI strings at human-interaction rates
isn't going to kill us.
2024-09-22 14:50:21 +08:00
bunnie
f8719d781e security-related: implement missing clear_volatile() 2024-09-22 14:49:51 +08:00
bunnie
f1d263359d security-relevant: clear_volatile() API missing on String
xous_ipc::<String> had a clear-volatile() API for zeroizing
sensitive strings.

This is now missing in String, so it has been manually implemented
here by casting the String to a slice-u8 and then iterating
through it using raw pointers and volatile writes with a compiler
barrier to hopefully avoid all of the landmines I know of for
zeroizing a string...

commit is called out separately because this one is one of the
more "dangerous" security-related changes in the API migration.
2024-09-22 14:28:29 +08:00
bunnie
1fd59f0fc9 regex search/replace instances of xous_ipc::String to String 2024-09-22 14:28:16 +08:00
bunnie
b514d31fed regex search/replace instances of xous_ipc::String to String 2024-09-22 14:26:41 +08:00
bunnie
0fbca1cd4d cleanup a typecast ambiguity due to new API
Rust can't tell how to cast some u32_le into u32/usize automatically
due to confusion with the num_derive trait, so we have to explicitly
specify a chain of typecasts to clean up the conflict with the
new rkyv
2024-09-22 14:24:59 +08:00
bunnie
1b0fa6e04b regex search/replace instances of xous_ipc::String to String 2024-09-22 14:24:49 +08:00
bunnie
d2f13d92fe regex xous_ipc::String to String + cleanup idioms
some idioms are improved with String, this cleans up a bit of code
in addition to the search/replace
2024-09-22 14:23:20 +08:00
bunnie
15722a314a regex search/replace instances of xous_ipc::String to String 2024-09-22 14:22:58 +08:00
bunnie
c4f67ccb31 regex search/replace instances of xous_ipc::String to String 2024-09-22 14:21:09 +08:00
bunnie
3eb61d3002 regex search/replace instances of xous_ipc::String to String
includes some light touch-up to the API to clean up a consequence
of String not being copy-able anymore
2024-09-22 14:20:24 +08:00
bunnie
f2fbc7fafd regex search/replace instances of xous_ipc::String to String
more regex results
2024-09-22 14:19:32 +08:00
bunnie
1d9316f9cd regex search/replace instances of xous_ipc::String to String
core xous services cluster
2024-09-22 14:18:49 +08:00
bunnie
916c98fd5c regex search/replace instances of xous_ipc::String to String
split into multiple commits for easier committing
2024-09-22 14:18:19 +08:00
bunnie
6d7a8fdc09 regex search/replace instances of xous_ipc::String to String
split into multiple commits for easier committing
2024-09-22 14:16:36 +08:00