Commit graph

397 commits

Author SHA1 Message Date
bunnie
478a612c02 commit version bump 2023-09-12 16:25:10 +08:00
Sean Cross
5dfad296ae xous: mark MemoryRange::as_slice and friends as unsafe
Mark `MemoryRange::as_slice()` and `MemoryRange::as_slice_mut()` as
unsafe.

This is due to the fact that not all representable types can be cast to
an arbitrary value. For example, if Process A sends random values to
Process B, then Process B casts the memory to a slice of `bool`, then
any values that are not 0 or 1 are undefined.

Because these functions can leak UB into the program, they are marked as
unsafe.

This patch adds `unsafe {}` blocks to all instances where this function
is called. Additionally, all instances have been checked to verify that
they do not cast to any invalid types -- most use `u8` or `u32`.

Additionally, the long-deprecated `MemoryRange::from_parts()` call was
removed, since that causes UB without being marked as unsafe.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-09-12 10:07:38 +08:00
bunnie
53469a68d0 publish package updates, sync to release tag 2023-08-08 14:35:49 +08:00
bunnie
b127cd093f bump version pins for change to xous-rs 2023-08-03 13:29:39 +08:00
bunnie
51278451a0 update version pins to pull in cramium target 2023-07-19 21:07:56 +08:00
bunnie
1434764f08 Support open wifi networks
Mods to allow the EC to support open wifi networks. Requires an
update to the EC as well as Xous for this to function.

Before filing an issue, please check that EC version is v0.9.13-5-g8f7e23f
or greater by running `ver ec` inside shellchat.
2023-07-15 21:03:42 +08:00
bunnie
ee5168254e fix #396 2023-07-06 00:20:43 +08:00
bunnie
b2c64eb61a aesthetic cleanup; change default font for all modals
I decided to go back on the idea of not changing the modals
and now all modals use the new larger font as well.

This creates issue #396, which I will deal with later once
I have the time to do some more testing. I'm pretty sure
some other dialog boxes are broken now too.
2023-07-05 15:13:38 +08:00
bunnie
4ac979f0ab update pins, again 2023-07-04 11:20:12 +08:00
bunnie
c9f8f2681b update version pins 2023-07-04 11:09:13 +08:00
bunnie
952ba18fba commit vesrion pin bumps 2023-06-16 01:30:18 +08:00
Jean-Pierre De Jesus DIAZ
2af737b57e
xous-rs: move LANG variable to locales
This change is made with the intention of making the xous-rs crate a bit
more freestanding without depending on the xtask build system.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-06-15 18:23:12 +02:00
bunnie
0b32ac073b add scan state information to ssid scans
ssid scans can now be in-progress, and they also record
the time elapsed since the last scan was performed.

this allows the network manager to be a bit smarter about when
it decides to kick off a scan.

the ssid scan dialog box is also updated to show
the scan results in progress. This addresses #336.
2023-05-29 02:12:28 +08:00
bunnie
fbe3cb2a3d bump package numbers to absorb PR #388 2023-05-28 15:58:11 +08:00
bunnie
5a2df4432c technical debt: cleanup UTRA package
- make the "base" field no longer public. It is accessible, but only
through an `unsafe` method, because, it is unsafe.
- add accessors to offest/mask fields. Because, it's not at all
unsafe to access these, and it can be useful for bit-ops that are
not part of the generic set of UTRA.
- add Arc to AtomicCSR, and require `std` for AtomicCSR types.
This should not break anything, I checked inside @foundation-devices
keyOS and they don't seem to be using AtomicCSR anywhere.

The Arc makes it a bit safer to clone the AtomicCSR base pointer
and share it between threads, but it will have an impact on performance.
The USB stack (which requires AtomicCSR) was regression testing and the
impact seems minimal.

