Commit graph

45 commits

Author SHA1 Message Date
bunnie
f9fc3d0d4b ok, format the kernel now that all in-line assembly has been checked 2024-01-14 19:27:14 +08:00
bunnie
710c45969f Revert "format the kernel"
This reverts commit 1f69e6aa39.

this has in-line assembly, let's fix that before we format
2024-01-14 19:24:33 +08:00
bunnie
1f69e6aa39 format the kernel 2024-01-14 19:11:19 +08:00
bunnie
4561336ebd try to fix the CI test routine 2022-01-10 19:03:20 +08:00
bunnie
19f95e6bab fix kernel test build 2022-01-08 01:00:20 +08:00
bunnie
dd14dfc4c6 retrofit the seed into an atomicu64 so we can set it elsewhere 2021-12-27 02:49:08 +08:00
bunnie
0bd110c163 determinism achieved for testing. now to squash some bugs. 2021-12-26 01:50:30 +08:00
bunnie
66606ed3e0 initial attempt to make hosted mode more deterministic
replace all threadRng with a seeded Rng
2021-12-25 15:58:27 +08:00
Sean Cross
30b82b25b1 kernel: run cargo fmt
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 14:12:01 +08:00
bunnie
e175d922f0 Merge branch 'hardware' 2021-02-18 02:35:40 +08:00
bunnie
5cdf597a5b fixup tests 2021-02-18 02:35:11 +08:00
Lina Ceballos
d18500f4d6 adding license and copyright headers 2021-01-25 14:54:00 +01:00
Sean Cross
a36ceb00c2 kernel: use crossbeam for tests
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-30 16:51:21 +08:00
Sean Cross
f49518f7d5 kernel: add connect_for_process()
This allows one process to establish a connection to a server on behalf
of another process.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 23:25:41 +08:00
Sean Cross
168ffe004e kernel: use create_server() for some tests
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:59:21 +08:00
Sean Cross
25e4d16de3 xous-os: rename CreateServer to CreateServerWithAddress
Servers will, by default, get randomly-assigned SIDs. Certain servers
will want to have well-known SIDs, such as the log server or the
nameserver. These will use a separate call in order to perform this
priveledged operation.

A subsequent patch will add `CreateServer`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:33:33 +08:00
Sean Cross
d5f82b7972 kernel: test: fix message ordering test
It turns out that it was working fine, the test was just broken.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-01 13:18:49 +08:00
Sean Cross
8c994e0397 kernel: add test for message ordering
Messages are arriving out-of-order, which is considered a bug.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-01 10:29:46 +08:00
Sean Cross
f0db281c7d kernel: add test for try_receive_message()
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-25 20:52:13 +08:00
Sean Cross
f3a2c31067 kernel: add test for out-of-order blockingscalars
This already works, we just want to make sure it works.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-24 15:35:54 +08:00
Sean Cross
dfa20cc1b1 kernel: test: rename send_repeat_mutableborrow_message
This function would previously clash with the other name.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:22:59 +08:00
Sean Cross
657604a199 kernel: test: use as_ptr() for memory messages
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:22:37 +08:00
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