Commit graph

190 commits

Author SHA1 Message Date
bunnie
4d21f2d868 intermediate progress on debugging return messages 2020-10-14 01:28:10 +08:00
Sean Cross
84b39c931a kernel: services: switch address space prior to passing messages
Switch address spaces to pass messages to the new process, and switch
backafterwards.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-13 22:56:04 +08:00
bunnie
154384e3bb output hex for kernel debug
makes it much easier to read memory allocation requests
2020-10-13 16:15:15 +08:00
bunnie
cab4c7d4a9 fix more UTRA issues; migrate to dual-UART for kernel/console messages 2020-10-13 05:22:19 +08:00
bunnie
9a50de8b4e refactor: utra -> utralib naming
this cleans up some namespace issues when including
the utra crate which also refers to utra::generated::utra,
and there are CONST at the crate-level, and also functions
at the module-level which need disambiguation. By naming
the crate utra-lib this saves a bit of syntatic wrangling
at the top of every file.
2020-10-12 03:56:10 +08:00
Sean Cross
28f5f79b7d kernel: re-enable fat lto
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-11 09:15:49 +08:00
Sean Cross
fb027c569b kernel: lock: add new dependencies for utra
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-11 09:15:45 +08:00
Sean Cross
9140482a6b lock: add missing lockfiles
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-05 10:52:26 +08:00
Sean Cross
d0d687a239 utra: fix build on non-hardware release
This adds svd2utra, which enables building for non-embedded harware.

It also fixes some build issues, and paves the way for generating UTRA
at compile-time.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-05 10:13:51 +08:00
Sean Cross
d4f0496371 kernel: remove unused debug data
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 19:08:29 +08:00
Sean Cross
8759f552f7 kernel: syscall: allow returning to the kernel
If nothing is running, don't crash when the timer hits.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 18:28:58 +08:00
Sean Cross
fa23cfa88b kernel: services: update some debug comments
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 18:28:29 +08:00
Sean Cross
7843189c45 kernel: remove printing of "hello, world!"
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 18:28:02 +08:00
Sean Cross
a00151b4de kernel: use IRQ 0 for UART
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 18:27:49 +08:00
Sean Cross
5f4ee01a0d kernel: use fixed address for debug port
Don't use the hardware address, since it is not likely to be in
the universal address space.

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-10-04 18:13:58 +08:00
Sean
bbab52be7f kernel: flush MMU when we rotate the SATP value
Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-10-04 18:12:27 +08:00
bunnie
711e5ea910 slot in utra references 2020-10-02 04:52:03 +08:00
bunnie
4cded404e3 fix offset of UART 2020-09-26 01:36:45 +08:00
bunnie
5deeebae3b the loader seems to be working now. 2020-09-26 00:03:46 +08:00
bunnie
44f1a6b307 Merge branch 'master' of https://github.com/betrusted-io/xous-core into dvt-hardware 2020-09-25 17:50:24 +08:00
bunnie
8cc85f4e11 mods for running on DVT hardware 2020-09-25 17:50:02 +08:00
Sean Cross
2575d13acd cargo: update lock file
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:59:38 +08:00
Sean Cross
e5583a7646 kernel: fix message sender parameter
The `sender` was, previously, somewhat mislabeled. It was a combination
of PID and TID, except when it wasn't.

Instead, make this value a combination of ConnectionID and queue index.
This makes it easier to reason about which connection we're responding
to.

