Commit graph

266 commits

Author SHA1 Message Date
bunnie
dd943c5416 pin down versions and harmonize versions across servers
Versions are pinned down to the minor number. Yes, this means that
we don't automatically pull in features and bug updates from crates.io,
but it also means we don't pull in new attack surfaces and code that
hasn't been tested or reviewed. I'd like this process to be very deliberate
and not automatic for Xous.

The `rand` crate is almost pinned down to a single version, except
for an odd dependency that's pulled in by hosted mode that depends
on rand 0.8.4 via a subordinate dependency via the `tempfile` crate.
Pondering if it's worth it to try and eliminate that, because the
0.8.4 version doesn't get compiled into any version that touches
real hardware. It just makes it harder to analyze the Cargo.lock
file, mostly. I think I'll leave it as-is.
2022-01-10 15:39:55 +08:00
bunnie
b275b1d3c2 move some low-level hardware facing services to "Late" suspend status
So far it's been no problem to suspend these in any order, but as
more services come to rely upon them it's better if they suspend after
any client applications have been suspended.
2022-01-10 13:48:49 +08:00
bunnie
c5fe1bc99b add sequencing to suspend/resume order of operations
this is necessary because we want to make sure that the SPINOR
service does not shut down before the PDDB service finishes syncing
its disks.
2022-01-10 13:45:56 +08:00
bunnie
dd18d94a03 e2e demo of pddb working now, we can store an ssid/password pair...finally. 2022-01-09 13:12:36 +08:00
bunnie
7aa2c7b054 a very basic e2e pddb application that tries to restore a network connection
lots of problems to solve still, but let's pick that up on the refactor
stage -- for now we want to get some evidence that the pddb API is
workable.
2022-01-09 01:29:28 +08:00
bunnie
489a26dd11 fix an issue where we don't decrement the connection counter on drop 2022-01-05 20:01:54 +08:00
bunnie
f53c57ba3f fix up a number of issues in ping
Now that I understand how smoltcp does ping better I have regrets.
The demo example in smoltcp uses a funky macro that was a bit
misleading. I have gotten rid of that but I probably would have made
different decisions in implementing this had I understood the API better.

Anyways. It works, but has some trouble handling the cases of timeouts
sometimes.
2021-10-22 04:08:43 +08:00
bunnie
e6643e725d implement UDP rx 2021-10-18 04:02:55 +08:00
bunnie
3cf1cbaeb6 add visible warnings around COM timeouts 2021-10-17 21:43:39 +08:00
bunnie
f1296d0dfd convert route table to use heap not static memory, since we have heap 2021-10-15 15:44:16 +08:00
bunnie
ef70daf7bb fix hosted mode build config 2021-10-13 02:07:55 +08:00
bunnie
ec34b01bd9 pings working with smoltcp (can originate and respond) 2021-10-13 01:57:00 +08:00
bunnie
b93109cad2 cleaning up net event loop, still figuring out APIs and integration
currently there is some issue with ARPs not sure where it's breaking,
suspect issue on EC side...
2021-10-11 05:21:01 +08:00
bunnie
26069c023a intermediate commit trying to trace down how this receive process works. 2021-10-10 21:12:09 +08:00
bunnie
74a3c6df44 disastrous first draft of figuring out how to integrate smoltcp using a ping example. 2021-10-10 01:57:31 +08:00
bunnie
560c6e4197 something packet-oid is coming out of the serial port now? 2021-10-09 02:12:12 +08:00
bunnie
b43eb56346 add some skeleton for a net crate; testing COM interrupts 2021-10-08 20:01:13 +08:00
bunnie
dfc6444d78 add killkey test to the self test suite 2021-09-14 20:15:03 +08:00
bunnie
3f1ba5e279 add com trng seed, uptime on EC; EC reset test commands 2021-09-13 23:28:54 +08:00
bunnie
1a55973346 adjustments to self test routines 2021-09-06 14:39:44 +08:00
bunnie
858a1ed019 beginnings of a factory self-test routine; expand COM functionality 2021-09-05 23:26:07 +08:00
Sam Blenny
af25697a6f Merge remote-tracking branch 'upstream/main' into com-wlan 2021-08-13 23:01:12 +00:00
Sam Blenny
53a0bf2827 Use com_rs::serdes::StringDes for wlan status
Switch to using the new com_rs::serdes::StringDes struct for
deserializing the COM protocol response to WLAN_STATUS.

With this change, `wlan status` will receive a string of up to 64
bytes and print it to the shellchat log. Status string formatting
is handled by the betrusted-ec EC firmware code.

