Commit graph

3711 commits

Author SHA1 Message Date
bunnie
d1c3ebce97 fix TTS in CI build 2022-07-06 05:08:22 +08:00
bunnie
7dfafe84e8 update release notes 2022-07-06 05:07:29 +08:00
bunnie
77a92e310f shift around position of test in modals test and add a dedicated shellchat test 2022-07-06 05:04:26 +08:00
bunnie
620b9c2e56 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-07-06 04:55:38 +08:00
bunnie
1e1314cee3 bump lockfile 2022-07-06 04:53:11 +08:00
bunnie
11287938ab add bip39 facilities to the modals server 2022-07-06 04:52:52 +08:00
bunnie
4087312a2c add bip39 primitives to the GAM, including an interactive entry dialog 2022-07-06 04:52:14 +08:00
Sean Cross
fe4211bb15 RELEASE-v0.9: add pddb libstd notes
Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-05 23:57:01 +08:00
Sean Cross
086c014de2 pddb: close all related filehandles when a file is deleted
Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-05 23:56:31 +08:00
Sean Cross
5cc51ebdaf
Merge pull request #200 from betrusted-io/libstd-fs
pddb: Add libstd support
2022-07-05 23:22:12 +08:00
Sean Cross
728add6c81 Merge branch 'libstd-fs' of github.com:betrusted-io/xous-core into libstd-fs 2022-07-05 23:13:34 +08:00
bunnie
bba4c38f6b
Update main.rs 2022-07-05 23:13:07 +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
506990c7be Merge remote-tracking branch 'origin/main' into libstd-fs 2022-07-05 22:52:39 +08:00
Sean Cross
ee18fe889c pddb: initial libstd support
Add support for libstd calls to pddb.

The pddb uses `:` as the path separator, and grafts the concept of paths
onto dicts.

Currently implemented features:

    * mkdir
    * rmdir
    * create file
    * open file
    * read file
    * write file
    * unlink file
    * seek file

Other calls may be added as needed.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-05 22:50:58 +08:00
Sean Cross
6ae91d8e46 pddb: make select_basis and latest_basis non-mut
These do not need to clone data and do not need to be mut. This improves
access time considerably.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-05 17:23:40 +08:00
bunnie
77886fae4a adjust dead-weight size of qrtext down wards
the sizing was such that two pages of data had to be prepared
for even very short messages. This change fits the message back
into one page of data once again.
2022-07-05 13:07:04 +08:00
bunnie
7ef4e4dc41 Merge branch 'pddb' into main 2022-07-05 03:25:02 +08:00
bunnie
148bf71a94 modify the fb pop routine so it doesn't overwrite the status bar
this eliminates a small glitch in the time display/security infos
whenever transitioning between foreground/background contexts
2022-07-05 03:24:15 +08:00
bunnie
db569dd6e0 update release notes 2022-07-05 03:04:04 +08:00
bunnie
761cffc35e strip some debug spew 2022-07-05 03:00:31 +08:00
bunnie
147ec8594c add stash/pop of FB; fix suspend/resume buffering
The `ManagedMem` thing for the suspend/resume crate is simply
a disaster. It tries to be fancy and Rusty and really it just fails
in non-obvious ways. This is one of the places where it simply
does not pay to make things seem so simple.

Why? because in reality, memory is complicated. It comes in pages.
There's initialization. There's caching. There's volatility.
I haven't encountered a single situation where the assumptions
of page-alignment and memory layout have really lined up well enough
for this primitive to make sense. The "idea" was hey, since
you allocate a peripheral MemoryRegion, why not just use its attributes
as a marker to a suspend/resume thing that automatically handled
stashing that MemoryRegion to a backing store inside RAM? Seems
simple right? wrong. Every time I've tried to use it, it's failed
in non-obvious ways.

In this most recent incarnation, it turns out that for whatever
reason, it seems to be just stashing about the first 4-8k of the
framebuffer to the SR backup region, and then somehow grabbing
a future(?) copy of the memory? or maybe just a wrong copy? I don't
know. The code seems simple enough but it goes through some
traits and some type transformations and then there's some unsafe
code to make it volatile and it doesn't work.

Instead, we just use a damn [u32; FB_SIZE] slice to store the
frame buffer. This is so obvious and easy. The only price is
you have an "ugly" `fb[..FB_SIZE].copy_from_slice(&self.srfb)`
line instead of an "elegant" `srfb.suspend()` invocation.
Stashing into it is a bit uglier, because we have to cast the
slice to an unsafe pointer in order to access the `write_volatile()`
method. But, it works! It. Just. Works. And you can see what's going
on. Really, I should stop trying to be fancy and just be readable.

OK anyways, that was that rant. This commit also adds some
calls that allow us to re-use the suspend/resume frame buffer during
"normal" times as a stash/pop for the application image. This is
nice because the memory is normally idle/overhead when not
in suspend, so now we're repurposing some already-allocated memory
to accelerate some drawing operations, and it also makes, crucially,
a multi-step blocking modal dialog interaction less cosmetically
jarring, because the application thread can be fully blocked and
not responding to redraw commands but the stash/pop mechanism
creates the illusion of "everything is moving along".
2022-07-05 02:44:13 +08:00
bunnie
3ad1ae7325 fix typo 2022-07-05 02:43:47 +08:00
bunnie
32a3bb5fa4 change foreground/background behavior
1. add foreground/background tracking, such that if we return
to a context instead of redrawing it, we stash the framebuffer and
restore it.

