Commit graph

1074 commits

Author SHA1 Message Date
bunnie
f95941af83 add I2C features to the board description file 2024-10-06 02:44:47 +08:00
bunnie
7399c4a6da add mapping for i2c channels to global clocks; fix typo 2024-10-06 02:44:16 +08:00
bunnie
d45052b772 add i2c base driver 2024-10-06 02:43:49 +08:00
bunnie
81c6d9510b modularize the udma module 2024-10-04 22:59:02 +08:00
bunnie
d21789beff remove the chip select gpio-wait hack
We use the txrx call instead, which does not signal a completion
until the rx transaction is finished (which is after the final
bit is received of a pending SPI transaction).
2024-10-04 22:51:36 +08:00
bunnie
683aa63616 add async txrx variant to spim API
This allows us to do a "swap" transaction (transmit and receive)
asynchronously (the await returns a pointer to the receive buffer).

Note that a pure-rx-only variant is still todo, but should follow
pretty naturally from the pattern outlined here.
2024-10-04 22:49:56 +08:00
bunnie
669ab294f2 update lib refs and manifest 2024-10-04 13:05:40 +08:00
bunnie
be8f939311 update hardware descriptor to point to the oled 2024-10-04 13:05:01 +08:00
bunnie
437dcb2de5 add IoGpio trait
this allows us to stash a reference to the Iox in both std
and no-std reperesentations of the hardware.
2024-10-04 13:04:22 +08:00
bunnie
b6532ffd39 add the 'SharedCsr' type object
this is a CSR object that presents writes as an immutable on the
parent object. This simplifies traits, etc.

On the one hand, the CSR itself is truly immutable - the address
represented by the CSR does not change.

On the other hand, the underlying data inside the CSR is changing,
so, the CSR actually represesnts an immutable pointer to a mutable
piece of data.

For the case of the UDMA, we have a bank of globally shared state,
it is much more convenient to think of the CSR as immutable, and
we manage the underlying global shared state through other checks,
e.g. through dynamic allocators that track when various blocks
or resources have been parceled out.
2024-10-04 13:01:03 +08:00
bunnie
c2ff7c759d prelim driver for sh1107-style OLED displays 2024-10-04 13:00:36 +08:00
bunnie
c44f117331 fixes to udma SPIM for tx-only mode
- fix tx_await() condition to consider both control and tx channels
- make tx_async more efficient for the common case that the buffer
fits in a single transaction by appending the CS de-assert as part
of the initial command stream
- make trait for the udma global clock setting

The high bit in this exploration is that there seems to be no
way to actually confirm when a UDMA transaction has fully completed
on the hardware interface. All the completion signals tell you
when the software-side UDMA resources are freed up. However, in this
case, the hardware-side resources may still be transmitting/receiving
data.

This is a problem for the case of a '4-wire SPI' display where you
need to set an extra line to control command/data mode addressing.

In this case, the current work-around is to read back the state of
the chip select pin as a GPIO to determine when the hardware has
finished.

I suspect that if we can figure out how to use UDMA in a full duplex
mode that we could do something more essentially linked to the
hardware, but this would also require having a dummy Rx buffer allocated
that is the same depth as the hardware Tx buffer if all you cared about
is the hardware conclusion of a Tx.
2024-10-04 12:53:55 +08:00
bunnie
412a76288a fix formatting 2024-10-02 01:47:41 +08:00
bunnie
d6790489f1 migrate more board parameters to board files 2024-10-02 01:44:33 +08:00
bunnie
20dd9b2c14 consolidate spi pin setup routines 2024-10-02 00:23:17 +08:00
bunnie
6eca732043 cleanup a warning 2024-10-01 23:15:22 +08:00
bunnie
c0ddf5f82a add board feature placeholders 2024-10-01 23:14:20 +08:00
bunnie
81637f119b add helper to translate return values from io setup to udma clock channels
this allows us to tease out the clock setting code from the pin
setting code. probably will need to add more helpers for other
peripherals as we continue through with this exercise.
2024-10-01 23:13:08 +08:00
bunnie
45d9487c70 add board module to the project 2024-10-01 23:12:53 +08:00
bunnie
1dbfb21020 add some stand-in code for board definitions on the cramium platform 2024-10-01 23:12:30 +08:00
bunnie
c7bdc1aec5 refactor iox to have a setup_pin() trait
this lays the foundation to make code portable between std and
no-std environments for setting up pin configurations.
2024-10-01 23:11:24 +08:00
bunnie
ab41cbc299 make aclk test allow both registered and unregistered mem configs
both are valid, which is picked in the end will depend on
timing closure
2024-09-26 18:19:27 +08:00
bunnie
0b419400c7 improve reset condition for filter & make pass criteria tighter
- filter setup can be impacted by previous engine running, make
sure engines are stopped and FIFOs flushed prior to test start
- when reading a filtered bank we can get garbage, so make the
test check for the specific value we should see.
2024-09-26 18:18:12 +08:00
bunnie
81f0523ee3 add functional multiply-accumulate test
note that multiplies must go from register to register,
they can't directly pull out of FIFO regs
2024-09-26 18:17:31 +08:00
bunnie
7b8f4d91ec add mul unit test 2024-09-26 18:17:14 +08:00
bunnie
043dfd84ae update formatting to latest nightly rules 2024-09-24 01:49:45 +08:00
bunnie
67e0004f73
Merge branch 'main' into rkyv-0.8-migration 2024-09-23 22:32:34 +08:00
bunnie
f494da21cc absorb new xous-ipc version 2024-09-23 22:05:50 +08:00
Sean Cross
8e27dce59c flatipc: release 0.1.2
This releases flatipc 0.1.2 with more documentation and a new
`Ipc::from_memory_message()` call to reconstitute an object from a
xous::MemoryMessage.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-23 19:32:54 +08:00
bunnie
3a9a7ebf02 length of a record stored is the pos field for rkyv-to-pddb
prior use of `rkyv` reserves two bytes to record `pos` pre-pended
to the rkyv record

the new rkyv works without having to do that because it indexes
the rkyv data off the end of the stored records. Thus, all you
need to know is the total length of the byte slice that stores
the serialized data. This is available as the return argument
when you read a PDDB key, so we don't have to explicitly store it
anymore.
2024-09-23 17:01:13 +08:00
bunnie
c699e06c5a port rkyv ser/de usage in mtxchat 2024-09-23 17:00:16 +08:00
bunnie
75954de8d6 commit the version bump 2024-09-23 01:46:25 +08:00
bunnie
888cd2252e
Merge branch 'main' into rkyv-0.8-migration 2024-09-23 01:23:12 +08:00
bunnie
44b9041d0d attempt to update rkyv use in TLS library
@nworbnhoj would love it if you could have a look at
the implementation and let me know if I've ported this correctly.

I think what was going on is you were using rkyv to serialize
a structure to the PDDB. I've just updated the ser/de to use
the latest `alloc` API (which is much simpler than the API used
in xous-ipc because it is no-alloc).

I'll try and run some tests that involve the TLS crate too down
the road under the theory that it would suss out any porting
errors.
2024-09-23 01:14:41 +08:00
bunnie
4c7c9312c1 change xous-ipc api to 0.10.0 2024-09-23 00:24:48 +08:00
Sean Cross
3eb54d2cc9 flatipc: add more checks to vec and string
These are required as this goes across the IPC boundary.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 19:26:48 +08:00
Sean Cross
0c5b011fcf flatipc-derive: remove outdated header
Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:51:40 +08:00
Sean Cross
c8d70aae6a flatipc: run cargo +nightly fmt -p flatipc
Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:49:56 +08:00
Sean Cross
a77fdac6f0 libs: add flatipc implementation
flatipc is a new method for doing IPC. This is a zero-copy approach
where structs are given `repr(C)` implementations that are well-defined
and work across process boundaries.

If the same struct or enum is used in two processes that has the same
layout, then data can be freely passed between the two processes without
incurring a serialization or deserialization penalty, provided the
following hold:

1. The buffer must be page-aligned and be a multiple of the page size
2. The item must be `#[repr(C)]`
3. There must be no pointers or references of any kind

If these three things hold, then the object is safe to sling across the
process boundary.

This crate adds the ability to annotate structs with
`#[derive(flatipc::Ipc)]` to provide them with this functionality. When
doing so, objects gain the `.into_ipc()` call that turns them into
something that can be sent across process boundaries.

The resulting object has `.lend()`, `.lend_mut()`, `.try_lend()`, and
`.try_lend_mut()` as functions.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:32:58 +08:00
bunnie
34e6f46d63 formatting changes that resulted from the regex search
a bunch of lines are shorter or different length now which
triggers a mandatory reformat. this patch cleans that up,
so that going forward the manual rework patches are clearer and
not tied up with formatting patches.
2024-09-22 15:31:14 +08:00
bunnie
52ffd88b40 regex search/replace instances of xous_ipc::String to String
split into multiple commits for easier committing
2024-09-22 14:17:03 +08:00
bunnie
3cdf01d5e9 fix rust-1.80 warnings for cram-soc config 2024-08-19 02:57:12 +08:00
bunnie
00da783c4d add filter tests to dma suite
the filter is on by default (which blocks all DMA access with
the null settings) and can be configured to restrict access to
regions of memory that contain secret materials.
2024-08-02 17:25:38 +08:00
bunnie
28142e2b24 cleanup bios tests 2024-07-13 22:34:59 +08:00
bunnie
c3bbbbd672 fix bug in i2c library where i/o was not set low
you have to write *0* to the clear register to set the port low.
always the weird gotcha on that one...
2024-07-05 01:59:14 +08:00
bunnie
2ebe7f3c64 fix port ordering for NTO
don't think we'll be doing much with the MPW + PIO banks anyway anymore...
2024-07-05 01:58:42 +08:00
bunnie
059855201b add a simple dmareq handler test 2024-07-04 05:26:22 +08:00
bunnie
7f35fa8e72 add unit tests for aliased fifo pages 2024-07-04 03:58:33 +08:00
bunnie
7b2109b1cc improve bio tests
- don't dead reckon tests: read feedabck from the hw to know
when they are done
- fix doc bugs
- add more test feedback on long-running tests
2024-07-03 01:23:48 +08:00
bunnie
e0d09f1d3b more DMA corner cases
bytes, half-words, words, multi-core contention, oh my!
2024-07-01 16:45:02 +08:00
bunnie
64c281bfe0 add DMA tests to bio library 2024-06-30 03:28:22 +08:00
bunnie
6ddc8bc79a
Merge branch 'main' into nto-work 2024-06-27 00:41:07 +08:00
bunnie
311154e231 absorb version bump 2024-06-27 00:26:12 +08:00
bunnie
43db94061d add arithmetic tests
this exercises a simple stack-based routine to check that
the RAMs are correctly wired. Note that due to a lack of
creativity on my side, only cores 0, 1, and 3 are exercised;
it's just assumed that core 2 works as well since everything is
instantiated by loop.
2024-06-27 00:11:52 +08:00
bunnie
d665805523 Refactor remaining tests for multi-bank RAM op
BDMA memory pages for each core are now on separate pages, with
each core having a private memory space.

