Commit graph

10340 commits

Author SHA1 Message Date
bunnie
cb3c81d0fb fix #357: regenerate password if password field is blank in vault 2023-04-12 23:19:11 +08:00
bunnie
cbbeaa27ad prevent overwriting current process ID in case of double-interrupt
this is part of #361, per @xobs
2023-04-12 23:14:09 +08:00
bunnie
1ff1380916 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-04-12 23:09:01 +08:00
bunnie
6f89430133 add updated pins 2023-04-12 23:08:36 +08:00
bunnie
849c136b90 bump versions because API crate changed 2023-04-12 23:02:30 +08:00
Sean Cross
f8cb6811ac
Merge pull request #364 from Foundation-Devices/fix-doctest
Fix xous-rs documentation tests
2023-04-12 22:45:20 +08:00
Jean-Pierre De Jesus DIAZ
9cd614fd35
fix xous-rs documentation tests
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-04-12 16:43:29 +02:00
bunnie
904b66a6e9 absorb ebreak fix for CPU 2023-04-12 13:14:24 +08:00
bunnie
68641cccc9 bump release notes 2023-04-12 13:14:11 +08:00
bunnie
b471b604d0 add option to print panics to screen on certain kernel panic events 2023-04-10 16:11:37 +08:00
bunnie
344dd5094b make the LCD panic handler Precursor-specific 2023-04-10 15:41:59 +08:00
bunnie
2903de5b7b
Merge pull request #363 from betrusted-io/lcdpanic
kernel: initial lcdpanic implementation
2023-04-10 15:31:02 +08:00
Sean Cross
31235c2547 kernel: initial lcdpanic implementation
Panic to the LCD when the kernel panics.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-10 14:42:59 +08:00
bunnie
cb875cf54e various fixes to gdb-stub
these are from @xobs via issue #361
2023-04-09 22:15:57 +08:00
bunnie
024d95e75b sync up the precursor with what's on the releases train 2023-04-09 17:11:46 +08:00
Sean Cross
89ca18caad
Merge pull request #362 from betrusted-io/fix-resume
kernel: use correct fake interrupt cause
2023-04-09 00:32:33 -07:00
Sean Cross
dbf28fbd61 kernel: use correct fake interrupt cause
Previously, we were creating a fake interrupt that was a "user software
interrupt". Update this to be a "supervisor external interrupt" to fix
hardware resume.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-09 15:31:06 +08:00
bunnie
38026e67ff fix dependabot reported DoS vuln in zip crate dependency
seems to not break anything else
2023-04-09 14:29:50 +08:00
bunnie
2d1073faf0 add retry loop to EC version checking
sometimes it can take a bit longer for the EC to respond to
version requests. Instead of hard coding a timeout and check
poll the EC over a longer period, which leads to a system more
tolerant of the variations in startup times.
2023-04-09 14:22:54 +08:00
bunnie
d3f2de8dfa bump lockfile to match latest pins 2023-04-09 00:59:54 +08:00
bunnie
8357ab31a5 bump all pins because utralib got updated 2023-04-09 00:48:35 +08:00
bunnie
99f8fa95b2 bump lockfile before re-publishing 2023-04-09 00:46:48 +08:00
bunnie
f3dc258a6a reinstate app-uart into the svd tree 2023-04-09 00:46:28 +08:00
bunnie
66d561b2bf fix flag polarity 2023-04-09 00:46:08 +08:00
bunnie
9c94d6b4c0 bump versions because xous-rs API changed for gdb-stub 2023-04-08 23:49:24 +08:00
bunnie
ddc06313cc bump release notes and lockfile 2023-04-08 23:47:36 +08:00
bunnie
6990bc0a95 add gdb-stub option to xtask 2023-04-08 23:46:10 +08:00
bunnie
9bb574cffe
Merge pull request #360 from betrusted-io/gdb-stub-redux
Implement `gdb-stub` on 3rd UART
2023-04-08 17:49:56 +09:00
bunnie
db8348292f add force EC update to the non-initialized menu options
also bump release notes
2023-04-08 16:40:40 +08:00
bunnie
430d3550b7 move time services into the DNS crate
Time services are moved into the DNS crate so that the EC
update thread can remain running and consuming resources.

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

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

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

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

