- strip out gdb-stub. Per xobs, the feature never worked, and it
depends upon a branch of a git repo which is not allowed by crates.io
Since the feature hasn't been developed, and crates.io will not
allow even an optional feature that points to a git repo, the feature
was stripped out.
- rename "kernel" to "xous-kernel", so that we can live in a crates.io
package namespace that is specific to Xous.
still have to figure out the riscv package issue.
Hosted mode spawns processes very differently, and this difference was
not reflected after changes were made to native mode.
Signed-off-by: Sean Cross <sean@xobs.io>
Implement a functioning CreateProcess syscall on riscv. This call
creates a server in the child process, and connects the server to the
parent. The parent can communicate with the child process using this
server.
The Server ID is passed as four `u32` values to the entrypoint function.
This can be reassembled into something that can then be passed to the
`ReceiveMessage` syscall.
Signed-off-by: Sean Cross <sean@xobs.io>
We now us `ProcessStartup` as the return type. This builds in tset
mode, hosted mode, and RISC-V mode.
Process Startup is still not implemented for RISC-V mode.
Signed-off-by: Sean Cross <sean@xobs.io>
Turns out we didn't end up needing this capability, so, commenting it
out because it is a shy too powerful and is like packing a live
mortar shell in a storage unit: eventually, someone is going to
get hurt, even though it seems mostly harmless at the moment.
Code just commented out in case we need this feature in the future,
but, the main reason it was asked for (the PDDB) was accomplished
without it.
Correctly handle transitions to and from exception handling.
Previously, the thread ID was incorrectly set such that the exception
handler became a valid thread. This has been adjusted so that the
exception handler is no longer considered a thread, and all other
threads will cease scheduling during this process.
Signed-off-by: Sean Cross <sean@xobs.io>
If a process is currently running, it needs to be placed into the
`Debug` state rather than the `Ready` state.
Additionally, the process that's being switched to must enter the
`Running` state.
Signed-off-by: Sean Cross <sean@xobs.io>
Previously, we were creating a stack beginning at the initial page,
and then growing it upwards. The correct behavior is to begin it at
the top and grow it downwards.
In order to do this, subtract the size of the stack from the initial
pointer.
Signed-off-by: Sean Cross <sean@xobs.io>
Since `MemoryRange::new()` is now unsafe, add an `unsafe {}` note when
calling this function on Hosted mode.
This fixes the build.
Signed-off-by: Sean Cross <sean@xobs.io>
This function allows for creating arbitrary memory ranges. Mark this
function as `unsafe` in order to warn users that this can be used to
create invalid memory regions.
Signed-off-by: Sean Cross <sean@xobs.io>
This enables processes to be "suspended" by going into a Debug state.
Messages will back up and processes will continue to be scheduled around
the suspended process, while the system will continue to operate.
Signed-off-by: Sean Cross <sean@xobs.io>
When a process is terminated, we disconnect it from all other processes.
We also need to free the slot in the server table.
Signed-off-by: Sean Cross <sean@xobs.io>
When the kernel is processing an interrupt, use the exception stack.
This ensures that the kernel interrupt handler can switch processes
without having its stack go away.
This is used for debug information.
Signed-off-by: Sean Cross <sean@xobs.io>
Due to several errors, multi-page lending did not work properly.
To begin with, if a page was not allocated then it would not be able to
be sent. That is, if you allocated 8192 bytes but only ever accessed the
first 4096 bytes, then an error would be encountered when lending the
unaccessed upper page.
Furthermore, due to a striding error in accessing pointers, half-pages
were treated as full pages.
Signed-off-by: Sean Cross <sean@xobs.io>
This brings intra-process lending in-line with intra-process sending,
where memory is not remapped the pointer is simply reused.
We may change this at a later point in order to further enforce the
concept of lent-memory-is-inaccessible, so do not rely in this behavior.
Signed-off-by: Sean Cross <sean@xobs.io>
This implements a syscall to shut down a server. Servers may not be shut
down if they have outstanding messages that they have seen but not
responded to.
Signed-off-by: Sean Cross <sean@xobs.io>
When moving memory between processes, update the owner of that page to
match the new PID. Otherwise, memory can never be released.
Signed-off-by: Sean Cross <sean@xobs.io>
The `current_thread` variable is used to determine which thread to
switch back to after a context switch occurs. Keep track of the thread
more closely.
Signed-off-by: Sean Cross <sean@xobs.io>