Also add code readback tests, debug PC & trap test
2024-06-26 15:01:59 +08:00
bunnie
bd9500110c copy xous-bio crate to xous-bio-dma
this is the starting point for the rework of the BIO with DMA mods
2024-06-25 03:32:49 +08:00
bunnie
d0f94424db reformatting and shuffling of test order and printouts
just determining a good target length for instruction memory size
for the next iteration of the bio core
2024-06-25 03:32:12 +08:00
bunnie
6618d8dc4d improve docs on what's happening in the TRNG buffer 2024-06-22 21:18:48 +08:00
bunnie
3cefb722e6 harmonize register set for testing to what's in hw 2024-06-21 18:55:54 +08:00
bunnie
75cc40d866 Update TRNG settings
new settings are much *much* better; no more need for entropy
compression.
2024-06-18 00:08:03 +08:00
bunnie
57342ebc4a commit some one-off hacks while trying to explore reliability of serial USB 2024-06-16 01:51:57 +08:00
bunnie
9bcb65449e fix missing dir api 2024-06-15 17:54:49 +08:00
bunnie
831cad011e add flow control and and enq/deq management on app buffers
currently uses just a "dumb" 0-to-max scheme and then block until
drain. A more efficient implementation might implement a circular
buffer but it's more tricky to code -- just want to get something
working for now.
2024-06-15 17:36:12 +08:00
bunnie
7824874cc8 some tweaks to try and make stalls appear at the right time??? 2024-06-14 18:57:48 +08:00
bunnie
832d0205c2 expose append zero packet api and rename function to be generic 2024-06-14 16:11:38 +08:00
bunnie
d2c534a3c8 document the entropy compression method
compression helps us reduce the amount of data we have to
shuttle between the hardware interface and the rest of the world.
It takes more samples from the TRNG and represents them in a compressed
form that effectively increases the bits per byte of entropy. It
does not increase the *rate* of entropy generation -- while each
byte has more entropy, the bytes come proportionally slower. However,
this is a reasonable trade-off because kernel space calls to fetch
the entropy feed are expensive, and what this does is effectively
amortize the price of a syscall: the time per syscall is longer,
but you get more entropy out per syscall, thus effectively reducing
the needed overhead to get a certain amount of entropy.
2024-06-14 16:09:01 +08:00
bunnie
f6fe1143e2 compress sparse TRNG output data 2024-06-14 14:33:11 +08:00
bunnie
af4f096387 quiet down debug 2024-06-13 22:07:08 +08:00
bunnie
5a1c3ca6fe cleanup warnings on the USB driver 2024-06-13 16:08:18 +08:00
bunnie
a360f3ee52 bump xous pins for RawTrng API 2024-06-13 15:49:35 +08:00
bunnie
b24cf4fd8e add guardband code to driver 2024-06-13 15:42:58 +08:00
bunnie
34808beb8f remove unused dep 2024-06-13 15:32:34 +08:00
bunnie
3abb68cbdc adjust TRNG parameters to match hw reality 2024-06-13 15:32:06 +08:00
bunnie
61ed5aa145 reduce debugging so USB serial works 2024-06-13 00:35:17 +08:00
bunnie
1de497e3fe commit the todo 2024-06-12 14:16:49 +08:00
bunnie
bbc7158dc1 cleanups to debug output
works under linux, not windows
2024-06-12 14:11:16 +08:00
bunnie
f96ca0ee93 ok. finally, an end to end of HID: can send keys now to linux
windows still not working, it's fussier.
2024-06-11 23:18:13 +08:00
bunnie
7b2804eec5 endpoint enumeration now working
turns out that you *have* to enable the endpoints after your
address has been assigned. You can't do it before.

Very subtle one-liner in the docs that I missed until now. :-/
2024-06-11 22:30:55 +08:00
bunnie
f004c45f2a trying to debug ep activation problem
this commit hangs on a wait for ep to start running
2024-06-11 21:13:45 +08:00
bunnie
b08851b741 enumeration is now "mostly" working
- need to handle something with how stalls are handled
- need to handle responses to requests that don't exist
2024-06-11 16:38:34 +08:00
bunnie
cb12ee3769 first time we're seeing a handshake in xous. 2024-06-10 23:35:09 +08:00
bunnie
ac7b58b702 trying to back-trace to a working bootloader state 2024-06-10 18:45:44 +08:00
bunnie
3f75da8240 commits related to previous commit on demo 2024-06-09 23:53:55 +08:00
bunnie
31e03a9bc7 add routines to move packets; refactor tricky bits
we're able to receive the setup packet, but still nothing is
being sent out of the core.
2024-06-09 04:27:31 +08:00
bunnie
a32a2f2395 more debug progress
- 2nd bank of magic numbers seems more stable-ish
- can now get to the point of a setup packet being received
and flagged
2024-06-08 00:51:13 +08:00
bunnie
ca8fd21c44 interrupts are minimally responsive now 2024-06-07 13:54:37 +08:00
bunnie
41d0364cf4 more debug 2024-06-06 22:26:16 +08:00
bunnie
e9217b7eb6 convert HAL to be driver-friendly
rewrite so the driver obeys the type bounds necessary for
USB stack integration, in particular, Sync requires all raw pointers
to be AtomicPtr
2024-06-06 17:54:24 +08:00
bunnie
8ef46fd081 move usb driver to a common location 2024-06-06 03:58:35 +08:00
bunnie
907b0c543a move order of tests 2024-06-03 03:43:57 +08:00
bunnie
c4d787356b add aclk unit test 2024-06-02 20:20:06 +08:00
bunnie
5c9b91d22a integrate i2c driver and update test log 2024-06-02 19:17:27 +08:00
bunnie
cc7b1158f3 create a "proper" i2c driver for BIO
this is an actually usable driver for end applications.
maybe some massaging needs to be done on shared resources, but
from the i2c standpoint this can do SMB, I2C transactions with
a fairly "normal" API.
2024-06-02 19:16:27 +08:00
bunnie
3e263c1974 update docs to match small change to spec 2024-06-02 06:21:42 +08:00
bunnie
559be323b7 i2c demo about working 2024-06-02 06:21:29 +08:00
bunnie
935857a675 add basic i2c concept 2024-06-02 02:39:45 +08:00
bunnie
23f2b117ab dont use report_api inside the generation macro - just for debugging 2024-06-02 02:39:30 +08:00
bunnie
9fe1933611 minor cleanup 2024-06-02 02:39:06 +08:00
bunnie
41e636bb8c fix formatting 2024-06-01 22:00:30 +08:00
bunnie
c113c4e9bd incorporate i2c module, pretty prints 2024-06-01 22:00:07 +08:00
bunnie
24bd9da6ab pretty-print unit tests 2024-06-01 21:58:18 +08:00
bunnie
e0f3ee8e49 pretty-print spi 2024-06-01 21:58:05 +08:00
bunnie
ccc342d9f3 add debug pretty-printing to test 2024-06-01 21:53:54 +08:00
bunnie
ac95f9a6df
Merge branch 'main' into bio 2024-06-01 11:03:53 +05:30
bunnie
a8518f7fa1 create a serializable version of Spim
this works by blowing apart the structure and re-assembling
it on the other side. The reason we can't simply pass it
is because the hardware pointer to the core register violates
a Rust safety rule, but Rust doesn't know that this pointer
points to a hardware register that's immutable and static versus
a regular block of memory that can go away.
2024-05-31 20:39:39 +08:00
bunnie
cdf0289099 add rv deps to the cramium-hal
needed for manipulating irqs
2024-05-31 03:39:32 +08:00
bunnie
17a2330681 add an IRQ API for the UDMA
this API has the unfortunate problem that only one process
can manage all the IRQs for all the serial ports, due to the
concentration of all IRQs into a single register bank.

That being said, it does support registering multiple repsonders
in a somewhat ergonomic fashion.
2024-05-31 03:38:23 +08:00
bunnie
35e7cf3a5b bump xous dep revs 2024-05-29 02:07:06 +08:00
bunnie
34e7474b80 add work-around for DAR-620
UDMA Rx busy bit seems to get stuck occassionally. This seems
to be aggravated if we insert a dcache_flush in the poll loop.

The current time-out code seems to mitigate the problem, but
I have low confidencne that this is a 100% solution. I have a feeling
we'll be revisiting this again soon.
2024-05-22 18:08:50 +08:00
bunnie
9e66c1bee2 commit the version bump 2024-05-07 01:03:05 +08:00
bunnie
0f79056ac7 refactor spim divider equation to reflect reality 2024-05-06 03:32:41 +08:00
bunnie
6723b9d67c cleanup missing APIs
- need to be able to specify the mode that a SPIM could be in
that was set up by the bootloader
- make yield() optional - it could be useful if the API is used
in userland contexts, but in an interrupt context (e.g. swapper)
it should not be used.
2024-05-06 02:26:55 +08:00
bunnie
58308656a0 fix feature flags for xous deployment 2024-05-06 02:25:09 +08:00
bunnie
be2e450686 fix address ordering error on RAM 2024-05-05 21:48:04 +08:00
bunnie
914acb9c12 apply the optimization to writes as well 2024-05-05 16:41:00 +08:00
bunnie
6d7d3b244d slight optimization to SPIM read 2024-05-05 16:39:59 +08:00
bunnie
ad4f05bed5 fix address ordering bug; cleanup chip select timing 2024-05-05 16:31:21 +08:00
bunnie
a0aeaae106 issue command to exit quad mode, in quad mode
if not in quad mode, command is ignored; but without this,
the command is never accepted if you are in quad mode.

the idea is you use this to reset the chip when you don't
know what mode it's in.
2024-05-05 03:23:37 +08:00
bunnie
7c0aa1bcbe add debugging support to HAL lib
tries to do the right thing in both Xous and bare metal environments,
although, xous formatting might be a little funky.
2024-04-30 17:12:41 +08:00
bunnie
1b4e6b310a SPIM bug fixes
- improve visibility of core structures for debugging
- add qpi-mode ID readouts
- support different commands for flash/ram ID readout
- fix bit-shift bug on cmd (docus say to "align to MSB" but
I don't know what MSB they are talking about, it only works if
you align the commands to LSB).
2024-04-30 17:11:02 +08:00
bunnie
436be7ae9c fix masking bug in iox implementation 2024-04-30 17:10:28 +08:00
bunnie
34489d5f94 raise visibility of internal ifram structures
allows for abstraction violations but at this stage of debugging,
we'll need it.
2024-04-30 17:08:09 +08:00
bunnie
e5dfd14daa fix bugs found by rustc
thanks, rustc, for finding these bugs!