leaves the EC update handler thread running permanently so
that force updates can be caught and handled
2023-04-07 16:22:22 +08:00
bunnie
4d118e72b8 fix 355
The resolution is to close the previously open basis if one with
the smae name is opened. This is in part because there isn't
a universally sensible/deterministic way of resolving behavior
in this case, and partially because the structure of the basis
map is a hash map keyed by name ... to differentiate basis with
same name/different password would require...leaking some information
about the password? i guess we could go strictly by opening order
by adding an opening parameter but basis management is already
confusing enough.

A message is popped up to indicate when the previous basis is
being unmounted.
2023-04-07 14:51:37 +08:00
Sean Cross
6016f951ef kernel: gdb: unpause process on disconnect
Resume the debugged process when the debugger disconnects.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 14:34:13 +08:00
Sean Cross
916a0bde42 kernel: fixup gdb guardrails
The riscv target requires stepi to be implemented, which we now do.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 11:23:35 +08:00
Sean Cross
7c2ffbb34e kernel: implement gdb server
The gdb server runs on an additional serial port and provides
process-level debugging to the kernel.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
3469c292ec kernel: riscv: fixup exception debug handling
Debug handling was not correct, and didn't work at all. Additionally,
interrupt masking didn't work.

Fix these problems.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
5c52fbd522 emulation: fix renode compatibility for peripherals
Many of the devicse have changed from `uint` to `ulong`, so forward-port
the peripherals to work with the new format.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
eb33af53e0 kernel: gdb: break features into individual files
Since gdbstub is able to do this, break individual features into their
own files.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
fd71993b68 kernel: gdb: begin ext implementation
Implement the basics required to get "extended mode" working. This is
waiting on upstream to fix issues, but should allow us to attach to
processes once it works.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
ec97b3cdcf kernel: throw error when debugging invalid process
When debugging an invalid process (e.g. not yet run, terminated, etc.)
return an error rather than silently continuing.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
7b36f33ef9 kernel: gdbuart: disable IRQs during destruction
Disable IRQs during destruction, but only if constructed with
`GdbUart::new()`. This allows characters to buffer when the GDB bridge
is destroyed while avoiding the double-free error we were getting from
creating a new UART in the IRQ handler.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
3f2c4de163 xous: add interrupts to irq-capable calls
These calls should be possible to make during interrupts.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
a34733e5e9 kernel: basic version of gdb serevr
This adds a basic gdb server. Currently, it is possible to list
processes and inspect memory and threads. It is not yet possible to
actually interact with code (e.g. no breakpoints and no single
stepping).

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:48:45 +08:00
Sean Cross
13029a76a2 kernel: initial gdb-stub reimplementation
Add an initial reimplementation of the gdb-stub using the gdbstub
backing crate.

This supports process enumeration and basic thread investigation.
Processes will pause when the debugger is inspecting them. Memory and
registers can be investigated. Threads can be listed and selected.

It does not yet support breakpoints.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:45:42 +08:00
Sean Cross
e48c108288 kernel: riscv: fix disable_irq when irqs are disabled
Previously, `disable_irq()` would unconditionally mask an interrupt in
the `sim` register. However, when interrupts are disabled this register
is zero, and we really should be updating `SIM_BACKING`.

Consult the state of the interrupt handler and update the appropriate
field as necessary.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:42:46 +08:00
Sean Cross
02065a6a0b kernel: make disable_irq() infallible
This function never failed. Make it infallible so that it matches the
same calling convention as `enable_irq()`

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:42:46 +08:00
Sean Cross
787d77fcbd kernel: implement FreeInterrupt
This syscall is the opposite of ClaimInterrupt.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-06 10:42:45 +08:00
bunnie
e8fe8b9123 allow lockfile to absorb new armv7 package 2023-04-05 23:40:03 +08:00
bunnie
26c56e2ead
Merge pull request #359 from Foundation-Devices/arm-revamped-irq
arm: revamp IRQ handling
2023-04-06 00:32:32 +09:00