Commit graph

23 commits

Author SHA1 Message Date
Sean Cross
797d622cc7 kernel: use connect() for some kernel tests
Now that `connect()` works, use that for some tests rather than
exclusively using `try_connect()`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 19:19:01 +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
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
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
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
21aa67b748 workspace: remove workspace
The kernel and userspace both need to use `xous`, but have different
requirements. If we use a workspace, then all instances of `xous-rs`
must have the same feature set.

This breaks them apart so the kernel can have one set of features and
programs can have another set.

As part of this change, tests are now integrated into the kernel, and a
new `create_process_as_thread()` and `wait_process_as_thread()` function
pair have been added.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-02 16:11:12 +08:00
Sean Cross
fbcbc8dfa1 kernel: fix deadlock in threaded messages
Due to an ordering issue, it was possible for thread message responses
to become deadlocked, wherein a message would get stored in the shared
table in between checking the table value and locking the network
connection.

This change makes a second check of the table after the network
connection is locked, in order to prevent this condition.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-28 18:12:52 +08:00
Sean Cross
f925011ea2 kernel: fix multiple contexts test
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-28 14:03:44 +08:00
Sean Cross
9af0fec049 kernel: convert multi-thread test (it's broken right now)
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-28 13:54:11 +08:00
Sean Cross
c40e0a138d kernel: convert scalar message test to use processes
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-28 13:40:02 +08:00
Sean Cross
1512d2138e kernel: tests: remove excess prints
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-28 13:35:15 +08:00
Sean Cross
19222c34a9 kernel: get shutdown and multi-clients working
THis now has proper authentication for tests.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-28 13:28:14 +08:00
Sean Cross
7258fc83b7 kernel: rework process creation
This now uses a system of access keys to associate processes with the
kernel.

This currently does not pass tests.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-27 21:44:50 +08:00
Sean Cross
ab7a56937c create_process: rename from spawn_process
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-27 09:30:43 +08:00
Sean Cross
b9d211af3b xous: begin adding a create_process() call
This will mimic the `create_thread()` call and will obviate our own
process-creation code.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-26 10:54:54 +08:00
Sean Cross
ca73e8a8dd kernel: test: ensure environment variables are cleared
These interfere with the test.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-23 17:55:48 +08:00
Sean Cross
8242f1b53f kernel: make server IDs 128 bits
This makes server IDs a full 128 bits, and changes the argument to
CreateServer from 32-bits to 128-bits.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-21 17:28:18 +08:00
Sean Cross
4130ce7bd1 kernel: fix threading and multiplexing issues
Connections weren't getting multiplexed correctly. As a result, they
would respond with the wrong message to a given thread.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-21 15:51:51 +08:00
Sean Cross
d84fd73cfa kernel: rename mod files for IDE support
If these files are called `mod.rs`, the IDE interface gets really
confusing.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-21 10:14:43 +08:00
Sean Cross
b1a41978ba shutdown: add shutdown syscall
This will be used during testing to shutdown the kernel once it's
finished.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-23 13:58:15 +08:00
Sean Cross
723529ba20 wip: working on getting message passing working
The goal is to get a basic message passing engine working that will also
function as a device that works on real hardware.

This is still reworking it to function correctly on a desktop system.
Once that is working, it will be reworked to function once again on
hardware.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-15 18:13:10 +08:00
Sean Cross
f50ec67553 initial commit
This pulls together many disparate repositories into one xous-core
repository.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-10 12:13:05 +08:00