this is why we cleanup warnings regularly.
2024-04-29 04:08:52 +08:00
bunnie
0131315e3a cleanup trng warnings -- it's going to be a while before this is fixed
I think I may have to be patient on waiting for docus on how to
tune the trng, so, turning off these warnings for now. trng tuning
will be "an event", I expect.
2024-04-29 04:07:52 +08:00
bunnie
431ca216f9 improve visibility of hal elements 2024-04-29 03:43:03 +08:00
bunnie
e3e3b3125c cleanup warnings 2024-04-28 02:57:24 +08:00
bunnie
588e1cf9f1 add some debugging, convenience routines to trng driver 2024-04-28 02:44:10 +08:00
bunnie
c407db877e change DUART ports to accommodate jtag breakout 2024-04-22 11:00:06 +08:00
bunnie
4ace363abc this resolves comments from @xobs' code review 2024-04-09 18:23:09 +08:00
bunnie
588e7aaf0a add spi memory drivers to udma library
totally untested, but, at least structurally present so we
have a chance that our memory structures and APIs can work.
2024-04-06 22:54:34 +08:00
bunnie
d6b33159a5 stage version pin bump 2024-04-01 15:46:26 +08:00
bunnie
62b2567ade add comprehensive host fifo test 2024-03-20 13:41:40 +08:00
bunnie
5911808611
Merge pull request #509 from betrusted-io/bio
WIP: BIO driver
2024-03-12 18:24:38 +08:00
bunnie
133bb2b74f fix a few minor details missing in the tests
also update docs and completion tracker
2024-03-12 13:54:07 +08:00
bunnie
4fa3dd3b59 add spi unit test 2024-03-12 04:53:37 +08:00
bunnie
a96abc669f add interrupt clear call 2024-03-07 01:32:15 +08:00
bunnie
2f5a717e65 add unit test for inter-core events and fifo events
synthetic test that exercises multiple cores triggering each
other, waiting on each other to complete tasks, and waiting on
the host to meet conditions such as fifo fullness levels before
running.

this proves out the basic concept of inter-core eventing.
2024-03-04 04:08:01 +08:00
bunnie
0844cfbc52 more unit tests
fifo input/output from host with back-pressure works
gpio loopback input testing works

framework for automated assertion testing is in place;
all tests from this point forward will endeavor to include
some asserts that will cause the test to fail, so we don't require
manual inspection to check test results.
2024-03-03 18:33:30 +08:00
bunnie
8a7b5e5627 add the FIFO basic unit test + todo list of tests 2024-03-03 02:39:12 +08:00
bunnie
e1b0d83cbd add test plan 2024-03-02 02:02:02 +08:00
bunnie
e3cdb4a35d unit test for "hello multiverse"
four cores started all at once, each responsible for updating
a byte of the GPIO range, in unison.
2024-03-02 02:02:02 +08:00
bunnie
6c6634540c skip address tag embedded within the loadable program 2024-03-02 02:02:02 +08:00
bunnie
260ec0b39b wrap assembly code generator in a macro
This macro takes as arguments the name of the function
you want to use to retrieve the assembly code, and two labels,
one for the start and one for the end of the assembly code,
and the assembly code itself.

The labels for the start/end of assembly code are identifiers
and because of Rust's rules macros can't create identifiers out
of thin air (I wish instead of saying "partially hygienic", they
just said, "you can't create identifiers that don't exist". Yes,
I'm sure "partially hygienic" has some other meaning to computer
science people but to me it's just pretentious bullshit that
forces me to read through four blog posts and three issues to
come to the practical conclusion I really wanted to know; I
think maybe they wanted to refer to it as hygiene because the
limitation is super frustrating and hygiene sounds like a positive
way to spin something that is annoying. Sure. It's fine. You
didn't want to allow macros to make identifiers because it can lead
to surprising behavior and name space conflicts. That's your choice
as a language designer, just say it.).

Anyways. as usual, rust macro took way too long to write.
2024-03-02 02:02:02 +08:00
bunnie
f24746b88a start on a simple "multi-core" test 2024-03-02 02:02:02 +08:00
bunnie
633b76eb5d flesh out common useful routines for bio access 2024-03-02 02:02:02 +08:00
bunnie
e297c02cf3 add crate for BIO - better I/O - driver 2024-03-02 02:02:02 +08:00
bunnie
b6e5e7f2c2 apply formatting patch
@nworbnhoj, i saw you had explicitly done a formatting pass.
However, I think maybe the +nightly flag was missing, it looks
like the formatting ignored our custom rule set, which requires
nightly?
2024-03-02 01:26:51 +08:00
nworbnhoj
ffac721c6b rustfmt
deliberate check of automated rustfmt_check.yaml

confirmed - system works
2024-03-01 09:19:15 +10:00
nworbnhoj
01b13e0e32 replace vendored-in rustls::crypto:💍:SUPPORTED_SIG_ALGS with public access 2024-03-01 06:50:04 +10:00
nworbnhoj
7f19e660d9 add link to rustls issue
https://github.com/rustls/rustls/issues/1819
2024-02-29 09:53:02 +10:00
nworbnhoj
b217c1546e tls tidy-up 2024-02-29 06:52:50 +10:00
nworbnhoj
6d24f1af41 refine tls probe() remove unnecessary Option 2024-02-29 06:18:43 +10:00
nworbnhoj
17c1fabc1e refine shellchat net tls test for tls 1.3
https://docs.rs/rustls/latest/rustls/manual/_03_howto/index.html#unexpected-eof
2024-02-28 13:55:49 +10:00
nworbnhoj
332c2975ba reinstate tls::ota add_der_header() and rm_der_header()
In keeping with webpki-roots - the TrustAnchors are managed without the Der Tag::Sequence header

This in turn requires that:
- the header is removed from x509 fields before saving in the pddb, and
- the der Tag::Sequence is added to ota.subject before it can be decoded  () see ota.subject()
2024-02-28 12:40:05 +10:00
nworbnhoj
7760b02229 refine tls::ota.from(&TrustAnchor) 2024-02-28 06:59:38 +10:00
nworbnhoj
faece9783e refine tls:rota.subject() -> Result<String, Error> 2024-02-28 05:24:57 +10:00
nworbnhoj
8ed22b8257 refine shellchat net tls mozilla 2024-02-27 08:48:10 +10:00
nworbnhoj
a3740df71a refine shellchat net tls test 2024-02-27 07:23:09 +10:00
nworbnhoj
bb2b7f05e7 fix tls::ota.pddb_key() 2024-02-27 07:22:11 +10:00
nworbnhoj
2cc0052d7d refine tls::ota.into() TrustAnchor 2024-02-27 07:21:36 +10:00
nworbnhoj
e608e7bb30 update shellchat net tls mozilla for rustls v22.2 2024-02-27 07:20:32 +10:00
nworbnhoj
1f6ec1fe69 refine danger:StifledCertificateVerifier 2024-02-25 15:50:47 +10:00
nworbnhoj
92d1b21caf Add a single bogus TrustAnchor to danger::StifledCertificateVerification root_cert_store
rustls::ServerCertVerifierBuilder::build() returns a `CertVerifierBuilderError` if no trust anchors have been provided.
2024-02-25 15:49:36 +10:00
nworbnhoj
8d4494a005 implement tls::ota.subject() 2024-02-25 15:47:32 +10:00
nworbnhoj
04e2311920 simplify rustls::ClientConfig in tls.probe() 2024-02-25 07:42:45 +10:00
nworbnhoj
bda9bc94e2 tidy-up after update to rustls v22.2 2024-02-25 05:28:07 +10:00
nworbnhoj
2d744f1267 resolve tls ownership issues 2024-02-25 05:23:57 +10:00
nworbnhoj
39f3b782fa update tls lib.rs for rustls v22.2 2024-02-25 05:20:48 +10:00
nworbnhoj
ad01b7de6c rename RustlsOwnedTrustAnchor to OwnedTrustAnchor and update for rustls v22.2 2024-02-25 05:07:05 +10:00
nworbnhoj
fa24528226 update impl ServerCertVerifier for StifledCertificateVerification 2024-02-25 03:16:18 +10:00
nworbnhoj
8e7fd7d1a8 relocate ServerCertVerifier 2024-02-15 10:42:32 +10:00
nworbnhoj
84200b2cd2 replace Certificate with CertificateDer 2024-02-15 10:41:45 +10:00
nworbnhoj
60aa640f23 relocate ServerName 2024-02-15 10:33:55 +10:00
nworbnhoj
2b3d982d3f relocate TrustAnchor 2024-02-15 10:30:08 +10:00
nworbnhoj
d0fba6fbd7 replace SystemTime with UnixTime 2024-02-15 10:28:17 +10:00
nworbnhoj
ba6d3fcdf6 rename WebPkiVerifier 2024-02-15 10:27:17 +10:00
nworbnhoj
f2204c5a25 relocate ServerCertVerified 2024-02-15 10:23:48 +10:00
bunnie
32a8a54ec4 upgrade sct so we're all using ring-0.17 2024-02-11 01:32:13 +08:00
bunnie
5fb368ae05 partial progress on porting to ring-0.17 2024-02-09 17:18:41 +08:00
David Kotval
8eb0a26d51 fix: don't break tls
Due to our patch of ring@0.16.0, we must be careful
that none of the transitive deps of the tls packages
try to use a newer ring.
2024-02-08 12:47:45 -06:00
bunnie
98f964be50 fix cramium target 2024-02-06 15:30:48 +08:00
bunnie
699004e7b0 bump xous pins 2024-02-06 14:49:10 +08:00
bunnie
bf15d7c803
Merge branch 'main' into refactor-sha2 2024-02-01 01:46:31 +08:00
bunnie
40423f9448 fix hosted and renode modes 2024-02-01 01:42:18 +08:00
bunnie
55d88587a9 upgrade all the subordinate Cargo.toml files to match the patch
looks like about 9 crates will be affected by this. Point them
all to the latest version of the API, and specify the
"precursor" feature (which activates our patch)
2024-01-30 01:43:09 +08:00
kotval
fe5a93744f
Merge pull request #1 from kotval/out_of_tree_issue
Localization Issues
2024-01-29 10:44:35 -06:00
buncram
36c8e87889 add before/after data wait states to chip select; fix bug in CSR alloc 2024-01-29 02:07:45 +08:00
buncram
8d729cee01 cleanup warnings in ifram 2024-01-29 02:06:32 +08:00
bunnie
faa867e63d fix bug in page alignment logic
size, you can do this one liner:

