Commit graph

2764 commits

Author SHA1 Message Date
bunnie
ee695d0181 turn off time init check after it returns true
this reduces a bit of message chatter for a call that may be
called quite frequently.
2022-03-27 17:08:16 +08:00
bunnie
a7912b6296 fix a swap on pub/priv server to susres 2022-03-27 17:08:04 +08:00
bunnie
9555287273 remove a debug print 2022-03-27 17:07:48 +08:00
bunnie
ee4511c35d rework menu items and ordering
init for RTC shouldn't appear until keys are initialized and
PDDB has been mounted.
2022-03-27 16:45:22 +08:00
bunnie
2340686e80 rate limit error messages 2022-03-27 16:45:00 +08:00
bunnie
727135b347 throttle debug messages 2022-03-27 16:44:26 +08:00
bunnie
fc4a598a9b add a command to reset RTC after a PDDB format 2022-03-27 16:44:13 +08:00
bunnie
2751aa03d3 add a localtime server plus other annotations
std::time::SystemTime returns time in UTC.

That's great, but a lot of times we want local time.

Unfortunately, we can't use `chrono` to do that, because
chrono figures out what your time zone is usind `libc`, which
is a thing Xous doesn't have.

the `LocalTime` server is Xous' solution to that problem. it
returns the corret time offset based on the time zone.

You can still use `chrono` to convert the returned time into
strings and to compute durations.
2022-03-27 04:08:36 +08:00
bunnie
340cd89661 update status to use the new RTC functions for time
Time is replaced with error messages that indicate either time has not
been set ("Set Time"), or the PDDB has not been mounted (it says
"Login?"), if there is an error. otherwise it displays time
in the local timezone.

Time setting is kind of awful in that you have to enter the time
as UTC. And then a timezone as an offset in hours from UTC. It's
very bare-iron.
2022-03-27 04:06:42 +08:00
bunnie
107c63f7c2 update RTC functions to use libstd 2022-03-27 04:06:26 +08:00
bunnie
4b25be75d5 fix bcd/binary conversion problems 2022-03-27 03:00:50 +08:00
bunnie
1617200cb6 remove the RTC "reach-around" cheat inside shellchat's test routine
The test routine for shellchat "cheats" and accesses the I2C block
to test the RTC during factory operations. This is not aesthetic
and is also potentially a security hole since we don't want less
trusted stuff willy-nilly playing with i2c.

Rewrite to

