Commit graph

145 commits

Author SHA1 Message Date
bunnie
3188225030 modularize the layout crate 2021-08-24 19:19:06 +08:00
bunnie
5df8275c00 major refactor of the keyboard server
This one gets rid of a ton of awful, crufty code that was pre-std.
It also removes the following features:

- raw scancode reporting: nobody uses them, and they've never been tested.
They can be added in later if someone wants to e.g. build a MAME emulator.
- multi-listener: there is no good reason to do this on a secure system.
multi-listener is basically a keyboard logger. It's better if we just
control it to a single keyboard listener.
2021-08-22 17:13:36 +08:00
bunnie
4d3a8c2ced fix issue #81
background clears were going beyond their borders, and also
introducing a new border of their own. fixed.
2021-08-22 02:18:02 +08:00
bunnie
5706c9e525 fix stale comment 2021-08-22 02:17:53 +08:00
bunnie
20fd465acd a little more cleanup/re-org 2021-08-22 00:37:53 +08:00
bunnie
ca8bead919 improve organization of the modal crate 2021-08-22 00:29:42 +08:00
bunnie
c3fc3ff23f add bbram provisioning sequence 2021-08-19 04:22:28 +08:00
bunnie
ee4368e747 gateware update code in place 2021-08-13 06:00:21 +08:00
bunnie
aaf16dcf5e light refactor to the GAM to solve a deadlock issue
This is a "no good choice" situation but there is a problem with
progress bars.

You want progress bars to update quickly, and you don't want
to have to context switch out for the entire graphics stack to
come back to you to approve the drawing of your progress bar update.

On the other hand, you don't want to short-circuit all the checks
on drawing stuff to the screen for the sake of progress bars --
right now, there are a number of checks in place to make sure you
can't draw stuff on parts of the screen you shouldn't, to avoid
fake messages and dialog boxes.

I had managed to work out a way to get a dialog box to redraw without
violating the security rules -- each redraw is checked by the defacing
routine -- however, due to the way I was computing the height of
the modal I was causing the dialog box to be resized to its largest
size and then shrunk again to fit the text every iteration. This
in essence also caused the defacement routine to run repeatedly,
which caused the GAM to also issue repeated redraw requests to
the main loop.

These redraw requests can't be serviced until the task being tracked
by the progress bar is completed. As the progress bar gets redrawn
almost a hundred times as part of the task, roughly a hundred messages
arrive in the server's queue before it can handle a single one.

This results in a deadlock situation on completion of the progress
bar, because we want to fire off a message to ourselves to go to
the next state in the Ux routine.

There are a few possible solutions to this:

1. Multi thread the heck out of the routine doing the progress bar,
so the dialog box and the slider are each in their own threads
with their own responders and then the thing doing the computation
is doing some Mutex-guarded-Arc thing.

2. Do some very unsafe bodge to allow sliders to do direct draws
that are unchecked

3. Add a check so that if the size of the dialog box doesn't change,
defacement isn't recomputed and thus redraw messages aren't sent back.

(1) doesn't work for a number of reasons -- in a general case, it's
probably OK, but it does cause a lot more memory usage (and we are
lean on memory); but more importantly, for this use case, our routine
is interacting with CSRs and those don't implement Send so you can't
pass them into a thread via a closure. You could maybe put the dialog
boxes themselves into an Arc Mutex thing but because this routine
was heavily coded to re-use the heavyweight Ux resources this becomes
a bit cumersome to code.

(2) is terrible