Additionally, don't expose teh global Server Index Table to userspace
programs.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:52:22 +08:00
Sean Cross
435612a370 kernel: syscall: use new is_blocking() call
This removes the need to manually specify whether a call is blocking.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 22:14:03 +08:00
Sean Cross
43002b8627 kernel: add blocking scalars
Add a new type: BlockingScalar, that can be used to do blocking scalar
calls such as sleep().

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 22:05:18 +08:00
Sean Cross
6d931ccc33 kernel: irq: disable irqs during handler
This fixes issue #1, which correctly noted the comment was correct but
the code implementation was not correct.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 21:13:56 +08:00
Sean
1b59719a74 kernel: hosted: support per-thread memory messages
Previously, each process could return one chunk of memory. With this
change, processes can now return one chunk of memory per thread. This
enables multiple threads to lend memory to a server.

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:20:16 +08:00
Sean
3e6d3904fb kernel: hosted: handle TrySendMessage the same as SendMessage
With the introduction of TrySendMessage, the kernel needs to know that
this data structure should be transmitted over the wire in the same
manner as SendMessage. Previously it was not special-casing this, which
resulted in memory errors.

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:17:01 +08:00
Sean
2dc0545eaa kernel: test: print informative error when kernel data changes
When the message coming in from the client to a server changes, print
an informative message rather than just "left != right".

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:13:44 +08:00
Sean Cross
77426aaf56 kernel: hosted: ignore errors from shutting down network socket
When running on Linux, attempting to shut down a network socket that
has already been closed results in an error. That is, if the client
disconnects, then the server will throw an error when it also attempts
to disconnect.

Ignore errors to `.shutdown()` to fix `cargo test` on Linux.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-03 10:19:05 +08:00
Sean Cross
cd7f8f67fc kernel: rename Connect/SendMessage to TryConnect/TrySendMessage
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:39:29 +08:00
Sean Cross
ae6dda0ad3 kernel: fix tests after message body rename
The test suite hadn't been updated to work with the new naming
convention.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 10:47:10 +08:00
Sean Cross
fbda077aff kernel: remove excess println() statements
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 10:46:48 +08:00
Sean Cross
96c5739cdd kernel: fix remaining warnings
This fixes all remaining warnings in the kernel. For now.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 01:17:35 +08:00
Sean Cross
bc92f4b042 kernel: services: fix build on riscv
Somehow the build broke. Oops.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:36:39 +08:00
Sean Cross
25824df335 kernel: services: print fewer diagnostic messages
These were printed a lot, which is not a thing we want right now.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:36:11 +08:00
Sean Cross
d87b59d47c kernel: riscv: print fewer debug messages
The IRQ handler was very noisy, which generated a lot of spew.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:35:28 +08:00
Sean Cross
9af28d0a90 kernel: irq: fix build
We were missing some packages when building on riscv.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:34:49 +08:00
Sean Cross
b78a71c495 kernel: print-panics: implement this feature in debug.rs
With this feature enabled, claim the kernel UART for panic printing.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:34:41 +08:00
Sean Cross
750f05c322 kernel: cargo: add print-panics feature
With this feature enabled, the kernel will claim a UART and print panics
when they occur.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:33:30 +08:00
Sean Cross
8f70c0640c kernel: fix server indexing
Server IDs were being improperly indexed, resulting in a
probably-invalid server index being returned.

Adjust these so that correct server indices are returned.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-29 22:10:24 +08:00
Sean Cross
dfd11f846d hosted: fix hosted builds
We can now run `cargo xtask run` and it will do the right thing.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-18 13:52:43 +08:00
Sean Cross
0ca7fe6f12 kernel/loader: fix build arguments
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-18 12:10:46 +08:00
Sean Cross
8920ab57cf xtask: remove loader, kernel from workspace to fix rebuilds
These packages modify RUSTFLAGS, which causes some packages to be
rebuilt every time. Move them out of the workspace so as to ensure they
don't use the same `target` directory.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-18 10:51:29 +08:00
Sean Cross
bb17038bfe kernel: rename "xous" to "xous-kernel" in import
Cargo appears to cache packages in the workspace when multiple packages
use the same crate. Unfortunately, Xous uses different features
depending on whether it's running in the kernel or in userspace.

Pull the kernel version of "xous" in under a different namespace in
order to force it to use a different build.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-17 18:37:40 +08:00
Sean Cross
cb959eb1cf kernel: fix interrupts
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-10 22:43:38 +08:00
Sean Cross
31f63c3f5f kernel: threads work now
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-10 22:05:06 +08:00
Sean Cross
1d23bc5aae kernel: first multiple threads working
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-10 21:17:48 +08:00
Sean Cross
a467d6fcc7 kernel: baremetal: 2nd process starts to run and crashes
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-10 16:06:38 +08:00
Sean Cross
75449f1deb kernel: get PID1 running, now working on PID2
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-10 00:35:37 +08:00