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
0fae191651
examples: shell: get building in a hosted env
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-03 11:02:44 +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
d4db20e516
kernel: add preemptive multitasking
...
This is still a work in progress, but we now can have multiple processes
running at once.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-06 15:52:07 +08:00
Sean Cross
aec047b944
loader: add test for minielf spanning a page
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-06 15:34:18 +08:00
Sean Cross
73ad16d367
loader: fix loading when init spans pages
...
Due to an issue withow MiniELF files were loaded, one page was mapped to
two addresses rather than having two adjacent addresses mapped. This
occurred when a small section spanned two pages.
This has now been corrected, and an additional test binary will be added
to demonstrate the issue.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-06 15:29:37 +08:00
Sean Cross
a1c88b4ffd
kernel: remove old code at top of syscall::handle
...
This was pseudocode from back before we had a better idea of how
everything would be laid out.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-06 10:44:41 +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
fd5cc8a1f0
kernel: implement mutable borrows
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-03 14:23:49 +08:00
Sean Cross
48717d3870
kernel: return a MessageResult after sending a message
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-03 14:23:15 +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
ed977fd564
kernel: initial work to support lending pages
...
This lays groundwork to support lending pages from one process to
another, and to restore permissions when pages are handed back.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-02 17:40:14 +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
834c637783
examples: go to sleep when we panic
...
This prevents this process from constantly hogging the CPU.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-01 13:20:31 +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
94459c8d43
examples: add log strings
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-31 18:37:40 +08:00
Sean Cross
a947d7fd79
kernel: clean up most warnings
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-31 18:37:19 +08:00
Sean Cross
b61f1518d0
kernel: syscall: implement UnmapMemory
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-31 18:37:08 +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
f56b5e969d
server: use CtxID type instead of usize
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-30 12:35:50 +08:00
Sean Cross
9367905e6f
kernel: services: don't resume sleeping processes after irq
...
After an IRQ occurs, check to see if there are any available threads.
If there are none, put the process back to sleep.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-27 17:05:37 +08:00
Sean Cross
263e57d4aa
kernel: disable lots of debug output
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-27 16:59:46 +08:00
Sean Cross
6b729d9ebc
kernel: services: resume correct context after interrupt
...
We were resuming the wrong context after returning from an interrupt.
This resulted in us resuming context 3 more often than not.
This now properly banks the current process context prior to the switch.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-27 16:58:04 +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
da2036a182
kernel: services: minor documentation improvements
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-27 16:22:17 +08:00
Sean Cross
cfe7c4a3bc
kernel: irq: take() previous process pair
...
This prevents us from continuously resuming the same task
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-27 16:21:46 +08:00
Sean Cross
beea92ddab
kernel: fix context id assignment
...
previously, we were assigning the trap context as a valid ID. This is
not valid, and causes many problems.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-27 15:58:59 +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
2ba9f69015
kernel: fix build error in main.rs
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-25 14:09:17 +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
a723fb6a02
kernel: reflow multiple files' comments
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-25 14:07:46 +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
fa22d9bad8
kernel: fix isr context handling
...
We were loading both the context and the banked context, which resulted
in an invalid context being selected. This caused a cascading failure.
Load only the lower halfword in order to correctly enter the interrupt
context.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-24 15:24:19 +08:00
Sean Cross
fb01359821
server: fix Connect() call
...
This fixes the index in the Connect() call, so that clients can now
Connect to servers that exist.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-24 14:52:25 +08:00
Sean Cross
e298f125c9
kernel: rework server structures
...
They are now inverted and mvoed into their own file.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-24 14:13:11 +08:00
Sean Cross
484e21fd30
messaging: more work on transferring messages
...
Still need to work on passing messages.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-23 16:56:56 +08:00
Sean Cross
569a4196de
kernel: return a Result from syscall::handle
...
This will simplify error handling.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-23 14:07:54 +08:00
Sean Cross
f32596570f
services: don't map messaging region to userspace
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-23 12:59:48 +08:00
Sean Cross
fb69426f28
kernel: riscv: print "SYSTEM HALT" when halting system
...
This minor patch helps me remember that these errors are fatal.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-23 12:59:09 +08:00
Sean Cross
0be1b8b94c
kernel: mem: don't unilaterally hand memory to userspace
...
If it's needed for use in the kernel, don't hand it over.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-23 12:58:13 +08:00
Sean Cross
a31c4722fa
kernel: add space for message reply pointer
...
With this, we now have enough space to store the return context
information for when `message_reply()` is called.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-23 09:10:19 +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
33162a1c1f
services: implement basics of ReceiveMessage
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-20 17:21:34 +08:00
Sean Cross
8b54ebff35
examples: the beginnings of message passing and receiving
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-19 17:26:16 +08:00