Commit graph

2850 commits

Author SHA1 Message Date
Sean Cross
cd19fcba57 emulation: ec: i2c: allow reading multiple registers
Previously, the code would only allow for reading one register at a
time. This caused that one register to be duplicated repeatedly.

As a result, readings such as Voltage were incorrect.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-20 21:26:58 +08:00
Sean Cross
6d294c97c5 kernel: print connection count on per-process output
Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-05 15:11:47 +08:00
bunnie
5e369555d2 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-04-05 13:37:19 +08:00
Sean Cross
ab512c8996 kernel: services: fix recursion warning in Process
The `Process::defualt()` implementation started getting a recursion
warning in 1.60.0.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-05 13:32:48 +08:00
bunnie
5b8e53aacb remove "log" feature from NTP crate, trims off some executable size 2022-04-05 13:32:23 +08:00
bunnie
dacc38808e fix blocking message detection clause in two places 2022-04-05 13:31:50 +08:00
Sean Cross
e13bb426e3 xous: additional documentation on server errors
There are multiple reasons why a process might fail to create a new
server. Add notes on why this might be.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-05 12:45:03 +08:00
Sean Cross
6f4b58c47d kernel: add process name to server output
Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-05 10:41:22 +08:00
Sean Cross
ce4e40b28a kernel: add s command to print servers
This will print all allocated servers on the system.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-05 10:36:00 +08:00
bunnie
532c4a4f1f add NTP to time setting via SNTP library 2022-04-05 04:19:53 +08:00
bunnie
d183009cb6 add an extra release note 2022-04-05 01:12:08 +08:00
bunnie
dbce305f11 Merge branch 'bunnie-dev' into main 2022-04-05 01:11:23 +08:00
bunnie
56498ba0d2 add release notes as we move along 2022-04-05 01:10:59 +08:00
bunnie
cbb1e3f944 fix various bugs related to UDP; prep for transition to libstd-only UDP 2022-04-05 00:39:56 +08:00
bunnie
067c603e03 strip out old UDP libraries, harmonize on just libstd UDP 2022-04-04 23:15:51 +08:00
bunnie
57339dfe2f udp libstd passing inital tests 2022-04-04 22:37:01 +08:00
bunnie
cfcea2e094 shift the status bar a bit more
as uptime goes up, the width gets larger...
2022-04-04 04:54:37 +08:00
bunnie
b5a6c436c2 first draft at some basic libstd UDP mechanics 2022-04-04 04:49:17 +08:00
bunnie
b936414d11 emit a warning if apps don't recognize focus changes, instead of a panic 2022-04-03 17:49:12 +08:00
bunnie
66ca91dd6e
Merge pull request #130 from qbit/cb-test-fix
Pass register_name two args
2022-04-03 13:12:53 +08:00
bunnie
6a6574dfcc
Update README.md 2022-04-03 13:10:56 +08:00
Aaron Bieber
f9ca65be11 Pass register_name two args 2022-04-02 16:07:22 -06:00
bunnie
9dc75071ad split up the main.rs file
it's going to get unwieldy if we stick all of std::net into just main.rs
2022-04-02 17:57:50 +08:00
Sean Cross
9c68eb005a xous: definitions: update doc on Message.(valid|offset)
These fields are advisory, and may be repurposed to other uses.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-02 09:10:42 +08:00
bunnie
d026102d41 Limit scope of Foreground/Background messages to just app changes
Don't send FocusState::Foreground / FocusState::Background messages
to Layouts that are non-App type. This allows this to be used more
reliably as a signal of if the background is the running app or not,
rather than if it is merely the drawable canvas.
2022-04-01 22:54:33 +08:00
bunnie
fa10cfc040 minor typo fix 2022-03-31 02:38:08 +08:00
bunnie
ec4515579c stashing a bit of code so i can remember how to conjure a delay in susres 2022-03-31 01:44:48 +08:00
bunnie
8b5ad2657b an aborted attempt at doing a clean-shutdown for hosted mode
This doesn't work because the shutdown call destroys all the servers then terminates
the processes. But, the problem is that the processes are still
running, but servers are disappearing. So what you end up with is a
panic when the first message gets delivered to a server that no longer
exists, and then you end up with the program hanging on that panic
because some servers haven't been destroyed/exited yet and are now
just spinning waiting to be scheduled. so the call works in the tidy
kernel test cases but to get it to work on a full OS you'd need to
have a way to put every server into an eternal blocking state before
making the shutdown call (to prevent new messages from being issued
while servers are going away), which is more work than i'm willing to
put into the problem right now.
2022-03-31 01:10:58 +08:00
bunnie
52f1afa780 commit some improvements to the CI framework 2022-03-31 00:28:49 +08:00
bunnie
ba18f3cbe2 don't try to reset the RTC alarm in hosted mode
there isn't an RTC in hosted mode!
2022-03-30 23:33:00 +08:00
bunnie
29dab322ed add some comments on the modals tests. 2022-03-30 03:40:11 +08:00
bunnie
d61622bcde add a 1-second delay on resume before telling connection manager to reconnect
now that the suspender is in its own thread, we can do this safely.
It's nice to have a bit of a delay because we want other system recovery
things to take precedence and settle out before we try pinging the COM
to see how the wifi changed while we were asleep.
2022-03-30 02:34:22 +08:00
bunnie
c503316c3d refactor suspend/resume ordering
Add a "Later" stage, and have exactly one "Last" stage.

