Commit graph

1526 commits

Author SHA1 Message Date
Sean Cross
2c270ee355 emulation: add initial drafts of i2c for soc
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-25 23:55:04 +08:00
bunnie
1d9b474a6d add in a missing redraw command 2021-06-25 09:09:42 +08:00
Sean Cross
7b7be0fe9e hosted: fix MemoryRange refactor
This fixes the MemoryRange refactor where `.addr` and `.size` are now
private fields.

Previously it had only been tested on baremetal mode.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 18:02:28 +08:00
Sean Cross
a99839ecd6 xous: mark MemoryRange fields as private
Mark the private fields in a `MemoryRange` struct as being private. This
allows us to perform operations on the memory range armed with the
knowledge that the entire range is valid and unaliased.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:41:16 +08:00
Sean Cross
1fb7d4ebd5 kernel: use unsafe {} on Hosted mode
Since `MemoryRange::new()` is now unsafe, add an `unsafe {}` note when
calling this function on Hosted mode.

This fixes the build.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:07:41 +08:00
Sean Cross
023918082b xous: add as_slice() and as_mut_slice() to MemoryRange
Add functions to obtain various slices from a `MemoryRange`. These
functions are safe because we know that the memory in the range is
valid, and we know the size of the type.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:02:47 +08:00
Sean Cross
977a175bb5 xous: mark MemoryRange::new() as unsafe
This function allows for creating arbitrary memory ranges. Mark this
function as `unsafe` in order to warn users that this can be used to
create invalid memory regions.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:02:02 +08:00
bunnie
f93e06939e
Update flash.md 2021-06-23 18:52:25 +08:00
Sean Cross
b1e949c4c4 xtask: add libstd-test routine
This routine takes a list of binaries to include in the resulting image.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-23 17:54:04 +08:00
Sean Cross
e4d02301ee kernel: support pluggable debug printing
This allows us to support different printers in the kernel. For example,
this can be used to swap out the println!() function to print to GDB
when a debugger is attached.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-23 17:51:59 +08:00
Sean Cross
931b992063 kernel: gdb_server: return 0xff on read error
This seems to be rather universal.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 20:23:22 +08:00
Sean Cross
524df22667 kernel: riscv: ensure pages are writable when poking
Ensure pages of memory can be written to when we write to them. This
lets us patch program code to, for example, insert breakpoints.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 20:22:45 +08:00
Sean Cross
973e4601e4 kernel: don't use debug_here in CI
When running in CI, cause processes to panic rather than waiting for a
debugger to attach. This will ensure test failures are caught sooner
rather than later.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 20:05:24 +08:00
Sean Cross
4901453e3d syscall: retor_mem: switch to client in hosted mode
Switch to the message client when returning memory in Hosted mode. This
properly marks a process as ready-to-run, which was otherwise not
correctly done.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 20:04:22 +08:00
Sean Cross
86dd38f7fa kernel: fix hosted build
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 14:24:16 +08:00
Sean Cross
1bc84c76ff emulation: ignore obj/ directory
This is generated by Visual Studio to cache objects, so ignore it.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 14:13:52 +08:00
Sean Cross
57b502e2c6 kernel: add gdb support to riscv
This adds various primitives that can be used to attach a debugger to
the kernel.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 14:13:01 +08:00
Sean Cross
0332959068 kernel: debug: add gdb_server support
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 14:12:42 +08:00
Sean Cross
7371ac7bd5 emulation: connect kernel uart to port 9999
This port is used to attach a debugger.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 14:11:58 +08:00
Sean Cross
f1041f6f6e kernel: add gdbserver to Cargo.toml
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 14:11:26 +08:00
Sean Cross
266a4541d9 emulation: update renode svd file
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 13:56:51 +08:00
Sean Cross
e883dc56d3 emulation: remove unused csr.csv file
This file appears to be completely unused, and is only causing
confusion.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 13:55:33 +08:00
Sean Cross
6691c6e4a7 peripherals: sync trng blocks with latest bitstream
The bitstream definition for the TRNG blocks has changed. Update the
Renode models to match.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-21 13:54:53 +08:00
Sean Cross
80860f0a51 Merge remote-tracking branch 'origin/main' into debugger 2021-06-21 13:22:51 +08:00
bunnie
e9499586f1 right. status loop was a mess.
classic code rot resulting from adding stuff that was never designed
to be in part of what was originally just a test loop to show
uptime.