(3) ended up working and what is in this commit. I think it's OK
because a progress bar generally doesn't require changing the
size of a window to update its state; therefore the redraw is
deface-safe (since you aren't changing the bounds of what you were
already approved to draw in). Of course, if you have some sort
of a progress bar implementation that changes the size of the messages
reported up top so that the dialog box has to change size over and
over again, you still end up in the deadlock situation!
2021-08-12 01:25:35 +08:00
bunnie
0ccd487f5a test case now failing, now we can solve the problem faster 2021-08-11 23:22:15 +08:00
bunnie
bdd70f9502 stash to figure out build issue 2021-08-10 22:41:22 +08:00
bunnie
352b725f7a add an abort option to the initialization flow 2021-08-10 02:48:32 +08:00
bunnie
29f7cbe53b refactor main menu to give options for rootkey operations 2021-08-10 01:54:35 +08:00
bunnie
ec6a3fd1a3 self-signing working, but the patch to use the SHA hash engine seems to be disregarded... 2021-08-09 03:27:43 +08:00
bunnie
bc6ec8caf4 initial key provisioning demo working 2021-08-07 22:21:49 +08:00
bunnie
8b83fb7c65 remove heapless, go to libstd for all collections!!!!
*fistpump*
2021-08-04 01:25:32 +08:00
bunnie
68ea69c2ed Merge branch 'bunnie-dev' into main 2021-08-03 17:22:10 +08:00
bunnie
d86c78eea8 partial progress on self-signing 2021-08-03 04:58:34 +08:00
Sean Cross
b86e0a65cd services: recognize xous as a hardware OS
Support `xous` as a valid OS. This allows us to build the entire kernel
under this target.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-02 18:11:48 +08:00
bunnie
d112d49524 clean up UX work before switching back into crypto work 2021-08-01 17:52:15 +08:00
bunnie
2714c9eb13 link in some READMEs so that rustdoc pulls them in
also add some bread crumbs on the more user-facing APIs to
help beginners out. Need to do a good spring cleaning of the
rustdoc tree, though. looks pretty terrible as it is.
2021-08-01 16:08:27 +08:00
bunnie
e968798fff fix defacement ordering 2021-08-01 15:06:28 +08:00
bunnie
cfd5e18549 add a progress bar/slider element. getting there. 2021-08-01 04:02:15 +08:00
bunnie
1d3eaa4f9a fix a stale dialog box message 2021-07-31 04:02:18 +08:00
bunnie
d7d052b6ff refactor ux flow, now on a good footing 2021-07-31 03:27:16 +08:00
bunnie
17be958d87 convert defacement to an XOR
this ensures that "all back" dialog boxes that are fake
are also defaced (as opposed to just drawing black, which
would not deface a "fake" dialog box).
2021-07-29 22:13:44 +08:00
bunnie
86a5c34a5b refactor root-keys to use the latest UX features
UX flow for requesting passwords is now more or less complete...

this yak is shaved?
2021-07-29 03:30:03 +08:00
bunnie
78c0b30382 refactor menu
- move it to the status thread, out of the GAM
- this allows us to refactor the menu code into its own module
2021-07-29 01:04:22 +08:00
bunnie
8cdf3c148b clean up warnings before merge to main 2021-07-28 23:58:15 +08:00
bunnie
f5a9cce4ac fix minor bugs in rtc set routine 2021-07-28 23:15:53 +08:00
bunnie
e60478d8d3 checkbox and radiobox now working. 2021-07-28 23:00:25 +08:00
bunnie
9ae5feab78 refactor to add helper threads to the UX format; documentation 2021-07-28 17:35:25 +08:00
bunnie
9f3615fd3d extend RTC setting with UX
not because this is so important, but because it's a simple
test case that exercises a lot of features.
2021-07-28 04:27:14 +08:00
bunnie
b6c443145c extend modal functions; refactor status into its own server 2021-07-28 01:01:39 +08:00
bunnie
9b51edfe6c add backspace (derp) 2021-07-27 18:00:09 +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
86e113b678 add locale to front-end; update menus to suppress 🔇characters automatically 2021-07-26 00:49:33 +08:00
bunnie
556f0aaea5 beginnings of a password dialog system 2021-07-22 03:04:16 +08:00
bunnie
5d62af49a5 simple signature checks in the bootloader now
checks xous.img as a single blob before accepting it.
2021-07-12 17:16:22 +08:00
bunnie
84a2e9f768 fix status bar so that it redraws out of suspend/resume
the bootloader modifies the screen, so all elements must
be redrawn regardless of the pervious state change!
2021-07-11 18:47:19 +08:00
bunnie
00be94d913 devboot mode support 2021-07-03 21:08:39 +08:00
bunnie
6825e2e7e8 reset the i2c machine every new transaction 2021-06-25 03:41:42 +08:00
bunnie
75dca6bd4c checkin for a rollback to sanity check some things 2021-06-25 02:09:42 +08:00
bunnie
7ea45b8e5b fix bias in deface lines 2021-06-21 00:54:18 +08:00
bunnie
e9499586f1 right. status loop was a mess.
classic code rot resulting from adding stuff that was never designed
to be in part of what was originally just a test loop to show
uptime.

cleaned it up, idle CPU load drops from 8% -> 2-3%.
2021-06-20 01:55:57 +08:00
bunnie
f4fbe84b78 improve redraw performance on menu
it helps to actually redraw the menu instead of relying
upon status updates to redo the Ux.
2021-06-20 00:44:59 +08:00
bunnie
c0d4cbe81d make the menu object more generic; demo with emoji selection 2021-06-19 04:44:21 +08:00
bunnie
2b5ba61552 add some useful messages on boot for the hosted mode users 2021-06-19 01:05:42 +08:00