Signed-off-by: samblenny
2021-08-06 08:30:16 +00:00
bunnie
8b83fb7c65 remove heapless, go to libstd for all collections!!!!
*fistpump*
2021-08-04 01:25:32 +08:00
bunnie
34d44ee9e7 start to remove heapless and commit to libstd flow 2021-08-04 00:07:47 +08:00
Sam Blenny
ba4ca72703 Use com_rs::serdes::StringSer for wlan ssid & pass
Switch to using the new com_rs::serdes::StringSer struct for
serializing the COM protocol arguments to WLAN_SET_SSID and
WLAN_SET_PASS. The point is to reduce the amount of ad hoc,
untested packing and unpacking.

Signed-off-by: samblenny
2021-08-03 14:04:20 +00:00
Sean Cross
b86e0a65cd services: recognize xous as a hardware OS
Support `xous` as a valid OS. This allows us to build the entire kernel
under this target.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-02 18:11:48 +08:00
Sam Blenny
a614ccffb7 Fix wlan_leave() to send correct verb
wlan_leave() was mistakenly sending the verb for WLAN_JOIN.

Signed-off-by: samblenny
2021-07-24 02:51:32 +00:00
Sam Blenny
5c93365acd implement COM bus txrx for wlan commands
Signed-off-by: samblenny
2021-07-21 09:06:12 +00:00
Sam Blenny
803f6d496f fix passphrase length limit to match WF200 API
Signed-off-by: samblenny
2021-07-21 09:06:12 +00:00
Sam Blenny
03ad8bd2e4 add support for wlan commands to com server
Signed-off-by: samblenny
2021-07-21 09:06:12 +00:00
bunnie
69a22adee9 menus basically working 2021-06-19 00:25:18 +08:00
bunnie
eee9f4e765 refactor xous-names to permit only a fixed number of connections
this prevents less trusted processes from connecting to servers
after the kernel initializations are done.

this works so long as we don't have disconnects from the kernel
servers. In order to support disconnects we will also need a
way to re-enumerate the SID to guarantee that we don't have a re-use
problem. But for now, the kernel is not designed with any practical
disconnect mechanism; there is no code that calls the Quit mechanism
on any server.
2021-06-15 17:41:14 +08:00
bunnie
fadc9c29ab Merge remote-tracking branch 'origin/master' into bunnie-dev 2021-06-02 03:59:25 +08:00
bunnie
25a77ddb19 EC updating seems to work. 2021-05-25 05:13:20 +08:00
bunnie
7529628053 partial progress on EC updater 2021-05-24 04:34:50 +08:00
bunnie
30aa794f30 add reference counting on connections between servers
the connection number is re-used for all objects created
within a process space, so you can't `Drop` the connection
immediately when an object goes out of scope. You have to
make sure all instance of the object go out of scope. This
patch adds reference counting to all the objects so that
the `Drop` function works as intended.
2021-05-21 16:24:30 +08:00
Sean Cross
eb7895d601 xous: add a return code to TerminateProcess
As part of this refactor, make `terminate_process()` a divergent call.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-20 11:01:00 +08:00
bunnie
7d9e84c456 initial frameworks around sha512 acceleration integration 2021-05-19 00:39:03 +08:00
bunnie
3f12b0a69b add a gyro test command to shellchat 2021-05-16 16:52:27 +08:00
bunnie
5d4e716e1b add status thread mechanism to check charger state 2021-05-16 16:30:58 +08:00
bunnie
87b6d9b6d7 add backlight commands 2021-05-16 04:29:12 +08:00
bunnie
08a86749fe fix hosted mode bugs 2021-05-09 01:13:16 +08:00
bunnie
391122823d refactor heapless version in attempt to debug issue that cropped up in xous-names
somehow, updating the toolchain has broken the FnvIndexMap implementation
2021-05-08 18:44:23 +08:00
bunnie
2d3a643d20 retrofit COM for suspend/resume 2021-04-29 23:53:35 +08:00
bunnie
061284ec5f debugging BOOST mode glitch issue
Here's an arcane bug for you:

When powering down, the Spartan 7 3.3V I/O drivers will
output a roughly 800us wide glitch as 3.3V falls below around
1.7V, if the 0.95V core voltage comes down first (which it does
because we have an active discharge on 0.95V, but not on 3.3V).

In this case, it's just wide and high enough to cause the
BOOST mode line to engage, which takes the BOOST output
and ties it to VBUS, which is just enough for the system to
think you're powering it back on again. Which is not what
you want when powering down.

