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
cb576c19d5
xous: support taking server addr from environment
...
This allows for setting an environment variable -- `XOUS_SERVER` -- to
indicate which server to connect to.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-23 19:07:13 +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
1a6b1160a3
syscall: move send_message into its own function
...
This breaks up the giant `handle()` function.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-21 09:44:16 +08:00
Sean Cross
42f95e6488
threading: get basic threading tests working
...
With this, we can now run two "threads" within one process.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-16 12:23:09 +08:00
Sean Cross
e2296fceac
ThreadID: rename from CtxID
...
Contexts are now renamed to Threads, which better reflects what they
actually are.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-16 11:04:31 +08:00
Sean Cross
b52847e467
xous-rs: mark Scalar messaages as Clone,Copy
...
They are all scalar values, so there's no reason not to mark them Copy.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-16 10:22:04 +08:00
Sean Cross
1216963d24
rename contexts -> threads and spawn -> create
...
This ensures we're more consistent in naming for these constructs.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-16 10:17:46 +08:00
Sean Cross
62cff0b9c7
xous-rs: add a function call to get current server address
...
This function will assist us in creating calls to spawn processes and
threads.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-16 10:04:17 +08:00
Sean Cross
e652150c6e
kernel: get multiple message passing working
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-15 16:09:42 +08:00
Sean Cross
0ffbaa369a
kernel: fix remaining warnings
...
This just silences them, which isn't great in the long run.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-14 15:16:51 +08:00
Sean Cross
b93abcc926
kernel: test: implement mutable borrow
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-14 15:10:25 +08:00
Sean Cross
d7006e675e
kernel: get send_borrow_message test working
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-14 12:11:57 +08:00
Sean Cross
964b6e0f46
kernel: disable more debug prints
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-14 10:08:49 +08:00
Sean Cross
05d1cf71dc
port: use kernel-assigned port number for tests
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-13 19:57:30 +08:00
Sean Cross
b388d2e1f4
kernel: use SocketAddr instead of &str
...
This is easier to copy around and seems to be more informative.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-13 19:45:29 +08:00
Sean Cross
8f74159674
rename ImmutableBorrow -> Borrow
...
THis is more in-line with Rust conventions.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-13 19:19:25 +08:00
Sean Cross
05ccba9450
kernel: implement move test
...
We can now `Move` memory from one "process" to another.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-13 18:31:51 +08:00
Sean Cross
40ed6365e2
first memory message works
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-13 17:41:50 +08:00
Sean Cross
acf9b049f7
hosted: start working on memory-based message passing
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-12 11:18:26 +08:00
Sean Cross
9f1b1e7ec8
kernel: tests: get both tests working
...
We now have two tests. These tests may be run either in parallel or in series.
If they are run in parallel, then they will each have their own thread
local storage, and each will initialize things from scratch.
If they are run in series, then the thread local storage will be reused
between the two processes.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-25 17:41:17 +08:00
Sean Cross
54a0db50b3
kernel: start using tls
...
This allows us to run multiple kernels in parallel.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-24 17:51:31 +08:00
Sean Cross
04faa898c7
hosted: cutting down on println messages
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-23 16:40:51 +08:00
Sean Cross
e9469991be
test: get initial test passing
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-23 14:42:01 +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
14bb1ac1e5
kernel: working on getting process termination functioning
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-22 17:42:24 +08:00
Sean Cross
9361055aec
kernel: work-in-progress for process termination
...
Processes can go away. This is initial work to support process
termination.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-18 11:39:46 +08:00
Sean Cross
2786ad697b
kernel: get scalar message passing working again
...
This gets basic scalar message passing working again. With this, the
following operations may be performed:
* Starting a server
* Connecting to a server
* Sending a scalar message
Care must be taken to not overflow a server's queue, particularly if
writers are faster than readers.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-16 16:34:49 +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
322e2e7804
xous: remove all instances of raw pointers
...
We now use MemoryAddress and MemorySize wrappers where applicable.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-03 15:40:15 +08:00
Sean Cross
e059494a7f
xous-rs: begin adding support for native message passing
...
This will send data via a TCP connection to simulate making syscalls.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-03 12:06:46 +08:00
Sean Cross
40d4483e4f
clippy: fix several clippy warnings
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-01 11:36:19 +08:00
Sean Cross
1f478925ce
kernel: return context on failure
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-06 10:43:26 +08:00
Sean Cross
3799397be9
xous: dangerous_syscall: mark whole function as unsafe
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-03 15:44:08 +08:00
Sean Cross
8789203eb3
test mutable borrows
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-03 14:24:02 +08:00
Sean Cross
9c5cb3da32
kernel: properly share pages between processes
...
This improves page sharing. Permissions are retained during sharing,
and we should now be able to share multiple pages. Additionally, this
lays the groundwork for mutable sharing.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-03 12:28:44 +08:00
Sean Cross
bedb499edb
kernel: get immutable borrows working
...
We can now pass memory immutably between processes
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-01 17:27:59 +08:00
Sean Cross
d6f985c141
syscall: add call to return memory from a message
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-01 13:21:23 +08:00
Sean Cross
bdb8eac9ad
MemoryRange: move to using this struct for memory ranges
...
This is a combination of MemoryAddress and MemorySize. This is
guaranteed to be not null.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-01 10:28:36 +08:00
Sean Cross
4be5f4031b
xous: add UnmapMemory syscall
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-31 18:36:53 +08:00
Sean Cross
abce9eb0c1
message::move: implement movable messages
...
This is the first implementation of message passing with moving memory.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-31 18:03:19 +08:00
Sean Cross
8c3f931445
messaging: first message passing example
...
THis commit allows us to pass Scalar messages between processes.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-30 16:07:58 +08:00
Sean Cross
405a9227cf
xous: add contextid return value
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-27 16:22:51 +08:00
Sean Cross
d8d0c3838a
xous: add context id and context error
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-27 13:32:41 +08:00
Sean Cross
dafec2bb89
kernel: make contexts first-class
...
Due to an initial misunderstanding of how the RISC-V is architected,
contexts were going to be an emergent property of the kernel.
However, after further consideration, contexts must now be baked into
the kernel. Switching between contexts can be handled by the scheduler,
but the kernel must keep track of processor registers.
Keep track of context IDs and ensure they are sane. With this patch,
interrupts work, as does basic context switching.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-27 12:30:29 +08:00
Sean Cross
97238861a1
xous: syscall: define the return value for SwitchTo
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-25 14:08:13 +08:00
Sean Cross
a05258654c
xous: rename WaitMessage -> ReceiveMessage
...
It might not wait. The name `ReceiveMessage` better reflects the
operation.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-24 15:26:25 +08:00
Sean Cross
537e9da79d
xous: adjust message envelope struct
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-20 17:22:02 +08:00
Sean Cross
646cf9340e
xous: add Connect syscall
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-19 17:26:01 +08:00
Sean Cross
2dd62e50fd
xous: rework definition of message structs
...
Message structs are used to pass memory between processes. Rework how
this struct is laid out so as to better describe this process.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-19 08:52:25 +08:00
Sean Cross
19ddb32d9d
xous: add syscalls for connecting to a server
...
This is required because server IDs are 128 bits, but we only have
enough space for 32 bits in the message.
This is fine, because it means we can drop "Connect" permissions to
prevent compromised clients from making new connections.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-17 13:00:06 +08:00
Sean Cross
d10bc2e894
syscalls: begin adding message-passing syscalls
...
These are still not connected, however their existence is starting to
solidify the API.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-17 10:27:03 +08:00
Sean Cross
1b8f97a5a3
xous-rs: implement create_server call
...
This call isn't properly handled by the kernel, but it's now available
in the standard library.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-16 19:03:51 +08:00
Sean Cross
5a1bcf4c21
xous-rs: implement create_server syscall
...
The kernel doesn't have this wired up yet, but the syscall works.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-14 15:57:58 +08:00
Sean Cross
9508201db9
xous-rs: add claim_interrupt wrapper
...
Rather than calling the raw function, add a wrapper for programs to use.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-14 15:41:44 +08:00
Sean Cross
7a3e038e6b
syscall: add intial CreateServer call
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-13 22:41:25 +08:00
Sean Cross
c2008e5fe8
syscall: implement map_memory wrapper
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-13 20:33:08 +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