"Last" to suspend is the ticktimer -- this is crucial for
basically everything else to work. The other really
low level stuff that needs to work to the last minute is
now in the "Later" bin.
2022-03-30 02:30:39 +08:00
bunnie
6a6c2aef0f add a thread to respond to suspend requests on the connection manager
the connection manager actually wants a ping on resume,
and when we suspend we suspend -- "it is what it is". However,
the connection manager is a hairball that can block for a while,
so, to prevent failures to suspend, we put the suspend listener
in its own thread, and on resume the suspend listener will
automagically kick out an event to tell the connection manager
to deal with stuff.
2022-03-30 02:29:09 +08:00
bunnie
d8065b76df turn off RTC wakeup alarms
This call was originally part of the RTC driver, but when we
refactored things out, this was forgotten.

So, what would happen is, if you did a coldboot or reboot,
an alarm would get set and...well, the way the RTC blocks
is it'll keep asserting the alarm until you clear it.

This prevents the system from sleeping, and also keeps
the CPU pegged at 100% for some reason. The prevention
from sleeping makes sense to me. The CPU at 100% probably
indicates there's a problem in the event router, but
this path isn't used for anything at the moment so
we'll just open an issue and leave it as technical debt.
2022-03-30 02:27:14 +08:00
bunnie
04d074de1b fix hosted mode build 2022-03-29 22:55:27 +08:00
bunnie
93e22e88bb Merge remote-tracking branch 'origin/xtask-ureq-assets' into bunnie-dev 2022-03-29 22:51:14 +08:00
bunnie
1455ea6d8b clean up the suspend/resume path for the screen and enforce redraw 2022-03-29 22:50:25 +08:00
Sean Cross
e6209302e7 xtask: use assets api for determining URL
Now that we have full JSON parsing inside xtask, actually parse the
assets API endpoint to determine the correct URL.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-29 21:47:32 +08:00
Sean Cross
35857ab543 xtask: replace curl with ureq
The `ureq` package is much smaller, and may be more reliable on Linux.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-29 20:47:37 +08:00
bunnie
c8382a671a move the CPU status bar slightly to address text overflow issues 2022-03-29 16:54:27 +08:00
bunnie
d736d54cee make pddbtest not part of the hw build but part of hosted mode by default 2022-03-29 16:49:18 +08:00
bunnie
e4eed87a55 Merge remote-tracking branch 'origin/main' into bunnie-dev 2022-03-29 16:45:56 +08:00
bunnie
4f1f4a3907 optimize journal resolution code
We have the journals tracked in a HashSet, so, use the hashing
properties instead of an O(N) search.
2022-03-29 16:39:54 +08:00
bunnie
0bdf21b3ac retire debugging infos 2022-03-29 16:33:40 +08:00
bunnie
c542807958 fix PDDB bug where journal numbers on pages were incorrectly restored
An edge case was missed where a page which was allocated out of
the FSCB and then later written to disk was having its journal
number set to 0.

The root cause of the logic issue is that the page table itself
does not store a journal number. It's assumed that the page table
is ground truth, and is unjournaled.

As long as the pages don't exist in the FSCB, that's not a problem,
the journal number doesn't matter.

But, let's say this sequence happens:

1. FSCB allocates some free space
2. process takes that free space allocation and commits it to its own page table
3. FSCB update log gets a note that free space is now allocated
4. system reboots
5. process reads its page table from disk. There are no journals associated
with the page table on disk, so, it assigns a journal number of 0 by default.
6. we now have a conflict between the Process' view of the journal age
of that page table entry, and the FSCB's view.

The fix to this is during the page table scan, to check and see if
any candidate pages happen to already exist inside the FSCB. If it does,
then you adopt the latest journal number for that page in the FSCB.
This keeps the two views consistent.

A second bug was also identified while fixing this where the "Random"
order we were hoping for in visiting the free space cache as an
iterator is less random than we had hoped. So, there is a patch to
extract the free pages and pull one random one from the pool, using
entropy coming from the TRNG. This is less computationally efficient,
but at least it is correct and has more transparent properties
than relying on the indeterminism of the HashSet implementation.
2022-03-29 16:26:55 +08:00
bunnie
bdd194ea7b retire rust issue 90195 work-around in PDDB 2022-03-29 16:25:33 +08:00
bunnie
da89a61a28 retire work around for rust issue 90195 in I2C 2022-03-29 16:24:14 +08:00
Sean Cross
c1237ae023
Merge pull request #126 from qbit/bash
Switch to using env to find the path to bash.
2022-03-29 08:57:47 +08:00
Aaron Bieber
6f98940189 Switch to using env to find the path to bash.
Systems like OpenBSD and NixOS have bash in different locations. This
allows the various scripts to be run on those systems.
2022-03-28 16:43:47 -06:00