let aligned_size = ((unasigned_size + alignment_quanta - 1) / (alignment_quanta)) * alignment_quanta;

before i was doing this with a `let mut` + `if` statement. this is not as obvious
but more compact, probably you'll start to see this idiom more and more in the code.

I think it's also computationally efficient, because as long as
the alignment_quanta is a power of 2, the compiler does something
like a shift right with the `/` operator (and it may also do something
like a shift left with the `*` operator as well).
2024-01-28 17:08:04 +08:00
bunnie
da0d08f7b6 fix scalar5 return parsing
there isn't an arg0 in the `ScalarMessage` return type but
that doesn't mean numbering starts at 1. So the first slot
should remain unused if you're not casting a return value
to `MessageId` (which is "just" a `usize` but "feels wrong")
2024-01-28 16:38:05 +08:00
bunnie
528abf3b9f fix bugs in baremetal udma API 2024-01-28 16:01:33 +08:00
bunnie
67ca9f1d90 implement spim TX routines for UDMA 2024-01-28 02:15:21 +08:00
bunnie
9f8cfde417 update toml's to reflect baremetal->std change 2024-01-27 16:53:35 +08:00
bunnie
74219d58f5 change "baremetal" to "std" as a feature
has the opposite meaning, makes it easier to just include the
things that we don't want in kernel or loader mode
2024-01-27 16:52:39 +08:00
bunnie
e1b5487de0 refactor cramium HAL to pull ifram allocation into hw managers 2024-01-26 22:50:17 +08:00
bunnie
13122663f3 intermediate progress, have to switch branch 2024-01-26 01:21:06 +08:00
David Kotval
14da821164 fix: added English stubs to tls messages. 2024-01-24 16:42:36 +00:00
bunnie
3063e76c1c add option to derive rkyv types for iox functions 2024-01-23 03:59:32 +08:00
bunnie
60dc329cbc ugrade unit tests to use the auto-generated irq names 2024-01-22 23:24:47 +08:00
bunnie
b5be447170 add notes 2024-01-20 21:31:05 +08:00
bunnie
d4e6cbc442 cleanup pl230 test 2024-01-20 21:29:19 +08:00
bunnie
d990a4d3b2 xous is now a Rust target, so we have to specify baremetal explicitly 2024-01-20 17:45:36 +08:00
bunnie
75217075c1 fix up bugs in trng hal; automatically reset generator on exhaustion 2024-01-20 16:16:31 +08:00
bunnie
2fb5b171c0 add sce to hal crate 2024-01-20 01:26:10 +08:00
bunnie
001e501fc6 initial take at the SCE TRNG API 2024-01-20 01:25:52 +08:00
bunnie
b72a365c1f adjustments for virtual memory
the library now automatically does v2p mappings for DMA targets.
2024-01-19 23:19:51 +08:00
bunnie
a0e464bcee turn Udma into a trait
I think this makes the code more clearly reflect the intended
"hardware polymorphism" effect of the udma implementation
2024-01-18 18:49:37 +08:00
bunnie
28d959f938 add cramium-hal library 2024-01-18 18:00:49 +08:00
bunnie
09487cbcb4 chore: fix default clock rate for simulation framework
have to slow down the defalut clock rate for the FIFO test in PIO
unit test, so we can capture results in simulation
2024-01-16 17:41:41 +08:00
bunnie
508c610339 prefsgenerator not in workspace but still needs formatting 2024-01-15 01:04:36 +08:00
bunnie
e274fa8873 relate perlib to the libs/ directory
perflib was made before we had libs, so put it into its new, proper
home.
2024-01-15 00:52:43 +08:00
bunnie
0c50581e9c more rustfmt-related fixes 2024-01-15 00:43:52 +08:00
bunnie
0267a56989 format Cargo.tomls
because apparently cargo fmt doesn't format Cargo.toml files???
2024-01-15 00:14:39 +08:00
bunnie
7d9874e522 strip trailing whitespace on mass-storage 2024-01-14 23:58:20 +08:00
bunnie
59c6d6ae77 format libs/xous-pl230 2024-01-14 19:24:12 +08:00
bunnie
ee2c7ef140 format xous-pio 2024-01-14 19:22:37 +08:00
bunnie
f00293a3a8 suppress formatting on in-line assembly in xous-pio 2024-01-14 19:22:18 +08:00
bunnie
508476a085 libs/userprefs 2024-01-14 19:14:08 +08:00
bunnie
c43fd370ee format libs/tls 2024-01-14 19:13:54 +08:00
bunnie
84590c58fc format libs/cos_table 2024-01-14 19:12:38 +08:00
bunnie
660c3b06f9 format libs/chat 2024-01-14 19:12:20 +08:00
bunnie
f196bcf469
Merge pull request #465 from nworbnhoj/sigchat
Link sigchat to existing Signal account
2024-01-08 17:23:09 +08:00
bunnie
8ec08c9c76 fix rust v1.75.0 warnings that are probably benign
a lot of re-import warnings have cropped up. While I appreciate
their studiousness on this, the problem is that removing some
of these exports in the API crate could mean that future users
who want access to some API features that aren't used in this
configuration are now unaccessible.

I think it's not a huge problem at the moment, just spam-cleaning
the warnings because there are too many to deal with carefully
at the moment.
2024-01-04 19:15:28 +08:00
nworbnhoj
05c991e3a2 Merge branch 'main' into sigchat 2023-12-26 08:14:42 +11:00
bunnie
fda782663a bump version pins for xous change 2023-12-26 00:13:10 +08:00
nworbnhoj
854b2198c4 tls doc & tidy-up 2023-12-24 06:03:26 +11:00
nworbnhoj
5703707cca implement Tls.accessible() 2023-12-22 14:25:51 +11:00
nworbnhoj
7d72387cb9 simplify TLS.probe() modals 2023-12-22 14:24:08 +11:00
nworbnhoj
0ca24db2f0 implement Tls.is_trusted_cert() & Tls.is_trusted_x509() 2023-12-22 14:23:04 +11:00
nworbnhoj
6e1947d3b0 rename Tls.*_cert() to Tls.*_rota()
actually this is a correction of the names of these fn
these fn are actually handling trust_anchors rather than certificates
and in some cases we will need equivalent fn for certificates
2023-12-21 16:33:47 +11:00
nworbnhoj
12c74e724f implement Tls.inspect(host)
Tls.probe() now returns a Vec<Certificate> and Tls.inspect(host) presents the trust_modal to the user
2023-12-21 07:48:09 +11:00
nworbnhoj
de1dcffd66 rename shellchat net tls inspect
rename shellchat `net tls probe` to `net tls inspect`
2023-12-20 18:44:52 +11:00
nworbnhoj
2684a55888 Merge branch 'main' into sigchat 2023-12-20 05:26:19 +11:00
nworbnhoj
d22317018b rename Tls.trust_modal() 2023-12-19 06:03:23 +11:00
nworbnhoj
de6b6baab9 extend shellchat net ws to utilize /lib/tls 2023-12-19 05:09:11 +11:00
nworbnhoj
bcb6a8c3bf implement tls.stream_owned() 2023-12-18 17:16:33 +11:00
nworbnhoj
90daccea46 merge main into sigchat 2023-12-05 13:19:49 +11:00
bunnie
efb087c01a
Merge pull request #455 from betrusted-io/mtxchat-layout-tests
WIP: Mtxchat layout refactor
2023-12-02 16:13:04 +08:00
bunnie
fa3f349a0a bump pins as xous-rs has changed 2023-12-01 21:20:01 +08:00
bunnie
f88afd1a1a fix various edge cases; move status bar redraw to end of routine
putting the status bar redraw at the end means that even if
the fitting of the boxes isn't 100% correct, the status bar still
ends up "on top".
2023-12-01 17:55:39 +08:00
bunnie
0da86640b1 cleanup debug statement 2023-12-01 17:55:26 +08:00
bunnie
e4fba76ed2 add some debugging infos
the scroll-down freeze is actually because of the nature of
the test program hijacking the main loop. the test program
probably needs to be redesigned so it takes in events so we
don't eventually end up in deadlock
2023-12-01 03:17:00 +08:00
bunnie
157f0031e6 refactor layout to take advantage of pre-computed height bubbles
mostly works, so checkpointing it here. need to debug why going down
after going up (in terms of selection) is not working.
2023-12-01 02:23:47 +08:00
bunnie
7222fb0de9 add an optional bounding rectangle field to posts
this is computed when the post is added to the list of posts.

Also split out the visual properties of a UI into a separate
struct so that we can pass it as a single argument to routines
that could handle layout-related tasks.
2023-11-30 23:05:41 +08:00
bunnie
c5dff9d35d Merge branch 'main' of github.com:betrusted-io/xous-core into mtxchat-layout-tests 2023-11-30 18:19:20 +08:00
nworbnhoj
e8e875742e replace more TcpStream::connect(&str) with TcpStream::connect((&str, u16))
resolves #453
2023-11-30 20:29:15 +11:00
nworbnhoj
0fc9a07f5e replace TcpStream::connect(&str) with TcpStream::connect((&str, u16))
resolves #453
2023-11-30 19:41:42 +11:00
bunnie
4a5bedd6ab Merge branch 'main' of github.com:betrusted-io/xous-core into mtxchat-layout-tests 2023-11-30 14:22:15 +08:00
nworbnhoj
ffa3d56af4 fix ChatOp::PostAdd to default correctly to dialogue_key set by ChatOp::DialogueSet 2023-11-30 07:24:58 +11:00
nworbnhoj
7e485885b7 introduce tls probe help modals
- invalid certificate modal
- unknown issuer modal
- not valid yet modal
2023-11-29 16:42:21 +11:00
nworbnhoj
492d089d5c fix typos 2023-11-29 12:06:02 +11:00
bunnie
dcd8076306 pull in the comments and notes from #445 so it's in the code 2023-11-28 17:53:12 +08:00
bunnie
c2becc089b implement default behavior when no dialog is specified.
- the `post_add()` API on the 'lib' side of things says Add a new Post
  to the current `Dialogue`, and it passes an empty `dialogue_id` string.
- the `post_add()` handler on the server dutifully unpacks the `dialog_id`
  field with `post.dialogue_id.as_str().unwrap()`, and then passes on to
  the `post_add()` call inside the UI object
- the `post_add()` implementation in the UI object then checks the
  `dialog_id` with if `pddb_key.eq(&dialogue_id)`, expecting that the key
  should match the dialog id. But through this path, the dialogue ID
  is always the empty string, so the function can't work.