Recall that the main purpose of AtomicCSR is to provide a CSR accessor
that does not require a mutable reference to the base object. This
can make certain Rust idioms a bit cleaner. We wrap the base accessor
in Arc+Atomic to try and improve the safety of throwing the borrow
checker under the bus, but it's still not perfect because hardware
mutable state can have side-effects within hardware itself that cannot
be modeled or checked by Rust's borrow checker.
2023-05-23 18:11:24 +08:00
bunnie
2aa51736f5 fix #353 and possibly also #333
this adds a configurable autotype delay, and also adds a
left-handed mode option to the `vault` ui.

more testing is needed for #333, I think.
2023-05-22 17:22:17 +08:00
bunnie
d3dfe9fdde add option to lock device on autosleep. 2023-05-22 15:44:46 +08:00
bunnie
6f9febccf6 this resolves #383
Adds a menu item (defaults to 0 or off) for autosleep timeout in
minutes.

Once the autosleep timeout is hit, the system tries to suspend.

- It will not try to sleep if the system is plugged in.
- It will reset the timer if the power state changes (plug/unplug).
- It will reset the timer every time a key is pressed.
- The timer is reset on suspend, so it does not try to immedaitely re-sleep on wake.

The autosleep handler is domiciled in the "pump" loop which is
responsible for updating the uptime timestamp in the status bar.
It is pinged at a 1 second interval.

Therefore, the sleep timeout has a +/-1 second variability in it,
and also, a quick plug-unplug event (< 1 second) will likely go
unnoticed.
2023-05-22 02:32:13 +08:00
bunnie
2dc3d19bf1 add autounmount, autosleep handlers in preferences
but autounmount is just a placeholder
2023-05-22 02:31:50 +08:00
bunnie
fe646f52c1 fix #382
this should fix the issue on #382. The behavior is now:

*device not plugged in*

1. select "Lock device (reboot)"
2. device reboots
3. device goes to sleep
4. user wakes up the device
5. user is challenged with the unlock PIN

*device is plugged in*

1. select "Lock device (reboot)"
2. device reboots
3. user is challenged with the unlock PIN

I think this should be the "least surprising" outcome given
the description of the menu item.
2023-05-21 18:25:27 +08:00
bunnie
697d44de3d bump version pins to absorb changes to svd2utra etc. 2023-05-03 23:11:12 +08:00
bunnie
aa3c363548 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-05-03 22:54:09 +08:00
bunnie
7513f237e4 cleanup rev/revision manifest error 2023-05-03 22:53:54 +08:00
bunnie
c7a0057685
Merge pull request #370 from gsora/gsora/sleep-on-lock
Sleep device on lock
2023-05-03 22:53:18 +08:00
Gianguido Sorà
7cb2ec73f2 Merge branch 'main' into gsora/sleep-on-lock 2023-05-02 15:37:36 +02:00
Jean-Pierre De Jesus DIAZ
3e2eb63663
imports: remove com_rs-ref
The crate just re-exports the com_rs crate. This patch changes usages of
com_rs-ref to use com_rs directly.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-05-02 14:33:17 +02:00
Gianguido Sorà
42bc425ca9 reformat early_settings interactions so that it only writes if data is actually changed
also abstract get/set off the early settings FLASH section, easier to maintain

still todo: make hosted mode work again
2023-05-01 18:25:12 +02:00
bunnie
8a574f937f bump for xous-rs version pin update 2023-04-27 22:18:30 +08:00
Gianguido Sorà
6abf497ac9
services/status: if early sleep flag is present, sleep immediately
This flag is only set if the user selects "Lock (reboot)".