2. make foreground/background context swap messages mandatory

previously, we were "light fingered" about sending the message --
we'd only send them to apps. the app was not considered to be
"backgrounded" if a menu came up in front of it.

This turns out to be a mistake. Now, we background apps when
a menu or dialog comes in front of it, and then foreground it when
the app goes away.
2022-07-05 02:43:40 +08:00
bunnie
ae717f78af add code to make the ball app full-screen redraw affirmative on context switch
otherwise, you'll get some stale artifacts because the ball app
relies on the prior state of the screen for clean rendering
2022-07-05 02:35:38 +08:00
Sean Cross
c1e585c37c xtask: ensure loader is build with lto,codegenunits=1
If the loader is not build with these two parameters, then Weird Things
happen with the font table.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-04 22:33:38 +08:00
Sean Cross
4d416ce4c6 Merge remote-tracking branch 'origin/main' into libstd-fs 2022-07-04 22:29:26 +08:00
bunnie
900e3e6ae2 fix limit on manual FSCB test so we're triggering basis gen once
it's pretty tedious to do repeated basis regens manually.
2022-07-04 18:35:18 +08:00
bunnie
10521bd9a7 bump release notes to include FSCB updates 2022-07-04 18:22:34 +08:00
bunnie
00a40ef29d Merge branch 'pddb' into main 2022-07-04 18:14:40 +08:00
bunnie
e26106e334 fix warnings and clean up configs
tighten up the scope of some features to reduce warning messages
2022-07-04 18:13:11 +08:00
bunnie
c46b5179ff commit various project configs 2022-07-04 17:58:52 +08:00
bunnie
8565c7efe1 fix FSCB generation issues
- fix problem where we were generating a size based off of total disk
size, instead of fraction of available space

- enumerate FSCB entries into the page table scan. This is because
the page table cache could hold used entries that aren't reflected
in the low-level disk scan, and there is no way to trigger a
flush at the point of re-allocation.
2022-07-04 17:56:54 +08:00
bunnie
608817f343 finalize/improve basis stress testing
- add an autotrigger feature for the basis stress test so it can
  be run in a fuzzer loop
- various fixes and improvements to the implementation to help
  integrate with CI
2022-07-04 17:55:52 +08:00
bunnie
5d23ad9db6 add the pddb-btest target, for secret basis stress testing 2022-07-04 17:55:23 +08:00
bunnie
ae8fe799bc add a fuzzer for basis lock/unlocking
this commits a script that will repeatedly rerun the `btest`
which creates several Bases, fills them with pseudorandom datat,
and goes through a lock/unlock cycle.

should be run with the disk size set to 4MiB for maximum stress
testing (the larger disk won't trigger an FSCB refill because its
hard to run out free space on the larger disk size)
2022-07-04 17:53:29 +08:00
bunnie
97ae56915e fix edge case in --dump mode for pddbdb.py
shouldn't crash when not in CI analysis mode
2022-07-04 17:52:59 +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
bunnie
baa5097313 fix basis FSCB generation on full - basic fix in place and tested 2022-07-04 15:19:40 +08:00
Sean Cross
e091a91f01
Merge pull request #199 from llange/fix-typo
Fix typo in the tool description : 'Rebide' -> 'Renode'
2022-07-04 09:22:27 +08:00
bunnie
66f7f0a5ab add the autobasis feature to the current xtask set 2022-07-04 04:08:55 +08:00
bunnie
7162b05a7f add routines for testing secret basis
When the "autobasis" feature is selected, the hardware block
will track all basis that have been opened and unlock them when
it comes time to scan/generate more FSCB space. It also bypasses
all UX normally invoked.

This allows us to create tests that open and close Bases automatically,
but of course, totally destroys the notion of plausible deniability.
So, don't turn the feature on for production.
2022-07-04 04:06:53 +08:00
bunnie
a977e9852d add a comprehensive secret basis tester 2022-07-04 04:04:39 +08:00
Ludovic LANGE
ea35ee832d
Fix typo in the tool description : 'Rebide' -> 'Renode'
As the REPL format comes from
[Renode Platform](https://github.com /renode/renode),
I believe the word 'Rebide' to be a typo for 'Renode'
(given the proximity of the letters on a keyboard).

Let's hope it'll make this tool more prominent in search results.

Signed-off-by: Ludovic LANGE <llange@users.noreply.github.com>
2022-07-03 21:57:00 +02:00
bunnie
41a144a7e0 add some more feedback to the fscbtest test 2022-07-03 01:13:48 +08:00
bunnie
8c5a475f49 some whitespace auto-changes 2022-07-03 01:13:31 +08:00
bunnie
8a81954cf0 clean up the page table enumeration
since all the keys are now disclosed, the routine has been
renamed accordingly and the re-scan of existing bases is
redundant.
2022-07-03 01:12:12 +08:00
bunnie
559229d85e fix key enumeration to include keys that we already know 2022-07-03 01:06:56 +08:00
bunnie
95055c30d7 add some whitespace formatting to improve readability of basis listing 2022-07-03 00:43:27 +08:00
bunnie
e8140f257c make sure the basis list is displayed at least once
need to cover the case that no enumeration was done, and just
show a "null" list confirming basically nothing other than
the system basis is disclosed.
2022-07-03 00:42:16 +08:00