- 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.
this will help speed up performance profiling as we can
resolve the physical address of the performance buffer allocated
in RAM and use a USB command to read it out, instead of streaming
it over serial.
Instead of passing a constructed mutable ref from the pagetable entry,
pass a raw pointer and use `read_volatile()` / `write_volatile(x)` on
this pointer.
This should remove a little bit of UB from the kernel.
Signed-off-by: Sean Cross <sean@xobs.io>
Previously, the kernel would dutifully try to map memory that was in the
kernel space. It did this by investigating the kernel memory offset,
which immediately causes a double-fault.
Check to make sure a userspace process is not trying to map kernel
memory before checking the valid page.
Signed-off-by: Sean Cross <sean@xobs.io>
Implement the syscall to adjust a process' limit. Currently this
only supports adjusting the heap maximum and the heap size.
In order to adjust a limit, you must first present the current limit.
This can be obtained by requesting a bogus value. The current limit is
returned as part of the result.
Signed-off-by: Sean Cross <sean@xobs.io>
Return the heap size and offset when decreasing the heap. Additionally,
return the heap size when increasing the heap by 0 bytes.
Signed-off-by: Sean Cross <sean@xobs.io>
this contains a dependency to `failure` two levels down that has a critical
vulnerability. Unfortunately no new versions of debug-here have been
published in a while. It's no longer used, so just stripping it out
altogether.
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>
Unmap the pages from the child process after we're done setting them up.
This ensures they're not still aliased by our process, despite being
marked as "owned" by the other process.
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>
Memory is on-demand allocated, meaning it's entirely possible to
allocate and free memory without ever touching physical pages.
Previously, when we attempted to free memory, it would skip over pages
that were never backed by real memory.
With this patch, we continue to free the virtual page even if there is
no associated physical page.
Signed-off-by: Sean Cross <sean@xobs.io>
Memory is on-demand allocated, meaning it's entirely possible to
allocate and free memory without ever touching physical pages.
Previously, when we attempted to free memory, it would skip over pages
that were never backed by real memory.
With this patch, we continue to free the virtual page even if there is
no associated physical page.
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>
If a process fails for some reason (e.g. by performing a fault) and
there is no exception handler, either terminate the process or (if
gdbserver is enabled) have it suspend the process.
Signed-off-by: Sean Cross <sean@xobs.io>