Commit graph

676 commits

Author SHA1 Message Date
bunnie
697d44de3d bump version pins to absorb changes to svd2utra etc. 2023-05-03 23:11:12 +08:00
Jean-Pierre De Jesus DIAZ
66df563313
kernel: update rand to 0.8
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-05-02 12:50:56 +02:00
bunnie
8a574f937f bump for xous-rs version pin update 2023-04-27 22:18:30 +08:00
bunnie
fb710592b0 harmonize scripts around xpack distro (goodbye sifive) 2023-04-27 22:09:08 +08:00
Sean Cross
97da54437e kernel: allow debug of crashed processes
When a process crashes, report this in the kernel console and offer to
attach a debugger.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-20 13:06:02 +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
849c136b90 bump versions because API crate changed 2023-04-12 23:02:30 +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
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
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
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
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
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
eupn
90df83f885
kernel: revamp IRQ handling 2023-04-05 16:35:01 +04: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
488a220d43
fix URL to public URL
didn't know i could just edit this directly in GH!
2023-03-22 01:05:10 +08:00
eupn
723a730231
kernel: fix warnings 2023-03-14 19:01:11 +04:00
eupn
e2d34d364c
kernel: always print when process is terminated 2023-03-14 18:48:45 +04:00
eupn
1634243f63
kernel: fix compile errors 2023-03-14 18:48:15 +04:00
eupn
7f5656445a
kernel: change some println!s to klog!s
Even when the print-debug feature isn't turned on, println! macro is still able to output some critical non-debug info to the console such as panics, process crashes and violations, etc. Debugging messages are printed with klog! macro that's disabled when debug-print feature is not set.
2023-03-14 18:47:57 +04:00
eupn
89a1447df4
kernel: checkout arm assembly binary 2023-03-14 18:41:45 +04:00
eupn
a42366b6cf
kernel: add arm to asm scripts 2023-03-14 18:41:33 +04:00
eupn
618392ca52
kernel: add arm features and deps to Cargo.toml 2023-03-14 18:39:19 +04:00
eupn
10bffc55b6
kernel: update build script to pick arch specific linker and asm binary 2023-03-14 18:37:40 +04:00
eupn
434e865a45
kernel: add sama5d2 uart workaround 2023-03-14 18:36:41 +04:00
eupn
0953812dfc
kernel: hide hw specific details in process init 2023-03-14 18:35:12 +04:00
eupn
3451d106f9
kernel: update debug and shell modules 2023-03-14 18:32:52 +04:00
eupn
38a02f9dbb
kernel: split precursor and sama5d2 platform modules 2023-03-14 18:30:07 +04:00
eupn
2ecd91b3c5
kernel: split arm and riscv arch modules 2023-03-14 18:28:49 +04: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
73aa6c3b14 cleanup hosted mode warning 2023-02-15 20:35:32 +08:00
bunnie
6563ad174e bump revision 2023-02-15 20:35:16 +08:00
bunnie
fced4608b6 bump kernel package rev 2023-02-15 20:26:30 +08:00