This patch causes the code to "fall through" and use the default
`pddb_key` if the length of the `dialog_id` is zero. Not sure if
this is the intended behavior, but in the test case at least I get
posts appearing now once this patch is in.
2023-11-28 17:24:56 +08:00
bunnie
d4624124c9
Merge pull request #443 from betrusted-io/chat-status
WIP: Chat status
2023-11-03 13:54:34 +08:00
bunnie
6ab88117f6 bump xous-api-log version & fix version pins 2023-10-31 20:07:28 +08:00
bunnie
5aefcac8ec add forced redraw function, fix misdirected message
- rapid redraws are normally aborted by this routine. offer a forced
redraw in the case that a "final state" has to be rendered without
fail.

- fix a misdirected message (sending it to app instead of to ui by
accident)
2023-10-29 23:03:46 +08:00
bunnie
d4a934785b re-introduce a default text to display when going out of busy state
this simplifies the problem of tracking concurrency if multiple threads
are requesting a busy-state to be presented. In this case, when the
final thread leaves its busy state, the idle-state will be shown.
2023-10-29 20:07:22 +08:00
bunnie
4423339059 move wifi delay hook to the correct area
- remove modal pop-up for wifi connection, and replace with
busy animation
- specify units of delay in the constants (_MS to indicate milliseconds;
this is a convention I'm trying to adhere to)
- partial progress on debugging why the animation isn't running
(value of animation variable is not being passed back at the GAM layer).

Also a general note on coding styles that probably is going to cause
confusion now that more people are contributing to the code base.

Generally, when a lot of "generic" library functions fail, we've been
passing an error message up the stack. However, these functions are
actually meant to be infalliable, and when you kick the error up the
stack you just end up with a panic at an unhelpful location (because
you finally catch the error only at the main loop or something and
by that point there's nothing you can really do about it but panic,
since it's supposed to be an infalliable operation).

As a result I have been trying to tamp down on needless error propagations
and having them fail with a unwrap or expect at the point where the
abstraction should be infalliable. This helps in debugging the actual
failure root cause because you're closer to the line of code that
actually broke, instead of just some line at a generic error handler.

Of course if you build with stack unwinding the top-level unwraps are more
useful because you can peer down into the call chain, but even then,
with the limited screen real estate I think deeply nested failures
would probably overflow any panic display. So even with panic unwinding
I think we stil want to keep the root cause within a few stack frames,
instead of errors being passed up sixteen levels of abstraction before
finally dying.

This only applies to things that are meant to be truly infalliable,
like syscalls that should not fail, or like unpacking a buffer or
memory message that has already been allocated. In this case the errors
are more like asserts, and are helpful if they fail at the line where
they break instead of being passed up the call stack (which was the
original architecture).

Probably I should add a note about this to the Xous Book.
2023-10-29 16:33:03 +08:00
bunnie
4e027b676c remove logic from status primitive and make the interface simpler
- status bar text is just status bar text now
- idle animation runs/stops based on an explicit run/stop message

Note that at the moment if one starts the busy bar and a modal pops
up, you might overflow the queue of the ui drawing thread with animation
requests, because the thread blocks when the modal is summoned.

Modals "take the screen" anyways, so maybe the solution to this is
to add an additional interlock around any modal calls within the UI
main thread. Need to think about it a bit more.
2023-10-29 01:08:38 +08:00
bunnie
d844c4306c reduce size of chat status bar to match status bars above 2023-10-28 22:50:23 +08:00
bunnie
be39c44b17 add a stand-in initial startup message
This prompts users on how to raise the menu. Not sure if it's
the right thing, but it's something.
2023-10-20 00:48:10 +08:00
bunnie
b456bfaf3b add busy-wait animation server and hooks for managing the same
Busy-wait animaitions are handled by a helper server that is normally
blocked. A single shared `bool` indicates whether the animation should
run or not.

When woken up, the busy-wait animator will check if the shared `bool`
is set, and if so, send a message to the main loop to update
the animation, then send wait an appropriate timeout and send itself
a message to re-check the animation status.

This particular format of server is fairly compact but can be vulnerable
to a "message storm" if busy state updates happen in rapid
succession without allowing the server to unblock and handle messages.
Thus, all messages to this server use a `try_send` method, with a silent
failure if the message can't be sent. In other words, if the animator
is already super busy and its queue is full, don't send it more messages,
just drop the existing updates so we can fail without a panic or deadlock.
The typical consequence of this is some UX inconsistency, which is
not a critical error.
2023-10-20 00:43:09 +08:00
bunnie
355425726d add data structures to track status bar state
- status bar gets some initial text on boot
- previous status message is saved when entering a busy state,
and restored on exit
- add routines for hopefully making the redraw a bit more efficient
if the only thing happening is a busy-wait update.
2023-10-20 00:41:19 +08:00
bunnie
8401d924e0 add opcodes for updating status bar and running busy animations 2023-10-20 00:40:26 +08:00
bunnie
d63b5912b1 absorb new xous-rs version 2023-10-10 16:50:00 +08:00
bunnie
83256257e1 bump xous-rs crate to absorb Send derives on Messages
this is necessary for the smoltcp port
2023-10-03 20:54:14 +08:00
bunnie
7e204604e9
Merge pull request #418 from nworbnhoj/chat
integrate tls trusted root_store into mtxchat
2023-09-26 11:02:18 +08:00
nworbnhoj
61c1747475 integrate tls trusted root_store into mtxchat
Set up tls with rustls::ClientConnection,
BUT - on Error::InvalidCertificate - then
probe the host for the untrusted certificate chain and prompt the user
to perhaps trust one of the certificates in the chain - then try again.
2023-09-25 11:22:47 +10:00
bunnie
e6c61455ba update PIO code for SoC integration
- add duart debug for bare iron testing
- add wait states on FIFO commits for when CPU clock is much
faster than PIO clock.

more wait states will be needed for correct operation in the
future
2023-09-22 22:19:32 +08:00
bunnie
08827633ac bring Chat dependencies up to date 2023-09-19 19:41:56 +08:00
bunnie
a00672cd27 fix missing use statements in tls lib 2023-09-19 19:39:27 +08:00
bunnie
b3e9108bb7
Merge branch 'main' into revert-414-revert-409-tls.probe 2023-09-19 19:28:30 +08:00
bunnie
9f57ad96fd
Merge pull request #408 from nworbnhoj/chat
mtxchat app and chat library
2023-09-19 19:09:56 +08:00
bunnie
c5d81ef08b
initialize menu before mounting PDDB
This is necessary because mounting the PDDB is a "secure" operation, and secure ops will fail until all UX contexts are occupied.

This problem does not manifest in hosted mode because we cheat and automount the PDDB in hosted mode.
2023-09-19 19:08:36 +08:00
nworbnhoj
7803efec7f pass room_alias aka dialogue_id aka dialogue.pddb_key to mtxchat.listen()
this ensures that new Matrix Events received from the server are added to the correct chat::Dialogue
2023-09-18 18:49:59 +10:00
bunnie
82c7b6ebed bring the versions up to date with main for a cleaner merge 2023-09-15 16:32:04 +08:00
bunnie
885e877b43 add features for mdma test to control RAM src/dest regions
The MDMA controller seems broken on the FPGA board, but is working
in RTL. Add a feature flag that allows us to toggle between modes.
2023-09-15 15:09:20 +08:00
bunnie
ab8a5aefcf fix target dependency options 2023-09-15 11:25:22 +08:00
bunnie
49eaac1b46 fix port I/O settings 2023-09-15 11:25:08 +08:00
bunnie
d47bc1af0a remove pio_generated, we should now be relying on utra 2023-09-14 16:25:14 +08:00
bunnie
2387aa4dff migrate to latest pio; tweaks to PIO tests 2023-09-14 16:24:39 +08:00
nworbnhoj
61743a9c76 mtxchat tidy-up 2023-09-14 05:30:33 +10:00
bunnie
06953cec55 remove overly sensitive test case
this case is too sensitive to clock config outside of the PIO
block, because it relies on some specificts of how inter-bus sync
works and the environment is free to set PIO and PCLK relationship
arbitrarily
2023-09-13 10:29:14 +08:00
nworbnhoj
d8db9ad2a7 fix tls::rota.public_key() 2023-09-13 07:20:10 +10:00
nworbnhoj
a06d84d8a9 convert mtxchat to use tls.root_store()
a ureq::Agent is configured to use tls.root_store(), and used for all comms with the matrix server
2023-09-13 07:18:22 +10:00
nworbnhoj
c22419f7c7 bump rustls to harmonize versions 2023-09-13 06:57:39 +10:00
bunnie
b29d29eb0e
Revert "Revert "Tls.probe"" 2023-09-12 19:55:50 +08:00
bunnie
7efcca39d5
Revert "Tls.probe" 2023-09-12 19:13:11 +08:00
bunnie
478a612c02 commit version bump 2023-09-12 16:25:10 +08:00
bunnie
1ebee74bb1
Merge pull request #409 from nworbnhoj/tls.probe
Tls.probe
2023-09-12 16:07:52 +08:00
nworbnhoj
d4c5ae1447 convert tls::danger to non-public 2023-09-11 13:49:48 +10:00
nworbnhoj
5cacb9c20e TLS tidy-up 2023-09-11 09:37:09 +10:00
nworbnhoj
d57c1143bb TLS doco 2023-09-11 09:35:49 +10:00
nworbnhoj
8ab3aa85be implement tls.probe(target)
moved from tls::cmd to tls::lib
2023-09-11 08:59:08 +10:00
nworbnhoj
a46dad11d2 mtxchat tidy-up 2023-09-09 10:36:37 +10:00
nworbnhoj
c50cc73610 mtxchat add navigation help on first login
chat add help navigation modal
2023-09-09 10:24:52 +10:00
nworbnhoj
a7d3b34563 Merge branch 'main' into chat 2023-09-08 13:48:45 +10:00
nworbnhoj
3542103510 mtxchat tidy-up 2023-09-08 13:46:52 +10:00
nworbnhoj
ff68567140 chat UI rawkeys toggle menu_mode & raise app/msg menus 2023-09-07 11:38:21 +10:00
nworbnhoj
c7c0041922 Chat readme & comments 2023-09-01 05:41:40 +10:00
nworbnhoj
2f157d5957 implement ChatOp::Dialogue::Save 2023-08-30 04:46:44 +10:00
nworbnhoj
7b7a7003f1 implement chat Dialogue navigation with up/down keys 2023-08-28 09:58:57 +10:00
nworbnhoj
77f25bc416 implement chat icontray 2023-08-23 09:04:42 +10:00
nworbnhoj
197ed63058 chat tidy-up 2023-08-22 16:59:26 +10:00
bunnie
f3a2cba755 map the I/Os so we can see the UART toggle 2023-08-21 18:52:43 +08:00
nworbnhoj
4f03a27e79 implement chat app_menu 2023-08-15 04:27:15 +10:00
nworbnhoj
b095462f29 implement mtxchat post() 2023-08-15 04:11:13 +10:00
nworbnhoj
3392b30794 fix Chat::Dialogue.post_add() duplication 2023-08-12 06:36:28 +10:00
nworbnhoj
0ef1d79725 refine Chat::Dialogue.post_find() 2023-08-11 06:40:37 +10:00
nworbnhoj
dc8102c627 refine Chat::Dialogue.post_add() 2023-08-11 06:04:02 +10:00
nworbnhoj
ca211e170a implement mtxchat.connect() 2023-08-11 05:24:50 +10:00
nworbnhoj
62a3bae502 extend chat::Dialogue to accept Option<pddb_key>
extend ui.dialogue_set() to select existing Dialogue when operating offline
2023-08-10 20:22:15 +10:00
nworbnhoj
defac5ed7e implement chat.dialogue_modal()
allowing the chat UI to list & select an existing dialogue in the current pddb dict
2023-08-10 20:15:00 +10:00
bunnie
53469a68d0 publish package updates, sync to release tag 2023-08-08 14:35:49 +08:00
nworbnhoj
50f06e2f78 implement mtxchat::MtxChat::listen() 2023-08-07 06:20:15 +10:00
nworbnhoj
9db7a3c2c5 refactor chat timestamp to u64 2023-08-04 09:17:43 +10:00
bunnie
e18869807a add a DMA + PIO test
validates that we can setup a DMA to bitbang an output from a region
of RAM. This will be handy for e.g. driving random displays etc.
2023-08-04 01:31:58 +08:00
bunnie
b127cd093f bump version pins for change to xous-rs 2023-08-03 13:29:39 +08:00
bunnie
289d6bdba6 updates to unit test for mdma block 2023-07-29 01:02:39 +08:00
nworbnhoj
e9f362907d configure Chat_UI to register Chat_App Name with gam 2023-07-27 06:01:39 +10:00
nworbnhoj
34334cb80a rename ChatOp::Rawkeys 2023-07-27 04:39:30 +10:00
nworbnhoj
9451ea90d0 implement chat::dialogue_save() & chat::dialogue_read() 2023-07-24 06:36:12 +10:00
bunnie
51278451a0 update version pins to pull in cramium target 2023-07-19 21:07:56 +08:00
bunnie
bdf785f7c7 add pl230 module
this will hopefully eventually be generic across any platform
that uses the pl230 dma module, which I have seen... on a couple
of platforms at least.
2023-07-17 18:26:46 +08:00
bunnie
b64e8ee9e2 add PIO support to xous
still needs to hammer out the utralib location and so forth,
it's using a legacy format before we had mergeable SVDs, but
one thing at a time...
2023-07-17 18:26:08 +08:00
nworbnhoj
aab92c2b37 sketch chat UI library
A Chat object provides a generic UI to read a series of Posts in a Dialogue stored in the pddb - and to Author a new Post.

The idea is to provide a solid common Xous Chat interface, so that Chat Apps can specialize in the unique aspects of a chat Platform protocol (Matrix, Signal etc).

A Chat App will typically call `Chat::new()` and then `Chat::dialogue_set()` with a pddb dict and key holding a Dialogue of Posts. The Chat object will fire-up the UI and retrieve the Dialogue from the pddb. The user will be able to peruse the stored Posts in the Dialogue - and potentially Author a new Post. A new User Post will be sent to the Chat App in a `MemoryMessage` via the (optional) `CID` and `Opcode` provided by the Chat App. Conversely, when the Chat App receives a new Post from the Platform, it will call Chat::post_add() to have it saved in the pddb.

The Chat UI will also accept (optional) opcodes to forward raw-keystrokes and UI-Events to the Chat App. This allows the Chat App to respond to key UI Events. For example if the User navigates to the `top` of the list of stored Posts, then the Chat App might retrieve older Posts from the Platform to be stored Dialogue with calls to Chat::post_add().
2023-07-12 17:23:41 +10:00
bunnie
ecb42c6a0e Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-07-05 15:19:13 +08:00
bunnie
d19020a9ad cleanup some warnings 2023-07-05 15:13:22 +08:00
bunnie
afc8d96283
Merge pull request #395 from nworbnhoj/tls
Tls tidy-up
2023-07-04 00:57:56 -07:00
nworbnhoj
9f0b607fde tidy-up 2023-07-04 17:19:04 +10:00
nworbnhoj
1ffe49106d tidy-up 2023-07-04 17:11:51 +10:00
nworbnhoj
26f8628c18 delete redundant file 2023-07-04 17:10:27 +10:00
nworbnhoj
0725187cee tls add locale for tls.probe_done 2023-07-04 17:09:44 +10: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
nworbnhoj
4e0298c17a include broken tls::rota::public_key() 2023-07-04 07:36:47 +10:00
nworbnhoj
a5ef4585a8 fix tls::Tls::save_cert() 2023-07-04 07:29:37 +10:00
nworbnhoj
a68ae232b3 rename snapchat net tls trusted to net tls list 2023-07-04 07:17:00 +10:00
nworbnhoj
527ad433ba rename snapchat net tls delete to net tls deleteall 2023-07-04 07:15:35 +10:00
nworbnhoj
5c9905a0be add progress bar to snapchat net tls mozilla 2023-07-04 05:51:59 +10:00
nworbnhoj
044fed1096 tls tidy-up 2023-07-03 19:01:05 +10:00
nworbnhoj
211e27b759 refine handling of tls rota Certificate name_constraints (slightly) 2023-07-03 18:49:56 +10:00
nworbnhoj
ffb573f5dc implement tls::rota::pddb_key 2023-07-03 17:13:01 +10:00
nworbnhoj
a4de987eb8 show fingerprint in Tls::check_trusted() modal 2023-07-03 07:49:07 +10:00
nworbnhoj
2311ef29d5 tls replace std::fs with pddb::Pddb 2023-07-03 06:21:13 +10:00
nworbnhoj
0698d5003e rename pddb dict to tls.trusted 2023-06-30 05:01:40 +10:00
nworbnhoj
1e95167f47 implement shellchat net tls delete 2023-06-29 14:41:25 +10:00
nworbnhoj
53b002ad9c return count of trusted certificates from shellchat net tls probe & shellchat net tls mozilla 2023-06-29 13:10:28 +10:00
nworbnhoj
579f2c36e8 tls implement rota add_der_header() 2023-06-29 12:11:41 +10:00
nworbnhoj
7cef80e193 tls remove der header from captured RustlsOwnedTrustAnchor fields 2023-06-29 11:00:32 +10:00
nworbnhoj
2f042cff70 implement tls locales/i18n.json en en-tts 2023-06-28 13:37:45 +10:00
nworbnhoj
3acc43f2b0 checkin libs/tls/src/cmd.rs 2023-06-28 06:07:46 +10:00
nworbnhoj
b8b591401f reconfigure [features] tls rootCA & websocket 2023-06-28 06:05:44 +10:00
nworbnhoj
0e85ff2aac refactor tls::rota 2023-06-27 19:35:51 +10:00
nworbnhoj
b67c015abc refactor tls::trusted 2023-06-27 14:40:30 +10:00
nworbnhoj
aeeff17a6a relocate shellchat net tls sub-commands to libs/tls/src/cmd.rs 2023-06-27 14:38:11 +10:00
nworbnhoj
d6fe702278 improve tls error handling 2023-06-26 19:32:57 +10:00
nworbnhoj
be9f0fd29a implement tls RustlsOwnedTrustAnchor::subject() 2023-06-26 12:35:20 +10:00
nworbnhoj
4d1411432f mirror RustlsOwnedTrustAnchor::from_subject_spki_name_constraints() 2023-06-26 11:11:45 +10:00
nworbnhoj
a741e7988b tidy-up tls cargo & use 2023-06-26 08:15:09 +10:00
nworbnhoj
21961ad756 implement Into<RootCertStore> for Trusted 2023-06-25 16:32:20 +10:00
nworbnhoj
70b41cbf78 implement Into<rustls::OwnedTrustAnchor> for RustlsOwnedTrustAnchor 2023-06-25 16:26:06 +10:00
nworbnhoj
4ea0c8457d implement tls::danger::StifledCertificateVerification
StifledCertificateVerification::verify_server_cert() will verify the certificate with the default rustls WebPkiVerifier, BUT specifically override a `CertificateError::UnknownIssuer` and return ServerCertVerified::assertion()

This allows us to use rustls to open a tls connection to a host with an untrusted certificate chain. And subsequently get to see the certificate chain, and possibly choose to trust the chain, or links in it.
2023-06-25 12:31:23 +10:00
nworbnhoj
fcc4cde41b add CA icon to tls check_trust modal 2023-06-25 11:36:22 +10:00
nworbnhoj
472e4407b8 display tls certificate subject & serial in check_trust modal 2023-06-24 15:02:48 +10:00
nworbnhoj
0d1e89e560 implement tls Trusted iterator 2023-06-24 14:59:47 +10:00
nworbnhoj
65f92453a2 implement tls RustlsOwnedTrustAnchor to rustls::OwnedTrustAnchor 2023-06-24 14:57:16 +10:00
nworbnhoj
8d12e3d8d3 implement tls check_trust
presents a modal to the user to select trusted tls certificates and saves the selected certificates to the pddb
2023-06-20 20:42:26 +10:00
nworbnhoj
2944e34ea6 implement save/get rustls::OwnedTrustAnchor to PDDB 2023-06-20 20:38:12 +10:00
bunnie
952ba18fba commit vesrion pin bumps 2023-06-16 01:30:18 +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
18f2017bf9 add autoumount, autosleep options to userprefs 2023-05-22 02:31:28 +08:00
bunnie
697d44de3d bump version pins to absorb changes to svd2utra etc. 2023-05-03 23:11:12 +08:00
bunnie
8a574f937f bump for xous-rs version pin update 2023-04-27 22:18:30 +08: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
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
e469eba167 bump version for utralib patch 2023-04-04 02:13:02 +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
82e3aa322f bump toml files in prep for publish 2023-03-08 03:54:37 +08:00
bunnie
9256e7cc09 bump versions to absorb xous-names fix 2023-01-31 15:07:32 +08:00
bunnie
84368c3f3a bump versions for publication 2023-01-31 02:18:12 +08:00
bunnie
232a4b6c6c bump xous version 2023-01-18 00:02:46 +08:00
bunnie
f66e53c54a respond to StartStop command with Done immediately
nothing to sync up on eject, since it's all already in RAM.
2023-01-15 02:39:03 +08:00
bunnie
7021116a37 remove debug print 2023-01-14 19:07:56 +08:00
Gianguido Sorà
96582fdf2a
mass-storage: just use two bulk endpoints
For some unknown reason, just adding a second bulk endpoint descriptor makes enumeration
fail on essentially all operating systems.

Adding three endpoints is no issue though, but since we want to avoid wasting resources around
here, writing 0x42 at the end of the last bulk endpoint... fixes everything.

Tested under Linux, Windows, OpenBSD, FreeBSD.
2023-01-13 18:15:05 +01:00
bunnie
c631963a4b Merge branch 'feat/usb-mass-storage' of github.com:gsora/xous-core into gsora-feat/usb-mass-storage 2023-01-13 02:59:17 +08:00
bunnie
55b1addf59 add vendoring notice and original copyright to all files vendored in. 2023-01-12 02:10:41 +08:00
bunnie
1a00e3cc2f fix whitespace 2023-01-12 02:06:27 +08:00
bunnie
8aa1301d68 more cleanup 2023-01-12 01:51:50 +08:00
bunnie
bebf323798 some touch-up/cleanup; add a timeout on a blocking read 2023-01-12 01:45:51 +08:00
bunnie
1ec6bd7df4 remove some test files that aren't relevant to our build 2023-01-12 01:17:04 +08:00
bunnie
cd62caadcd fix paths and README 2023-01-12 01:13:21 +08:00
bunnie
ed23cdcc17 move crates to the libs/mass-storage directory 2023-01-12 01:12:56 +08:00
bunnie
88cdde4b9a remove unused files 2023-01-12 01:04:12 +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
Gianguido Sorà
46ca14e2f9
Squashed commit of the following:
commit a09100ab4a
Author: bunnie <bunnie@kosagi.com>
Date:   Fri Dec 30 15:55:55 2022 +0800

    bump lockfile

commit 53172e1471
Author: bunnie <bunnie@kosagi.com>
Date:   Fri Dec 30 15:46:40 2022 +0800

    bump verification pins

commit 36398810dd
Author: bunnie <bunnie@kosagi.com>
Date:   Fri Dec 30 15:24:36 2022 +0800

    bump version numbers to absorb new syscalls

commit 062fa6178a
Merge: ac4a854e 3bcc955a
Author: bunnie <bunnie@kosagi.com>
Date:   Fri Dec 30 15:23:31 2022 +0800

    Merge branch 'reply-and-receive-next-syscall' into main

commit ac4a854e49
Merge: d1375343 e4c298db
Author: bunnie <bunnie@kosagi.com>
Date:   Fri Dec 30 15:22:25 2022 +0800

    Merge branch 'main' of github.com:betrusted-io/xous-core into main

commit 3bcc955aba
Author: bunnie <bunnie@kosagi.com>
Date:   Fri Dec 30 15:21:43 2022 +0800

    add test code that also benchmarks the new routines.

commit e4c298db40
Merge: f71278b4 e2bf7109
Author: bunnie <bunnie@kosagi.com>
Date:   Fri Dec 30 15:16:13 2022 +0800

    Merge pull request #289 from betrusted-io/reply-and-receive-next-syscall

    Reply and receive next syscall

commit e2bf710939
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:06:51 2022 +0800

    services: xous-ticktimer: use reply_and_receive_next()

    Convert the ticktimer server to use the new
    reply_and_receive_next_legacy() call. This is an example of how to use
    this API for future projects.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit 0e75b8e479
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:05:26 2022 +0800

    test-spawn: rename `Message` to `MessageEnvelope`

    Signed-off-by: Sean Cross <sean@xobs.io>

commit 3218bde2b4
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:04:01 2022 +0800

    kernel: implement reply_and_receive_next

    Implement `ReplyAndReceiveNext` as a syscall. This will reply to a
    message, pull the next message out of the queue, and then re-queue the
    server to run. This should make servers much more responsive.

    This patch has been tested on both hosted and native modes.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit d1375343c1
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 29 23:34:48 2022 +0800

    update release notes

commit f71278b422
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 29 22:04:55 2022 +0800

    fix issue #109 - refactor key fill/scan to not crash after pruning

    After a prune, key fill/scan can crash because there is an assumption
    that data is always resident in the cache for a small key.

    This code handles the case where the small key data was evicted during
    a prune, and reads the data back in just for that key on demand.

    Furthermore, during a `sync` call, it will pull in the key data
    that corresponds to the page containing just the small key, allowing
    that page to be re-composed and replaced in memory. caching is used
    on the decryption of the small key page so the expensive bit
    of the call should only happen once per small key bank.

    tested with pddb-ci and manually in hosted mode.

    A portion of code was re-written to make it clear that only the
    length of allocated data is copied to/from disk and memory, instead
    of the reserved space as the previous code would indicate. The reserved
    space is guaranteed to be zero because the RAM-based page for composing
    the small key block is zero-ized prior to operations; left comments
    reminding me of this in the future so I don't accidentally optimize
    something out and cause data leakage between small keys because I'm
    allowing the reserved areas to contain stale data.

commit e25da3a720
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 29 22:04:15 2022 +0800

    add implemenation of the `prune` debug call

    this allows us to trigger the cache prune manually, instead of
    in response to memory backpressure only

commit 549e67fead
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 29 22:03:19 2022 +0800

    add a `prune` debug call to force a hard-prune of the pddb cache

commit e045574d39
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:06:51 2022 +0800

    services: xous-ticktimer: use reply_and_receive_next()

    Convert the ticktimer server to use the new
    reply_and_receive_next_legacy() call. This is an example of how to use
    this API for future projects.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit 23c17d7632
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:05:26 2022 +0800

    test-spawn: rename `Message` to `MessageEnvelope`

    Signed-off-by: Sean Cross <sean@xobs.io>

commit aae5f3737c
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:04:01 2022 +0800

    kernel: implement reply_and_receive_next

    Implement `ReplyAndReceiveNext` as a syscall. This will reply to a
    message, pull the next message out of the queue, and then re-queue the
    server to run. This should make servers much more responsive.

    This patch has been tested on both hosted and native modes.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit ab0c7d3b32
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:03:39 2022 +0800

    kernel: server: check buf is some when returning mem

    Signed-off-by: Sean Cross <sean@xobs.io>

commit 46f340324d
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:02:57 2022 +0800

    kernel: rename `Message` -> `MessageEnvelope`

    This syncs with the latest changes to `xous-rs`.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit 911ddb60fc
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:01:27 2022 +0800

    kernel: debug: fix klog on baremetal

    klog() refers to an outdated `.uart` struct, which has since been
    renamed to `.serial`.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit d88254b1b1
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:00:35 2022 +0800

    xous: add reply_and_receive_next_legacy call

    This call is used to return values while simultaneously listening for
    new messages.

    The -legacy suffix is used to disambiguate scalar values, so we know
    whether to send Scalar1, Scalar2, or Scalar5 messages.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit 64c88f9942
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 21:00:05 2022 +0800

    xous: add Message type

    This type actually contains the message contents, and will be used to
    return data to the caller.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit d463f9563f
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 29 20:58:51 2022 +0800

    xous: rename Message to MessageEnvelope

    This reflects the fact that up until now, the `Message` struct has
    merely been the envelope that surrounds the message. It does not contain
    any actual Message contents.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit 49ce85f9a8
Author: Sean Cross <sean@xobs.io>
Date:   Wed Jul 6 15:57:10 2022 +0800

    ticktimer-server: prepare for using ReplyAndReceiveNext

    Misc cleanup prior to switching which call we use.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit be56af6303
Author: Sean Cross <sean@xobs.io>
Date:   Wed Jul 6 15:35:22 2022 +0800

    xous: add wrapper for reply_and_receive_next

    This wrapper enables userspace programs to use the new
    ReplyAndReceiveNext syscall easily.

    Signed-off-by: Sean Cross <sean@xobs.io>

commit 36e6e6c30b
Author: Sean Cross <sean@xobs.io>
Date:   Wed Jul 6 15:18:32 2022 +0800

    xous: syscall: add ReplyAndReceiveNext call

    Signed-off-by: Sean Cross <sean@xobs.io>

commit 1e56598b10
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 29 00:53:32 2022 +0800

    chore: fix some typos

commit 1291b0f00b
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 29 00:38:27 2022 +0800

    add issue # to release note

commit 7206f24271
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 29 00:37:47 2022 +0800

    update release notes

commit 2f30e1b50a
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 29 00:11:03 2022 +0800

    implement #269

commit 5370c333da
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 29 00:10:42 2022 +0800

    add callback for monitoring basis lock/unlock events

commit 8d42feb051
Author: bunnie <bunnie@kosagi.com>
Date:   Wed Dec 28 19:48:40 2022 +0800

    increase heap for mtxcli; add memory usage reporting

commit ac1df054ab
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 26 13:52:44 2022 +0800

    absorb 22-bit satp fix

commit 89500015a7
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 15 17:52:55 2022 +0800

    try to fix regression from #284

    still hitting cache coherence edge cases. expanding the flush
    set read by one more way.

commit 41ea0a37c5
Merge: e422740d b288d93a
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 15 14:36:40 2022 +0800

    Merge branch 'main' of github.com:betrusted-io/xous-core into main

commit b288d93abd
Merge: 8e1d0502 d4527b82
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 15 14:00:10 2022 +0800

    Merge pull request #284 from betrusted-io/use-thin-lto

    cargo: use thin-lto

commit d4527b8227
Author: Sean Cross <sean@xobs.io>
Date:   Thu Dec 15 12:26:00 2022 +0800

    cargo: use thin-lto

    Use thin LTO for linking. This shouldn't have too big of an affect on
    the resulting binary size, and it fixes the build for 1.66.0:

    = note: rust-lld: error: undefined symbol:
    core::panicking::panic_str_nounwind::h9b449c0fe03c8dac
    >>> referenced by compiler_builtins.22a3dcb1-cgu.13
    >>> compiler_builtins-b913bacb8fda1c55.compiler_builtins.22a3dcb1-cgu.13.rcgu.o:(compiler_builtins::math::libm::rem_pio2_large::rem_pio2_large::h3db6431f23a281c1)
    in archive root\lib\rustlib\riscv32imac-unknown-xous-elf\lib\libcompiler_builtins-b913bacb8fda1c55.rlib
    >>> referenced by compiler_builtins.22a3dcb1-cgu.13
    >>> compiler_builtins-b913bacb8fda1c55.compiler_builtins.22a3dcb1-cgu.13.rcgu.o:(compiler_builtins::math::libm::rem_pio2_large::rem_pio2_large::h3db6431f23a281c1)
    in archive root\lib\rustlib\riscv32imac-unknown-xous-elf\lib\libcompiler_builtins-b913bacb8fda1c55.rlib

    Signed-off-by: Sean Cross <sean@xobs.io>

commit e422740d37
Author: bunnie <bunnie@kosagi.com>
Date:   Tue Dec 13 23:03:50 2022 +0800

    chore: last one. really.

commit ad79ebf8ba
Author: bunnie <bunnie@kosagi.com>
Date:   Tue Dec 13 23:02:09 2022 +0800

    chore: more typos. no really, i can stop at any time.

commit b1b6d46d27
Author: bunnie <bunnie@kosagi.com>
Date:   Tue Dec 13 22:56:37 2022 +0800

    chore: more typos

    probably should not have tried to spell check this, now i'm wasting
    my time.

commit 283ea1de0d
Author: bunnie <bunnie@kosagi.com>
Date:   Tue Dec 13 22:49:25 2022 +0800

    chore: fix more typos, add french dictionary to vscode workspace settings

commit 1d94968b2f
Author: bunnie <bunnie@kosagi.com>
Date:   Tue Dec 13 22:36:47 2022 +0800

    chore: fix typos

commit e930d88563
Author: bunnie <bunnie@kosagi.com>
Date:   Tue Dec 13 01:42:00 2022 +0800

    placeholder for 0.9.12 release notes

commit 8e1d05020d
Author: bunnie <bunnie@kosagi.com>
Date:   Tue Dec 13 00:32:11 2022 +0800

    add v0.9.11 to the restore.py URL list

commit bd230f5bb0
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 16:51:27 2022 +0800

    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.

commit 38bc254bb9
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 16:28:33 2022 +0800

    fix missing ja/zh translation

commit 60d4482ce2
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 16:16:04 2022 +0800

    bump lockfile

commit 56f0843229
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 16:08:28 2022 +0800

    bump verifier numbers

commit 5370ce396d
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 16:07:20 2022 +0800

    bump all revs due to SoC artifact update

commit cac0e57cda
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 16:06:31 2022 +0800

    change default target

commit 04b441a234
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 16:06:19 2022 +0800

    add 0.9.11 build artifact

commit 08cf863ff5
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 16:05:15 2022 +0800

    update SoC artifacts for 0.9.11 build

commit c32b5d5bac
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 15:31:15 2022 +0800

    bump release notes

commit 80ce119c95
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 15:31:06 2022 +0800

    fix RSSI calculations

commit edf24d9fc2
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 14:11:19 2022 +0800

    clean up on the wifi signal bars

commit eb17edc4ec
Merge: 9a580070 435a6ea2
Author: bunnie <bunnie@kosagi.com>
Date:   Mon Dec 12 11:47:18 2022 +0800

    Merge pull request #283 from gsora/feat/wifi-signal-bars

    feat: wifi signal bar

commit 9a580070a3
Author: bunnie <bunnie@kosagi.com>
Date:   Sun Dec 11 17:50:51 2022 +0800

    revert threaded init question now that deface issue is fixed

commit f9cdf31857
Author: bunnie <bunnie@kosagi.com>
Date:   Sun Dec 11 17:07:29 2022 +0800

    bump release notes

commit 196ceb0d29
Author: bunnie <bunnie@kosagi.com>
Date:   Sun Dec 11 16:42:03 2022 +0800

    fix: avoid thrashing when recomputing previously defaced canvases

    There was a dubious line that I never felt good about and today
    I found out why. By flipping every canvas to drawable before doing
    the intersection computation we also throw away the defacement state,
    so previously defaced canvases would lose their status bit, causing
    thrashing of the canvases anytime there is a re-computation of
    the canvas ordering.

    This fix caches if a canvas was already defaced, and if it turns out
    that an on-screen canvas should not be drawable but was already
    defaced, the setting is re-applied, preventing thrashing.

commit dca043d387
Author: bunnie <bunnie@kosagi.com>
Date:   Sun Dec 11 16:41:53 2022 +0800

    improve context swap debug messages

commit 8d8dd2bd2f
Author: bunnie <bunnie@kosagi.com>
Date:   Sun Dec 11 16:41:25 2022 +0800

    fix typo in unwrap message

commit f31afa5125
Author: bunnie <bunnie@kosagi.com>
Date:   Sun Dec 11 16:41:06 2022 +0800

    remove unused opcode in shellchat; improve debug output

commit 6138b65d76
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 23:44:18 2022 +0800

    update comments to reflect changes in CI infra

commit 399124f942
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 22:05:47 2022 +0800

    fix hosted mode

commit 939e13950d
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 18:59:55 2022 +0800

    comment out debug in rootkeys implementation section

commit 2097afc166
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 18:58:06 2022 +0800

    add efuse burning flow to rootkeys

    currently only available for builds that have the `efuse` feature
    enabled

commit 19e16aea29
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 18:56:59 2022 +0800

    fix jtag fuse burning & add diagnostic messages

    - msb/lsb swap on efuse bank fixed
    - hazardous-debug feauter gates added
    - dry-run for "testing only" added

commit 4ec866e1d7
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 18:56:12 2022 +0800

    add diagnostic seal command

commit f5c687a524
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 17:45:30 2022 +0800

    clarify user prompt

commit 2b4e47384e
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 17:44:54 2022 +0800

    add fused device support and warnings to precursorupdater

commit e42c4c7b33
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 16:39:14 2022 +0800

    add warnings & support for fused devices

    burning a generic image to a fused device will surely lead to
    a brick, so, try to keep a user from shooting themselves in the foot.

commit c2f7a63f97
Author: bunnie <bunnie@kosagi.com>
Date:   Sat Dec 10 16:39:01 2022 +0800

    remove some whitespace to allow for easier debugging

commit 1f89843122
Author: bunnie <bunnie@kosagi.com>
Date:   Fri Dec 9 12:38:53 2022 +0800

    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.

commit 02f9701546
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 8 17:42:12 2022 +0800

    make an explicit dvt feature to simplify flags

commit 4dd983bfc4
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 8 17:19:05 2022 +0800

    adjust security parameters for dvt build

commit fc08c3e29d
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 8 17:14:47 2022 +0800

    add hazardous-debug to modals bip-39

    for convenient key printout during debug. flag is normally off.

commit dd82b7f32a
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 8 17:14:21 2022 +0800

    add no-codec mode to status

    this is for DVT builds where the codec isn't supported, needed
    for efuse testing

commit a5d341c7a6
Author: bunnie <bunnie@kosagi.com>
Date:   Thu Dec 8 14:09:36 2022 +0800

    add a bitstream encryption/recovery tool for fused devices

    This is useful for recovering bricked devices where the backup
    key is available. This tool can be used to generate an FPGA
    image for a device that has been permanently fused to a non-0
    backup key.

commit 4f270f54be
Author: bunnie <bunnie@kosagi.com>
Date:   Wed Dec 7 22:24:56 2022 +0800

    revert debugging on status opcodes

commit 435a6ea2bd
Author: Gianguido Sorà <me@gsora.xyz>
Date:   Wed Dec 7 14:28:07 2022 +0100

    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.

commit f84a9d10c7
Author: bunnie <bunnie@kosagi.com>
Date:   Sun Dec 4 18:13:37 2022 +0800

    add placeholder for the efuse flow in the rootkey service

commit 8208a86c08
Author: bunnie <bunnie@kosagi.com>
Date:   Sun Dec 4 18:12:30 2022 +0800

    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)

commit 3838f3bc15
Author: bunnie <bunnie@kosagi.com>
Date:   Sun Dec 4 18:12:05 2022 +0800

    add a pause for context swaps on menu release

commit 53c9af1033
Author: bunnie <bunnie@kosagi.com>
Date:   Fri Dec 2 23:00:38 2022 +0800

    bump readme's
2023-01-02 15:51:45 +01:00
bunnie
597e24cd99 add a table-based implementation of cosine
this is a space-optimized implementation of cosine. it's about
12k smaller than core lib's "proper" cosine.

Gives about 9 bits amplitude resolution, and divides the waveform
into 1024 time positions. Good enough for generating tones on
a crappy speaker.

Later on if anyone needs to "really" do cosine or sine, we'll have
a footgun for them, but...let's hope Rust fixes issue
https://github.com/rust-lang/rust/issues/105734 before then, and
we can deprecate this library in favor of the mathematically
accurate and canonical cosine implementation.
2023-01-02 17:47:48 +08:00
bunnie
36398810dd bump version numbers to absorb new syscalls 2022-12-30 15:24:36 +08:00
bunnie
5370ce396d bump all revs due to SoC artifact update 2022-12-12 16:07:20 +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
4fdbec310c modify wifi on boot to wifi kill switch 2022-11-23 06:00:59 +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
26adda2fa7 CHORE: clean whitespace 2022-11-23 02:18:02 +08:00
Gianguido Sorà
b91457afa8 feat(userprefs): add audio-related toggles 2022-11-17 18:04:11 +01:00
Gianguido Sorà
dd5928a7c3 feat: move timezone and utc offset into Preference lib 2022-11-14 16:15:57 +01:00
Gianguido Sorà
85b55798cf chore: use pddb crate-level system basis name 2022-11-03 12:39:32 +01:00
Gianguido Sorà
58707b5ebf feat: support keyboard layout setting in userprefs 2022-11-02 17:21:33 +01:00
Gianguido Sorà
34cbd4218e feat: create the all() method for prefs
Returns an instance of `UserPrefs` with all the preferences filled in.
2022-10-27 14:55:22 +02:00
Gianguido Sorà
c05bfce3f8 chore: clean up userprefs readme a little 2022-10-27 14:53:32 +02:00
Gianguido Sorà
4aface7eb5 feat: generate a pref getter that returns the type's default value on
error

PDDB errors might still be there.
2022-10-20 12:30:40 +02:00
Gianguido Sorà
75e3ed603d prefsgenerator: don't generate mutable methods
no need to!
2022-10-18 11:54:18 +02:00
Gianguido Sorà
bc2cdd739b userprefs: allow dead code on UserPrefs struct
Remove lock-related variables, not needed anymore, also added autobacklight timeout
2022-10-18 11:52:48 +02:00
Gianguido Sorà
a0b74ef2d0 userprefs: publish Manager::new() method 2022-10-13 17:59:12 +02:00
Gianguido Sorà
82c31e760b document how to add user preferences, general cleanup 2022-10-10 15:52:25 +02:00
Gianguido Sorà
db9372d5d0 make the thing compile 2022-10-10 15:36:36 +02:00
Gianguido Sorà
8c9cdc4ec5 WIP user prefs 2022-10-10 13:36:34 +02:00