This way, the device sleeps immediately after boot, and makes easier turning it on and off in a safe manner.
2023-04-21 18:12:36 +02:00
bunnie
1392fdcf33 bump pins for updated log API 2023-04-16 02:27:37 +08:00
bunnie
849c136b90 bump versions because API crate changed 2023-04-12 23:02:30 +08:00
bunnie
2d1073faf0 add retry loop to EC version checking
sometimes it can take a bit longer for the EC to respond to
version requests. Instead of hard coding a timeout and check
poll the EC over a longer period, which leads to a system more
tolerant of the variations in startup times.
2023-04-09 14:22:54 +08:00
bunnie
8357ab31a5 bump all pins because utralib got updated 2023-04-09 00:48:35 +08:00
bunnie
9c94d6b4c0 bump versions because xous-rs API changed for gdb-stub 2023-04-08 23:49:24 +08:00
bunnie
db8348292f add force EC update to the non-initialized menu options
also bump release notes
2023-04-08 16:40:40 +08:00
bunnie
430d3550b7 move time services into the DNS crate
Time services are moved into the DNS crate so that the EC
update thread can remain running and consuming resources.

The problem is that we are out of connections in the connection table
(it's limited to 32 total), and in order to allow a "force update"
function for the EC we need to hold on to more connections than
are possible.

The "time" service is fairly self contained and could be moved
elsewhere. It sort of logically fit in the status crate initially
because the status crate manages preferences and displays the
current time on the screen, but it's modular enough that we could
put the service in any process space, at a minor trade-off of
the time UX function being public. This was avoided for a long
time because it could be a security risk but in the end the records
that store time zone and offsets are in the PDDB, which are accessible
to anyone who knows the names of these records, which is in the end
equivalent to knowing the name of the time UX server.

Thus the time UX server was made a dynamically registered "public"
server with just one connection (so only a minor downgrade in security,
the only vector exists in between boot and when the time servers
connect up), and the time server itself was slotted into the DNS
server's process space.

The DNS server was chosen because the DNS service itself is
very lightweight and will be unlikely to grow any heavier, so there
is little risk in merging the time service into the DNS crate's
process connection allocation.
2023-04-08 00:30:07 +08:00
bunnie
6e33ceba24 fix translations 2023-04-07 16:27:16 +08:00
bunnie
f8913ac944 initial steps toward #335
adds the menu item and handler for a force update
revises some of the wording of the menus so they are more
self-consistent

leaves the EC update handler thread running permanently so
that force updates can be caught and handled
2023-04-07 16:22:22 +08:00
bunnie
e469eba167 bump version for utralib patch 2023-04-04 02:13:02 +08:00
bunnie
f4fabc3f8e fix #337
Adds MAC display to preference dialog box

also offer both hex and decimal formatting outputs on wlan status
2023-03-24 23:07:29 +08:00
bunnie
e479de4e02 make time errors print the full RTC value set
this is necessary to debug more I2C weirdnesses.
2023-03-24 01:29:24 +08:00
bunnie
e32a22655b add a sanity check on the reported EC version 2023-03-23 03:17:05 +08:00
bunnie
704aaf98af bump versions for kernel interface changes 2023-03-22 02:48:55 +08:00
bunnie
303f595d6f bump versions to cleanup renode.rs sync issue 2023-03-14 16:34:53 +08:00
bunnie
fb3dabbd5d fix #326
- add some ux lag
- checks link integrity

previous commit also revises message on precursorupdater
per @nworbnhoj's comments.
2023-03-09 04:45:26 +08:00
bunnie
82e3aa322f bump toml files in prep for publish 2023-03-08 03:54:37 +08:00
bunnie
aea9b95506 skip checking any ec update image that reports a length beyond our slice bounds 2023-02-26 01:22:53 +08:00
bunnie
9140beef24 clear some warnings in hosted mode 2023-02-01 15:01:19 +08:00
bunnie
a4c97a410c handle time panics more gracefully; work around RTC HW issues
- don't hard panic if the time seems wrong; just clear
the PDDB entries, and move on. This at least allows the
user to intervene to fix the time, intsead of insta-crashing
when anything seems wrong and depriving users an opportunity
to fix anything

- fix HW derpiness by introducing some dummy reads during
the resetting of the hardware process.

One thing I wanted to do was to have the RTC always powered
off of the battery. This is not a default mode but it's an
option. In theory, this is a more efficient because anyways,
VDD comes from VBAT, right? However, the RTC hardware gets
a little side-eye when VBAT is higher than VDD most of the
time and reports a strange error code. The power savings
is miniscule -- some tens of nanowatts -- so I'm not going
to fight with the RTC hardware quirks anymore.
2023-02-01 03:19:32 +08:00
bunnie
f860f7bb33 add a mutex guard around I2C transactions
Individual I2C register reads and writes, even if to multiple bytes,
are atomic.

However, some i2c operations require multiple reads and writes
to be strung together without interruption for them to be valid.
A "mutex" is added, which if a program using I2C calls it prior
to their I2C operation, it will block if another program is
already using the I2C block for an uninterruptable series of
operations. The caller will automatically be unblocked once
the untinterruptable transactionts are completed.

Note that this is a collaborative exercise, a caller can still
try to initiate an I2C operation without getting a mutex first,
in which case it could interrupt another block that is doing something
uninterruptable. At the moment this merely generates a warning on
the console, but eventually, this will become a panic.
2023-01-31 18:22:10 +08:00
bunnie
9256e7cc09 bump versions to absorb xous-names fix 2023-01-31 15:07:32 +08:00
bunnie
b18230def4 move pddb dependencies to a feature flag for testing purposes 2023-01-31 02:34:12 +08:00
bunnie
84368c3f3a bump versions for publication 2023-01-31 02:18:12 +08:00
bunnie
329569803d note that lock device also has a reboot aspect to it in the menu 2023-01-20 00:15:03 +08:00
bunnie
232a4b6c6c bump xous version 2023-01-18 00:02:46 +08:00
bunnie
41d4837551 bump versions to absorb WDT change 2023-01-06 17:48:12 +08:00
bunnie
bb5d7b3adf bump versions to absorb hosted mode fix 2023-01-05 14:07:24 +08:00
bunnie
36398810dd bump version numbers to absorb new syscalls 2022-12-30 15:24:36 +08:00
bunnie
2f30e1b50a implement #269 2022-12-29 00:11:03 +08:00
bunnie
e422740d37 chore: last one. really. 2022-12-13 23:03:50 +08:00
bunnie
283ea1de0d chore: fix more typos, add french dictionary to vscode workspace settings 2022-12-13 22:49:25 +08:00
bunnie
1d94968b2f chore: fix typos 2022-12-13 22:36:47 +08:00
bunnie
bd230f5bb0 fix text to speech mode preferences setting
never allow the audio system to be turned off for blind people,
and disallow 0-volume setting as well.
2022-12-12 16:51:27 +08:00
bunnie
38bc254bb9 fix missing ja/zh translation 2022-12-12 16:28:33 +08:00
bunnie
5370ce396d bump all revs due to SoC artifact update 2022-12-12 16:07:20 +08:00
bunnie
80ce119c95 fix RSSI calculations 2022-12-12 15:31:06 +08:00
bunnie
edf24d9fc2 clean up on the wifi signal bars 2022-12-12 14:11:19 +08:00
bunnie
eb17edc4ec
Merge pull request #283 from gsora/feat/wifi-signal-bars
feat: wifi signal bar
2022-12-12 11:47:18 +08:00
bunnie
9a580070a3 revert threaded init question now that deface issue is fixed 2022-12-11 17:50:51 +08:00
bunnie
6138b65d76 update comments to reflect changes in CI infra 2022-12-10 23:44:18 +08:00
bunnie
1f89843122 defer init root keys question until status thread starts
also defer the preference thread from loading until after the
PDDB mount thread is started -- doesn't make sense to start it
any earlier than that, since it depends on the PDDB being mounted.
2022-12-09 12:38:53 +08:00
bunnie
dd82b7f32a add no-codec mode to status
this is for DVT builds where the codec isn't supported, needed
for efuse testing
2022-12-08 17:14:21 +08:00
bunnie
4f270f54be revert debugging on status opcodes 2022-12-07 22:24:56 +08:00
Gianguido Sorà
435a6ea2bd feat: wifi signal bar
This commit draws a Wi-Fi signal bar with 5 bars (lowest to highest signal), to the right of SSID name.

Signal power is calculated from a lowest of -90dBm to a maximum of -30dBm, by increments of 13dBm.
2022-12-07 14:28:07 +01:00
bunnie
8208a86c08 add the UX front-end for backup key burning
- instructions for BBRAM flow (refers to wiki)
- consent for efuse flow
- fix a blocking issue on backup prep (minor problem, just gives
users more time to contemplate without a panic)
2022-12-04 18:12:30 +08:00
bunnie
6f5d37866c clean up warning message 2022-12-02 15:06:00 +08:00
bunnie
e77588805c fix issue #282
this now refers the keyboard preference setting to the
correct, specialized location because it is the only parameter
that must strictly be available before the system is secured.
2022-11-30 00:23:52 +08:00
bunnie
1d1b3a35b7 commit version bump 2022-11-26 10:00:44 +08:00
bunnie
998061448c autobacklight on earlier; blocking poll of pddb mount
previously a busy-wait loop was used to poll the PDDB,
this makes it a blocking loop so the wait is more efficient.
also, allow the autobacklight to turn on before the PDDB
is mounted (so you can type your unlock PIN in the dark).
2022-11-24 14:02:18 +08:00
bunnie
9aa235d3d0 fix one more instance of old value being used for setting 2022-11-24 05:07:17 +08:00
bunnie
bacf2b65ab trigger off of the new value setting not the old; fix default value on boot for autobacklight 2022-11-24 05:06:03 +08:00
bunnie
ae68aa4120 Merge branch 'feat/user-preferences' into main 2022-11-24 01:15:00 +08:00
bunnie
be6f898e63 final re-org of top level menu before casting into CI 2022-11-24 00:47:32 +08:00
bunnie
b9682c240f add comment about menu positions and the final decision and rationale 2022-11-24 00:34:51 +08:00
bunnie
9e79dd5292 more translations and cosmetic improvements 2022-11-23 06:29:58 +08:00
bunnie
e9c94aaab6 fixup more translations 2022-11-23 06:12:18 +08:00
bunnie
0c849c148c remove wifi on/off from wlan setting
because the wifi kill switch is this setting.

trying to stick to the rule of "one place to set something only"
2022-11-23 06:02:38 +08:00
bunnie
4fdbec310c modify wifi on boot to wifi kill switch 2022-11-23 06:00:59 +08:00
bunnie
22ccc5836e move connection manager start/stop to the correct block 2022-11-23 05:46:15 +08:00
bunnie
816b3683c5 clean up connect to networks on boot flow 2022-11-23 05:43:11 +08:00
bunnie
c48e29fb2c add a way to specify a default value for a setting
turns out more than one item needs to have a default that
doesn't match Rust default values for types. add _or_value()
method so we can specify a default on a blank DB that matches
the expected UX
2022-11-23 05:01:03 +08:00
bunnie
c5d6bd655c fix polarity of preferences update 2022-11-23 03:03:31 +08:00
bunnie
74ccdd5eae cleanup translation 2022-11-23 02:57:08 +08:00
bunnie
8f8d4be73b cleanup autobacklight flow
remove redundant mention on top level menu
2022-11-23 02:52:16 +08:00
bunnie
26adda2fa7 CHORE: clean whitespace 2022-11-23 02:18:02 +08:00
bunnie
689276d631 localize autobacklight; make autobacklight on by default 2022-11-23 02:15:51 +08:00
Gianguido Sorà
d031948693 feat: handle volume preferences 2022-11-17 18:04:58 +01:00
Gianguido Sorà
6aa4291af9 feat(status): restore audio status and volume on boot 2022-11-17 18:04:43 +01:00
Gianguido Sorà
c7d38381a0 chore(status): add codec dep 2022-11-17 18:04:21 +01:00
bunnie
aa9977cc58 bump all the things because we changed utralib again 2022-11-17 22:13:40 +08:00