bunnie
daebf17a5e
Merge branch 'bunnie-dev' into main
...
Probably about time to push some of this net stuff into main, even
though it's got a ways to go. This adds UDP/ICMP/DNS to the net stack,
but the ping probably needs to be refactored a bit to be *much simpler*
and more reliable, and there's some corner cases to chase.
2021-10-22 04:10:33 +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
f1fe850820
ping was surprisingly hard.
...
not fully working yet, but the architecture is there and it builds.
smoltcp's ping implementation (or at least its demo code) was not
very amenable to splitting into modules, had to recode most of it.
the ipv6 is still a hack.
2021-10-21 06:28:11 +08:00
bunnie
3d1c216706
make interrupt events a try_send type, so they don't cause deadlock
...
this will help mitigate interrupt storms, e.g. if someone tries a
ping flood attack.
2021-10-21 00:03:08 +08:00
bunnie
cee4e83746
add a DNS parser. that was fun. :-|
...
yes, i know there is some fancy way to code this with iterators.
i don't like that way. this ways is easier for me to understand
and verify. It works now.
Sometimes, Rust sucks a bit. It's ok, you can cry.
2021-10-20 20:06:08 +08:00
bunnie
1a77f0afae
add formatter for net crate ip address
2021-10-20 14:10:31 +08:00
bunnie
643e9a7d62
dns. needs more work, but it is at least minimally functional.
2021-10-20 05:18:54 +08:00
bunnie
60b0e3df87
handle the expected error from the disconnect call
...
When disconnecting from a remote server that was destroyed, we
would expect (and get) a ServerNotFound error.
2021-10-19 15:01:36 +08:00
bunnie
2885890ee2
fix typo
2021-10-19 05:06:05 +08:00
bunnie
afeae79d45
add quit opcode to Net
2021-10-19 05:02:00 +08:00
bunnie
ab3e05764e
add some status and help message embellishments
2021-10-19 04:43:55 +08:00
bunnie
40771fbba7
flesh out UDP API...as much as we can
...
Multicast/Broadcast is not supported by smoltcp it seems, so those
calls are just unimplemented. But we are able to clone UdpSocket,
for the sick puppies who like to do that sort of thing.
2021-10-19 04:42:06 +08:00
bunnie
0cbca7fbe1
add UDP send and test routines
2021-10-19 01:41:22 +08:00
bunnie
84a8bf05f8
re-org api so each protocol has its own file
2021-10-18 17:33:20 +08:00
bunnie
98bbe848fc
cleanup Udp Bind API
...
version for Xous internal use, and a version for integration into libstd.
2021-10-18 17:04:16 +08:00
bunnie
a8c6e8047f
simple end-to-end demo of receiving UDP packets asynchronously
2021-10-18 05:55:42 +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
4a2445483d
scoping. I heard that's a thing in Rust.
2021-10-17 16:47:08 +08:00
bunnie
a7d8a4c1e0
clear ARP cache on DHCP renew (AP change edge case)
2021-10-17 15:29:45 +08:00
bunnie
665d7d7713
only update net config if it's changed since the last renewal
2021-10-16 00:15:23 +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
da8987e531
restore power management
2021-10-13 02:10:18 +08:00
bunnie
ef70daf7bb
fix hosted mode build config
2021-10-13 02:07:55 +08:00
bunnie
df9bdce6dc
fix some cosmetic issues
2021-10-13 02:03:12 +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
e06d946bcd
simplify error handling code
...
confirmed that ignoring the error on a write is probably what we want --
it will truncate the string
2021-10-10 20:55:54 +08:00
bunnie
5fa8f2a6a3
discard errors on log write
...
this at least removes a panic that crashes processes. it does
mean that some log messages can get silently lost, but this is
better than crashing if the arguments to the logger can't be
parsed for some reason?
2021-10-10 18:32:00 +08:00
bunnie
7a724a15cf
fix permissions
2021-10-10 02:26:31 +08:00
bunnie
61e21cce19
would be helpful to add the devices.rs file
2021-10-10 02:26:15 +08:00
bunnie
c8decc85c2
std::time doesn't exist, make a wrapper around Ticktimer for smoltcp
2021-10-10 02:20:01 +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
23edeb9b5a
add wlan dhcp to oqc test
2021-10-07 00:57:22 +08:00
bunnie
81653ec94b
wot. how are these changes not being saved.
2021-10-04 17:37:17 +08:00
bunnie
f0c33bc99c
tighten up operator flow for factory tests
2021-10-04 17:25:49 +08:00
bunnie
e4c79a5f47
start to lay out skeleton for pddb
2021-10-04 14:50:30 +08:00
bunnie
5e9af8821b
back out build-impacting changes from the attempt to make a test case
2021-09-26 00:55:26 +08:00
bunnie
be8a3a9acd
an attempt to create the failing test case, but it seems this is too simple
2021-09-26 00:43:46 +08:00
bunnie
011466ceb5
start on a minimal test stub for the heap allocation problem
2021-09-26 00:01:59 +08:00
bunnie
a629681c59
re-enable the watchdog timer for the master branch
2021-09-25 22:36:35 +08:00
bunnie
4a57adac3d
add battery check, version print to oqc test
2021-09-20 00:05:21 +08:00
bunnie
87228ad747
basically working OQC test
2021-09-19 01:06:21 +08:00
bunnie
c2c919ba81
add oqc test service
...
this works around the problem with stdlib allocator not
working quite correctly in spawned threads.
2021-09-18 02:22:35 +08:00
bunnie
74207851ac
don't even include the code to print server ID
2021-09-18 02:22:06 +08:00
bunnie
bdbaba027b
improve drawing performance
...
the trailing update after every event seems redundant now that
the gam is cleaned up
also fix a bug that causes overflow text on tl fitted text
to overflow the drawing region
2021-09-18 02:21:12 +08:00
bunnie
5df4e38caf
add some debug helpers for suspend/resume
2021-09-18 02:19:43 +08:00
bunnie
029c845359
add ssid, suspend/resume test to the OQC test routine; comment out keyboard
...
keyboard routine still pending fixing a possible bug in xous allocator
2021-09-16 03:54:35 +08:00
bunnie
ce026e661d
clear warning from previous mux fix
2021-09-16 03:54:19 +08:00
bunnie
21fb59c4d9
fix incorrect &mut self in library call
2021-09-16 03:53:36 +08:00
bunnie
9aef2eb7b4
fix dirty rectangles on resume
2021-09-16 03:53:04 +08:00
bunnie
4882016d08
add a graphics test routine for OQC
...
invoked via the GAM, callable exactly once per boot for up
to 60 seconds.
2021-09-16 01:00:22 +08:00
bunnie
f0dd512d7d
bump sha2 version number so it matches what's on crates.io (for clean patching)
2021-09-15 18:53:11 +08:00
bunnie
8edb02ba40
try a version using scalars, still crashes
2021-09-15 18:29:27 +08:00
bunnie
8ce0e8c789
intermediate checkpoint of failing memory-passing for keyrawstates
2021-09-15 17:59: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
d0a83b6865
add backlight test
2021-09-11 22:53:20 +08:00
bunnie
49919c6123
fix typo in check clause
2021-09-11 18:02:26 +08:00
bunnie
5bff7433a5
add internal vcc measeruments to self test
2021-09-11 18:00:22 +08:00
bunnie
e06188c5fa
add trng module to self-test
2021-09-11 00:16:55 +08:00
bunnie
5c33e84858
fix hosted mode missing audio dummy functions
2021-09-10 22:58:03 +08:00
bunnie
6eed8deb4c
improve audio testing integration for automation framework
2021-09-10 22:54:23 +08:00
bunnie
beed5c395a
add volume control functions to the codec
2021-09-10 22:53:41 +08:00
bunnie
3be7204ce6
audio test frameworks initial working cut
2021-09-10 02:56:27 +08:00
bunnie
bd89146967
commit latest formatting changes for test output
2021-09-09 22:32:08 +08:00
bunnie
549912c9d5
add rtc test
2021-09-09 16:55:56 +08:00
bunnie
7ac8b9100d
create a test case for cosine intrinsics
2021-09-08 15:10:54 +08:00
bunnie
ccbe7c479f
improve braille testing flags, make them more consistent
...
i wonder if there isn't a workspace-level way to flip a flag...
2021-09-07 19:11:54 +08:00
bunnie
0e94725d23
add wycheproof help message
2021-09-06 14:43:19 +08:00
bunnie
01bfc375b2
Merge branch 'main' into bunnie-dev
2021-09-06 14:40:16 +08:00
bunnie
1a55973346
adjustments to self test routines
2021-09-06 14:39:44 +08:00
Fabian Weißberg
4bb454ef10
Import x25519 vectors from Project Wycheproof
...
Closes #76
The test vectors in wycheproof-import/x25519_test.json correspond to the upstream commit 4672ff74d6 .
For details see wycheproof-import/README.md.
Signed-off-by: Fabian Weißberg <fabian.weissberg@tu-dortmund.de>
2021-09-05 22:27:16 +02:00
bunnie
858a1ed019
beginnings of a factory self-test routine; expand COM functionality
2021-09-05 23:26:07 +08:00
bunnie
c2afa2b09f
fix runs index length that was not pulled in after gateware optimization
2021-08-30 00:30:44 +08:00
bunnie
dbab3d2b27
adjust L2 cache flush region to 512k
...
although te cache is only 128k, experiments show that the cache
is not reliably flushed until 512k is written. Not sure why...
2021-08-29 18:28:25 +08:00
bunnie
4c05ee2fe6
patch to fix backspace on console injection
2021-08-29 13:28:06 +08:00
bunnie
f4232a3236
stabilize suspend/resume a bit
...
- introduce wfi backoff during the suspend process
- increase the region of cache flush - seems to improve
stability
- remove some print calls to avoid interference during
the sleeping process
2021-08-29 12:04:20 +08:00
bunnie
e2ce3cad2c
make sure that the power states get set correctly early in the resume process
2021-08-27 15:47:27 +08:00
bunnie
57574495d8
handle case of sleep request before resume is fully completed
2021-08-24 23:35:32 +08:00
bunnie
f5b69a8cef
fix hosted mode
2021-08-24 23:34:33 +08:00
bunnie
3188225030
modularize the layout crate
2021-08-24 19:19:06 +08:00
bunnie
ebf0a02345
a patch for issue #73
...
the problem is that during the computation of the lines, the
cursor isn't wrapping to the next line if the last character
would render "into" the edge of the box. adding a trailing
space to any incoming strings forces the line to wrap.
you can aggravate this condition by typing the following
sentence into the shell:
this is a test of a message that is too long a message
when it fails, it renders
this is a test of a messag
e that is too long a messag
adding the trailing space causes it to render as
this is a test of a messag
e that is too long a messa
ge
which is the desired behavior
2021-08-24 17:58:39 +08:00
bunnie
47fef3c2d0
clean out debug messages and scaffolding
2021-08-24 01:48:30 +08:00
bunnie
387b5d22e5
another fix for issue #75 : llio resume failure
...
Found the following KP on resume. This time it looks like it's
failing in a syscall, during a send_message call. There's no
more visibility into what causes this, so this commit tries to clean
up some loose ends in the resume path that could send messages before
the system is ready. Namely, the console mux call got condensed into
an abridged version that doesn't send log messages (you couldn't see
them anyways...), and the I2C engine now pauses suspend until
the current transaction at hand completes. I suspect it's quite
likely that it's the I2C engine that's causing the issues...
LLIO -> PID 14
Jumping to loader...
PROGRAM HALT: CPU Exception on PID 14: Store page fault of 0x00000000 at 0x0003a02e
Current thread 2:
Thread 2:
PC:0003a02e SP:7ffff170 RA:00036290
GP:00000000 TP:60000000
T0:00000000 T1:000000f0 T2:00000030
T3:00000080 T4:000000f4 T5:ffffffff T6:0000008f
S0:7ffff1d0 S1:7ffff228 S2:00000007 S3:00000007
S4:00000001 S5:00000004 S6:00037996 S7:00010e34
S8:00011548 S9:000101bc S10:7fffff4c S11:0003c000
A0:0000000e A1:00000000 A2:00000004 A3:00000000
A4:00000000 A5:00000000 A6:00000000 A7:00000000
0003a028 <_xous_syscall>:
3a028: 00000073 ecall
3a02c: 4282 lw t0,0(sp)
3a02e: 00a2a023 sw a0,0(t0)
3a032: 00b2a223 sw a1,4(t0)
3a036: 00c2a423 sw a2,8(t0)
3a03a: 00d2a623 sw a3,12(t0)
3a03e: 00e2a823 sw a4,16(t0)
3a042: 00f2aa23 sw a5,20(t0)
3a046: 0102ac23 sw a6,24(t0)
3a04a: 0112ae23 sw a7,28(t0)
3a04e: 8082 ret
0003623c <_ZN4xous7syscall12send_message17h44786a68889a5f1dE>:
pub fn send_message(connection: CID, message: Message) -> core::result::Result<Result, Error> {
3623c: 7175 addi sp,sp,-144
3623e: c706 sw ra,140(sp)
36240: c522 sw s0,136(sp)
36242: c326 sw s1,132(sp)
36244: 84aa mv s1,a0
36246: 4549 li a0,18
crate::arch::syscall(call)
36248: 4214 lw a3,0(a2)
3624a: 4258 lw a4,4(a2)
3624c: 04a10023 sb a0,64(sp)
36250: c2ae sw a1,68(sp)
36252: c4b6 sw a3,72(sp)
36254: c6ba sw a4,76(sp)
36256: 4608 lw a0,8(a2)
36258: 464c lw a1,12(a2)
3625a: 4a14 lw a3,16(a2)
3625c: 4a50 lw a2,20(a2)
3625e: c8aa sw a0,80(sp)
36260: caae sw a1,84(sp)
36262: ccb6 sw a3,88(sp)
36264: ceb2 sw a2,92(sp)
let mut ret = crate::Result::Ok;
36266: d082 sw zero,96(sp)
let args = call.as_args();
36268: 0828 addi a0,sp,24
3626a: 008c addi a1,sp,64
3626c: 00000097 auipc ra,0x0
36270: 8da080e7 jalr -1830(ra) # 35b46 <_ZN4xous7syscall7SysCall7as_args17h7e6c318e8a926fa8E>
args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], &mut ret,
36274: 4562 lw a0,24(sp)
36276: 45f2 lw a1,28(sp)
36278: 5602 lw a2,32(sp)
3627a: 5692 lw a3,36(sp)
3627c: 5722 lw a4,40(sp)
3627e: 57b2 lw a5,44(sp)
36280: 5842 lw a6,48(sp)
36282: 58d2 lw a7,52(sp)
36284: 1080 addi s0,sp,96
_xous_syscall(
36286: c022 sw s0,0(sp)
36288: 00004097 auipc ra,0x4
3628c: da0080e7 jalr -608(ra) # 3a028 <_xous_syscall>
crate::Result::Error(e) => Err(e),
36290: 5586 lw a1,96(sp)
36292: 5516 lw a0,100(sp)
36294: 4605 li a2,1
36296: 00c59563 bne a1,a2,362a0 <_ZN4xous7syscall12send_message17h44786a68889a5f1dE+0x64>
Err(e) => Err(e),
3629a: c0c8 sw a0,4(s1)
2021-08-24 01:39:48 +08:00
bunnie
80cae0d446
intermediate progress on issue #74
...
still not fixed, but things are leaned up.
2021-08-23 05:12:21 +08:00
bunnie
198ef3d0c8
attempt to address issue #75
...
resume failure was seen due to a crash in the engine-25519 process,
in particular, it's crashing on a try_send_message call.
Seems like probably the loader -> kernel transition could have
left some turds in the curve25519 engine, triggering an interrupt
when the system is not yet stable.
this attempts to smooth that over.
2021-08-23 05:07:38 +08:00
bunnie
5042da07fb
refactor wdt to be more reliable and simpler
2021-08-23 05:07:21 +08:00
bunnie
cf747f2844
fix keyboard repeat; accidentally eliminated it during power optimizations
2021-08-22 18:52:33 +08:00
bunnie
24d1bed9f8
restore thread in hosted mode
2021-08-22 17:52:28 +08:00
bunnie
5df8275c00
major refactor of the keyboard server
...
This one gets rid of a ton of awful, crufty code that was pre-std.
It also removes the following features:
- raw scancode reporting: nobody uses them, and they've never been tested.
They can be added in later if someone wants to e.g. build a MAME emulator.
- multi-listener: there is no good reason to do this on a secure system.
multi-listener is basically a keyboard logger. It's better if we just
control it to a single keyboard listener.
2021-08-22 17:13:36 +08:00
bunnie
abd8eadfd8
modify the console behavior to better capture panics on resume
...
switches to kernel console on suspend, keeps it in kernel
console on resume for a few hundred ms before switching back
to our original setting
2021-08-22 14:28:06 +08:00
bunnie
1cd95649df
expand the rootkeys environment sanity check to include the GAM
2021-08-22 02:41:22 +08:00
bunnie
4d3a8c2ced
fix issue #81
...
background clears were going beyond their borders, and also
introducing a new border of their own. fixed.
2021-08-22 02:18:02 +08:00
bunnie
5706c9e525
fix stale comment
2021-08-22 02:17:53 +08:00
bunnie
8d6a9f6b46
add some helper scripts for development
2021-08-22 00:41:22 +08:00
bunnie
20fd465acd
a little more cleanup/re-org
2021-08-22 00:37:53 +08:00