The ultimate fix was to put a heftier pull-down on the BOOST
line so that it can't trip the BOOST output into the VBUS.
Another option could be more active discharge FETs, but that
would require a full board spin and we are already at certification,
so we'll stick with the stronger pull-down on BOOST. It seems to
be a robust fix in the worst corner cases we can find.

The downside is that when powering an external USB device,
you are burning an extra 30mW of power overcoming the pull-down,
but typically, any external USB devices plugged into Precursor
will burn far in excess of that, so the delta should be negligible.
2021-04-23 15:33:14 +08:00
bunnie
f97b61a788 add the killbounce command 2021-04-23 01:49:03 +08:00
bunnie
ca63091f98 add ship mode command 2021-04-22 18:07:27 +08:00
bunnie
53f3ca20f0 add SSID scanning 2021-04-16 23:58:30 +08:00
bunnie
b2c0608b0b initial cut at SSID scanning 2021-04-16 23:07:31 +08:00
bunnie
22d676cc59 add reporting of sleep current 2021-04-16 19:58:05 +08:00
bunnie
93400df67c an initial cut at fcc test commands 2021-04-15 04:10:47 +08:00
bunnie
9f4dc8a7b1 add wifi reset opcodes 2021-04-14 22:43:23 +08:00
bunnie
84853c696a drop message should be non-blocking 2021-04-09 18:53:41 +08:00
bunnie
2916eb3775 relocate the destroy callback call to after the server exits 2021-04-09 18:51:43 +08:00
bunnie
35353f38dd bring benchmarks to v0.8 and record benchmark results 2021-04-07 00:45:11 +08:00
bunnie
9ba2fb134c refactor most major modules, but Xous now crashes 2021-04-05 23:50:00 +08:00
bunnie
8786b6db7b should be borrowing the name server object to make connections 2021-04-04 02:15:29 +08:00
bunnie
dea8cb8388 fix typos and start on the graphics server 2021-04-02 22:57:02 +08:00
bunnie
c972666f41 implement Drop on Com object 2021-04-02 19:01:11 +08:00
bunnie
39153f6fba cleanup warnings 2021-04-02 18:07:39 +08:00
bunnie
906f8779a8 cleanup details 2021-04-02 17:57:33 +08:00
bunnie
d6fd42b593 COM refactor of callbacks 2021-04-02 16:40:17 +08:00
bunnie
da255cc1ab use macro expansion for argument extraction of scalars 2021-04-02 15:38:38 +08:00
bunnie
e3733fa64c refactor callback methodology to match 0.8 conventions 2021-04-02 15:38:15 +08:00
bunnie
d21c0fa3e7 refactor of COM
this was much harder than I liked.
2021-04-02 05:43:47 +08:00
bunnie
470b5c6440 finalize API refactor for xous-names 2021-03-30 02:13:23 +08:00
bunnie
f35d478cf0 attempt to refactor xous_names 2021-03-29 04:35:11 +08:00
bunnie
e889765caf refactor the Ticktimer API. 2021-03-28 18:14:41 +08:00
Sean Cross
fdce58d06e ipc: convert project to use xous-ipc
This rewrites the entire project so that most runnable projects now use
`xous-ipc` instead of `xous::String` where possible.

