mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
test-spawn: move into services
Move the `test-spawn` program into `services` and document it better. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
1c5fa8315d
commit
bf6e5a0fef
10 changed files with 34 additions and 33 deletions
|
|
@ -94,8 +94,8 @@ members = [
|
|||
"services/libstd-test",
|
||||
"services/ffi-test",
|
||||
"services/tts",
|
||||
"test-spawn",
|
||||
"spawn",
|
||||
"services/test-spawn",
|
||||
"services/test-spawn/spawn",
|
||||
"kernel",
|
||||
"loader",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
xous = {path = "../xous-rs" }
|
||||
xous = {path = "../../xous-rs" }
|
||||
31
services/test-spawn/spawn/README.md
Normal file
31
services/test-spawn/spawn/README.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Spawn a process
|
||||
|
||||
This crate represents an initial program that will run when a process
|
||||
starts up. It will listen on a Server and take orders from the parent
|
||||
process to finish setting itself up.
|
||||
|
||||
## Initialization
|
||||
|
||||
The process starts with a stack and a text section but no heap, BSS,
|
||||
or data section. The entrypoint looks like this:
|
||||
|
||||
```rust
|
||||
pub extern "C" init(a1: u32, a2: u32, a3: u32, a4: u32) -> ! {
|
||||
let sid = xous::SID::from_u32(a1, a2, a3, a4);
|
||||
loop {}
|
||||
}
|
||||
```
|
||||
|
||||
This process is responsible for performing its own bootstrapping (i.e. allocating/initializing
|
||||
.data and .bss), after which it should accept messages on the connection and copy data as necessary.
|
||||
|
||||
## API
|
||||
|
||||
The following messages are supported:
|
||||
|
||||
| Mnemonic | Opcode | Type | Description |
|
||||
| ---------------- | ------ | ---- | -------------------------------------------------------------------------------------------------------- |
|
||||
| WriteMemory | 1 | M | Write memory into an area of memory. The `Offset` field is used to determine where the block will start. |
|
||||
| WriteArgs | 2 | M | Reserved |
|
||||
| WriteEnvironment | 3 | M | Reserved |
|
||||
| FinishSetup | 255 | * | Terminate the loop, shutdown the server, and start the program. |
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
# Spawn a process
|
||||
|
||||
This crate represents the initial program that will run when a process
|
||||
starts up. It will listen on a Server and take orders from the parent
|
||||
process to finish setting itself up.
|
||||
|
||||
## Initialization
|
||||
|
||||
The process starts with a stack and a text section but no heap, BSS,
|
||||
or data section. The entrypoint looks like this:
|
||||
|
||||
```rust
|
||||
pub extern "C" init(connection: xous::CID) -> ! {
|
||||
loop {}
|
||||
}
|
||||
```
|
||||
|
||||
This process is responsible for performing its own bootstrapping, after
|
||||
which it should accept messages on the connection and copy data as necessary.
|
||||
|
||||
## API
|
||||
|
||||
The following messages are supported:
|
||||
|
||||
Mnemonic | Opcode | Type | Description
|
||||
--- | ----- | ---- | ----
|
||||
WriteMemory|1| M | Write memory into an area of memory. The `Offset` field is used to determine where the block will start.
|
||||
WriteArgs | 2 | M | Reserved
|
||||
WriteEnvironment | 3 | M | Reserved
|
||||
FinishSetup | 255 | * | Terminate the loop, shutdown the server, and start the program.
|
||||
Loading…
Reference in a new issue