cleaned it up, idle CPU load drops from 8% -> 2-3%.
2021-06-20 01:55:57 +08:00
bunnie
f4fbe84b78 improve redraw performance on menu
it helps to actually redraw the menu instead of relying
upon status updates to redo the Ux.
2021-06-20 00:44:59 +08:00
bunnie
c0d4cbe81d make the menu object more generic; demo with emoji selection 2021-06-19 04:44:21 +08:00
bunnie
b5630b74ce update documentation 2021-06-19 01:36:35 +08:00
bunnie
2b5ba61552 add some useful messages on boot for the hosted mode users 2021-06-19 01:05:42 +08:00
bunnie
69a22adee9 menus basically working 2021-06-19 00:25:18 +08:00
bunnie
aa967a5a17 quiet up hosted mode build warnings 2021-06-18 22:37:08 +08:00
bunnie
769c90764c menu Ux is now nominally doing something menu-like 2021-06-18 19:35:03 +08:00
bunnie
65cc8dd90c defacement first-pass seems working 2021-06-18 17:40:00 +08:00
bunnie
0f937037e4 just getting to the point of implementing defacement
menu now pops up. does nothing, but we can at least
change contexts for the Ux into a different Ux theme.
2021-06-18 16:20:56 +08:00
Sean Cross
2a1aa24040 kernel: debug: add command to print processes
This changes the `p` command to only print processes, and renames the
existing behavior to `P` which prints processes and threads.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-18 12:56:27 +08:00
Sean Cross
9ced90190e kernel: fix process suspension
This enables processes to be "suspended" by going into a Debug state.
Messages will back up and processes will continue to be scheduled around
the suspended process, while the system will continue to operate.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-18 12:55:21 +08:00
Sean Cross
13204d1714 Merge branch 'master' into debugger
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-18 10:56:30 +08:00
bunnie
62c9737bbc tenuous addition of a menu object
things don't crash, but...haven't really validated if they work, either!
2021-06-18 04:10:41 +08:00
bunnie
3664ff6718 clean up keyboard event handling so the GAM is the gateway server
this allows the GAM to handle authentication for listening requests.
2021-06-17 01:12:25 +08:00
bunnie
799bae0386 Merge remote-tracking branch 'origin/master' into ux-refactor 2021-06-16 18:38:50 +08:00
Sean Cross
00e9ead818 xous: definitions: dispose of Vec on hosted
When running on Hosted mode, reconstitute the Vec and dispose of it
rather than freeing the memory by passing it back to the kernel.

This is because the data was previously allocated by way of a vec, and
only a reconstituted vec knows how to properly dispose of the data.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-16 18:35:18 +08:00
Sean Cross
486d993c4c xous: hosted: don't over-allocate memory messages
Call `shrink_to_fit()` on the array that contains memory messages. This
is beacuse we throw away the `capacity` field, and we want to make sure
we can reconstitute the vector at a later stage.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-16 18:35:17 +08:00
bunnie
96ca0eb8a1 Merge remote-tracking branch 'origin/master' into ux-refactor 2021-06-16 17:56:44 +08:00
Sean Cross
180c99aa8d kernel: services: free servers on process termination
When a process is terminated, we disconnect it from all other processes.
We also need to free the slot in the server table.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-16 17:55:23 +08:00
Sean Cross
76b16579b0 kernel: syscall: remove warning in hosted mode
This was a function whose only purpose is useful in baremetal mode.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-16 17:54:55 +08:00
bunnie
4b1495a8ef change cargo xtask run to something that fails 2021-06-16 17:51:02 +08:00
bunnie
03bcf18348 clean up enum-based dispatch for Layouts, pulling in enum_dispatch crate. 2021-06-16 17:41:47 +08:00
bunnie
356b07dacc works on "real hardware" but some issues with hosted mode 2021-06-16 17:03:28 +08:00
Sean Cross
62623f995c Merge branch 'master' of github.com:betrusted-io/xous-core 2021-06-16 16:54:06 +08:00
Sean Cross
fb839f3217 wip
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-16 16:53:40 +08:00