This also removes `rkyv` from the list of dependencies in `xous-rs`.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 20:22:33 +08:00
bunnie
d68e3e8cf4 an attempt to refactor to rkyv 0.4.1
unfortunately, it looks like deserialize requires an alloc??
2021-03-16 02:02:53 +08:00
bunnie
e62256b3df clean up hosted mode warnings 2021-03-03 22:50:46 +08:00
bunnie
463e2ad77d fixup GAM APIs to latest rkyv standard, fix drawable computation 2021-02-26 03:37:48 +08:00
bunnie
5b80b3fb42 get fcc-agent working again 2021-02-23 04:01:01 +08:00
bunnie
0af72ffb6d clean up Sendable references and warnings 2021-02-17 23:29:20 +08:00
Sean Cross
14f661f565 xous: remove id field from lend()
This argument is no longer used.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 20:54:08 +08:00
Sean Cross
5979556a2c services: com: fix warnings in lib
Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 20:51:23 +08:00
Sean Cross
c4fb83b22f services: com: remove unused imports from main
Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 20:50:12 +08:00
Sean Cross
c820573450 services: com: remove unused imports from api
Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 20:47:07 +08:00
bunnie
07b3dd9afa add PID printout to every service as it starts 2021-02-15 19:16:21 +08:00
bunnie
fc8290cdb4 futzing around and something is kind of working on xous-string port to rkyv 2021-02-15 00:05:42 +08:00
bunnie
ed5cdabe40 port COM name registration to use rkyv instead of Sendable 2021-02-13 17:52:50 +08:00
bunnie
7e0902344c move XousBuffer to xous-rs 2021-02-13 01:42:31 +08:00
Sean Cross
704c0f47bf com: don't use internal xous_names register api
This API is now private.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-10 15:03:35 +08:00
bunnie
cc6992c3df implement "imports" methodology
This commit simplifies managing git-repo hosted dependencies, so
there is a single location for changing the package path.
2021-01-20 16:22:38 +08:00
bunnie
73286828c8 more GAM API fleshing out; now to the point of updating a TextView 2021-01-18 04:12:40 +08:00
bunnie
cc66c3911a starting to lay out initial framework for the graphical abstraction manager (GAM) 2021-01-17 04:02:08 +08:00
bunnie
2eafe825b8 refactor COM to use generic name registrations for event listeners 2021-01-12 18:44:02 +08:00
bunnie
426c747f8f keyboard server basics seem working 2021-01-12 04:13:15 +08:00
bunnie
aeadbfb1b5 fix up keyboard API to use scalars, add demo connection
also fix a bunch of other idiomatic weirdnesses
2021-01-12 00:00:57 +08:00
bunnie
ea78de8014 convert all services to use xous-names server 2021-01-09 02:12:01 +08:00
bunnie
4ef581a266 riddled with race conditions, but...sort of works 2021-01-08 05:20:53 +08:00
bunnie
ab6fa7ae1c another intermediate checkout 2021-01-07 22:30:26 +08:00
bunnie
95d4f03591 intermediate checkin 2021-01-07 21:53:08 +08:00
Sean Cross
6ccbacf65f loader: assign sections to process ownership
This ensures these addresses aren't re-used and handed out again by
memory allocation.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-07 20:33:21 +08:00
bunnie
323c11f554 commit a version that exhausts the kernel allocation 2021-01-07 16:58:13 +08:00
bunnie
0d869870ae this code works in hosted mode but fails on hardware 2021-01-05 15:48:51 +08:00
bunnie
bdbe8f8288 intermediate checkin 2021-01-05 04:40:34 +08:00
bunnie
cce89395f6 test framework for xous-names 2021-01-04 23:34:18 +08:00
bunnie
b7263f7ef0 Merge remote-tracking branch 'origin/master' into hardware 2021-01-04 03:19:23 +08:00
Sean Cross
7b50d00eb8 repo: run cargo fmt
This reformats line endings to be consistent, and reinforces the
contents of `.gitattributes`.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-03 18:31:51 +08:00
bunnie
1359db06f4 add repeat command for stand-alone emissions testing 2021-01-03 03:04:25 +08:00
bunnie
63234411e2 get fcc test working 2021-01-02 03:04:28 +08:00
bunnie
3ceb41208c checkpoint: problems with pds send line (borrowed memory) 2021-01-01 03:44:42 +08:00
bunnie
534fb5373a intermediate checkin for sharing 2021-01-01 00:45:07 +08:00
bunnie
b9a31f7d99 try to layer in the fcc agent 2020-12-31 19:31:12 +08:00
Sean Cross
25e4d16de3 xous-os: rename CreateServer to CreateServerWithAddress
Servers will, by default, get randomly-assigned SIDs. Certain servers
will want to have well-known SIDs, such as the log server or the
nameserver. These will use a separate call in order to perform this
priveledged operation.

A subsequent patch will add `CreateServer`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:33:33 +08:00
bunnie
a129b48858 remove debug.rs from COM 2020-11-27 16:48:57 +08:00
Sean Cross
8e2faddd2f com_rs: use git protocol in Cargo.toml
Don't use git submodules, which can be confusing. Instead, use a git
repo in the Cargo.toml file.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-27 09:47:32 +08:00
bunnie
19a7a9ce98 get threaded version of COM handler working 2020-11-27 01:32:10 +08:00
bunnie
99d8f2a525 version with threads compiles, but doesn't work yet 2020-11-27 00:35:29 +08:00
bunnie
b568d86153 get non-blocking gas gauge checking working 2020-11-25 23:06:57 +08:00
bunnie
62f8ce32f0 attempt a refactor to add non-blocking battery status checking
stuck at trying to receive messages in the main shell in a
non-blocking manner
2020-11-25 19:58:24 +08:00
bunnie
d583e20b18 very basic battery monitoring via COM 2020-11-25 05:11:32 +08:00
bunnie
058c4473bb helps to add the source code too 2020-11-24 22:45:44 +08:00
bunnie
bc832b3a50 fix interrupt pending clear issue in debug module
during conversion to documented interrupts from Litex a case was
missed.
2020-11-24 22:44:19 +08:00