Commit graph

1847 commits

Author SHA1 Message Date
Sean Cross
c59cdfbd51 kernel: rename WouldBlock syscall result
This reflects the new naming convention, which is clearer.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:25:39 +08:00
Sean Cross
afdf8531aa kernel: use resolver v2
This is required now to support tests, since tests create processes as
threads.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 12:25:15 +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
ccc577f8d7 clean up the update flow 2021-08-16 02:46:54 +08:00
Sean Cross
0c372263ff loader: mark sections as +X
It is unclear why this is required. More investigation
is needed.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-15 21:59:19 +08:00
Sean Cross
4700275b93 loader: handle sections on page boundaries
Handle a section that ends exactly at a page boundary.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-15 21:54:59 +08:00
Sean Cross
1b315de830 kernel: make init proces stack grown downwards
Previously, we were creating a stack beginning at the initial page,
and then growing it upwards. The correct behavior is to begin it at
the top and grow it downwards.

In order to do this, subtract the size of the stack from the initial
pointer.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-15 19:26:11 +08:00
Sean Cross
e29dc5a739 kernel: don't allow allocating exception thread
This prevents the exception thread from being allocated as a normal
system thread.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-15 19:25:29 +08:00
bunnie
353311b987 fix USB update flow 2021-08-15 16:03:18 +08:00
bunnie
a19fc87687 clean up warnings, and fix some hosted mode issues 2021-08-15 00:46:16 +08:00
bunnie
20a6244687 cargo.lock updated after the merge 2021-08-15 00:20:23 +08:00
bunnie
47489dc990
Merge pull request #79 from samblenny/com-wlan
Add wlan shellchat command
2021-08-14 23:14:27 +08:00
bunnie
6a7e6a7504 Merge branch 'bunnie-dev' into main 2021-08-14 22:50:38 +08:00
bunnie
870bd5e632 committing a generic soc_csr.bin image -- should unbreak things for other users 2021-08-14 20:04:49 +08:00
bunnie
c88c986aea clean up key signing routines, finally everything "seems" to work 2021-08-14 19:46:42 +08:00
bunnie
b4ee254001 finally, a semblance of sanity... 2021-08-14 16:24:19 +08:00
Sam Blenny
af25697a6f Merge remote-tracking branch 'upstream/main' into com-wlan 2021-08-13 23:01:12 +00:00
Sam Blenny
a1bd9c18fd Update com_rs submodule to get new WLAN_* verbs
Signed-off-by: samblenny
2021-08-13 22:41:25 +00: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
bunnie
ee4368e747 gateware update code in place 2021-08-13 06:00:21 +08:00
bunnie
f334199ee6 commit host mode debugging 2021-08-12 23:01:34 +08:00
bunnie
063b9e58b6
Update flash.md 2021-08-12 17:03:33 +08:00
bunnie
8305f3029b
Update flash.md 2021-08-12 16:58:13 +08:00
bunnie
bba6fc0cb5
Update flash.md 2021-08-12 16:04:25 +08:00
bunnie
7bcbe79575
Update flash.md 2021-08-12 16:03:49 +08:00
bunnie
020c723eaa
Update flash.md 2021-08-12 16:02:46 +08:00
bunnie
b1f3735cc9
Update flash.md 2021-08-12 16:02:00 +08:00
bunnie
c4a0a178f9
Update flash.md 2021-08-12 15:59:53 +08:00
bunnie
a59e4f995c initial take at converting loader to do fallback instead of fail-hard 2021-08-12 03:48:11 +08:00
bunnie
192109d09a add some skeletal jtag access routines to rootkeys 2021-08-12 02:32:38 +08:00
bunnie
dc931d4a35 Merge branch 'main' into bunnie-dev 2021-08-12 02:01:57 +08:00
bunnie
1c447fabef Merge branch 'jtag-premerge' into main 2021-08-12 01:55:48 +08:00
bunnie
3d65d7d5ed add some docnotes on the resolution to the problem 2021-08-12 01:42:58 +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
Sean Cross
45ae45a218 cargo: remove rkyv from log-server lockfile
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-11 11:00:56 +08:00
Sean Cross
e38366c99a log-server: refactor to remove rkyv and custom Strings
This removes all custom string formatting from the `log-server`.

This should improve performance, because we're not roundtripping between
various archive formats. We instead do a single copy and operate
directly on that buffer. We also now write bytes directly, as opposed to
creating intermediate strings.

This fixes a memory issue that was introduced recently.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-11 10:59:31 +08:00
bunnie
0234b4b22d add shellchat jtag debug commands 2021-08-11 06:15:23 +08:00
bunnie
799bb6050e add jtag commands, reboot after burn 2021-08-11 06:15:04 +08:00
bunnie
35e7cfe89e jtag server now reporting ID 2021-08-10 22:46:00 +08:00
bunnie
bdd70f9502 stash to figure out build issue 2021-08-10 22:41:22 +08:00
bunnie
3be03bfb8b fix debug statements 2021-08-10 22:41:15 +08:00