1) remove i2c references from shellchat
2) replace RTC calls with the newer non-dangerous llio calls that are
limited to read out the initialized time variables.
2022-03-27 02:56:41 +08:00
bunnie
515d49db08 add a sync operation after every write
I did observe some PDDB corruption that happened today that looks
ostensibly linked to a record that didn't sync up with the disk,
so, let's be safer and sync everything. We can work on optimizing
performance after correctness is guaranteed.
2022-03-27 02:55:19 +08:00
bunnie
a103536b58 add a non-blocking mount poller to the PDDB
The problem with the current is_mounted() call is that it blocks
while the PDDB is requesting a password or actively formatting
(otherwise it doesn't block). It's actually just...partially blocking.

That doesn't cut it for libstd-linked system services that need to run but
before the PDDB comes up. In particular, we need to be able to respond
to time queries *somehow*, even before our timezone and offsets are
loaded from the PDDB.

I considered doing a callback mechanism for mounting, but this
is kind of complex and probably not worth it. Instead, a separate
thread that can return the value of a single boolean revealing
the mount state of the PDDB is created, and you can create an
object that's capable of inspecting that boolean.
2022-03-27 02:52:29 +08:00
bunnie
a6af300157 don't repeat the menu key if it is press-held 2022-03-27 00:19:55 +08:00
bunnie
96f0a0d2ea add the actual thread to the code base and clean up some warnings.
Next up:
 - code up libstd glue
 - code up test cases
2022-03-26 02:42:42 +08:00
bunnie
b59e2ae2bf add reference to the time server.
We still need to *start* the thread, ya know...
2022-03-26 02:37:30 +08:00
bunnie
4ac38027a2 add function to return the hardware RTC value as u64
the u64 in and of itself is meaningless, without the context
from the PDDB that adds the offset to wall clock time plus
time zone. This is glued together by the time.rs stub inside
the status service.
2022-03-26 02:36:35 +08:00
bunnie
df96ca1429 test for libstd Instant 2022-03-26 02:35:59 +08:00
bunnie
319e0e0641 add a comment about not modifying ticktimer APIs due to libstd dependency 2022-03-26 02:35:38 +08:00
bunnie
91d0511fa4 add Seek trait to the PDDB 2022-03-26 02:34:57 +08:00
bunnie
86ab8c392d add libstd time handler glue stubs 2022-03-26 02:34:38 +08:00
bunnie
0abd4a1db6 add a response code for dictionary not found 2022-03-25 23:50:26 +08:00
bunnie
cda15a1bb3 add a routine to convert hw RTC to a seconds count. 2022-03-24 18:44:06 +08:00
bunnie
92f1552d94 Merge branch 'main' into bunnie-dev 2022-03-24 03:32:36 +08:00
bunnie
0bcc93c78e attempt to add persistent storage to hosted mode PDDB
This will create a 100MiB file in tools/ppdb-images/hosted.bin
(sorry!!) which is persistent storage for hosted mode.

Delete the file if you want to start over from scratch.

It's...pretty brittle. I expect problems, but maybe it will at
least get things moving.
2022-03-24 03:21:00 +08:00
bunnie
bfb8a17cd5 strip out legacy RTC calls in preparation for refactor 2022-03-24 02:19:26 +08:00
bunnie
b4c98528e8 add notes around names that are baked into libstd 2022-03-22 22:30:43 +08:00
bunnie
b50dbf0a69 silence a warning in the loader module about an unused macro 2022-03-22 22:18:40 +08:00
bunnie
7c3601bd25 convert the connection manager to use the new PDDB blocking call 2022-03-22 22:18:31 +08:00
bunnie
36ea69f6df add a one-liner API call to block execution until PDDB is mounted 2022-03-22 22:18:23 +08:00
bunnie
2cc8a1b24a silence a warning in the loader module about an unused macro 2022-03-22 22:17:27 +08:00
bunnie
fe52756a3d convert the connection manager to use the new PDDB blocking call 2022-03-22 22:17:04 +08:00
bunnie
86e86df68c add a one-liner API call to block execution until PDDB is mounted 2022-03-22 22:16:46 +08:00
bunnie
954840a5d0 Merge branch 'main' into bunnie-dev 2022-03-22 02:15:57 +08:00
Sean Cross
a70aee7bad loader: move loader into main workspace
Add the loader into the main workspace, removing it from its own
sub-workspace. We can do this now that we can specify the linker script
in `build.rs`.

This improves IDE support, and should shrink disk storage requirements.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-22 02:09:18 +08:00
bunnie
5d59390554 Merge branch 'main' into bunnie-dev 2022-03-21 18:59:10 +08:00
bunnie
9e5dec302c
Merge pull request #121 from blakesmith/sleep_screen_clear
During sleep, clear the rest of the screen around the sleep note
2022-03-21 13:58:19 +08:00
Blake Smith
77b5e7a2bb During sleep, clear the rest of the screen, to avoid
any secrets being persistently visible on the display.
2022-03-20 15:35:02 -05:00
bunnie
b4d20a643c add tts locale to hello example 2022-03-21 00:22:54 +08:00
bunnie
731b847560
add translations
I think "hello world" might actually be the phrase used by the Japanese in their intro texts so leaving that as English.
2022-03-21 00:07:07 +08:00
bunnie
c83ff4048e
Merge pull request #120 from blakesmith/hello_world_squash
Add a basic 'hello world' app example
2022-03-21 00:02:25 +08:00
bunnie
d27645f65b Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-03-20 15:25:55 +08:00
bunnie
526a7374b0 re-introduce PDDB structure nuking on SoC reset 2022-03-20 15:25:14 +08:00
Sean Cross
e96a7df267 xtask: remove renode-bypass for renode-image
The `renode-bypass` flag is used for development in order to speed up
certain features. This creates invalid keys and skips many checks, which
causes problems in the main image.

Remove this flag in order to fix the Renode image.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-20 10:37:17 +08:00
bunnie
b52b73ddfa add functionality to override the CSR data in case it is corrupted 2022-03-19 16:56:03 +08:00
bunnie
b06d7c4bb7 add a note about the hard reset 2022-03-19 16:31:37 +08:00
bunnie
1856a83e3e fix ordering of updates to prevent mid-update resets 2022-03-19 16:22:09 +08:00
bunnie
2aa72fae18
Update factory_reset.sh 2022-03-19 09:01:40 +08:00
bunnie
d9f4f6d041
Update factory_reset.ps1
move soc update to top so we don't get resets from latest xous
2022-03-19 09:00:58 +08:00