From b2920331b103d43793ac8be927a80a593ce0be5a Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Sat, 17 Oct 2026 16:21:55 -0400 Subject: add pcb stop syscall and scheduler dequeueing --- doc/syscall.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'doc') diff --git a/doc/syscall.md b/doc/syscall.md index 10f8eb5..6d7583f 100644 --- a/doc/syscall.md +++ b/doc/syscall.md @@ -377,6 +377,7 @@ Successful unmapping returns `0`. | SYSCALL_PCB_RECV | JOVE_PERM_MUTATE | JOVE_PERM_MUTATE | | SYSCALL_PCB_SWAP | JOVE_PERM_MUTATE | JOVE_PERM_MUTATE | | SYSCALL_PCB_STACK | JOVE_PERM_WRITE, JOVE_PERM_MUTATE | JOVE_PERM_WRITE, JOVE_PERM_MUTATE | +| SYSCALL_PCB_STOP | JOVE_PERM_WRITE, JOVE_PERM_MUTATE | | #### SYSCALL_PCB_YIELD @@ -490,6 +491,42 @@ If the PCB already has a stack of the specified type, the kernel will return `-E Successful operation returns `0`. +#### SYSCALL_PCB_READY + +Adds the target PCB to the ready queue, and sets the state to `PCB_STATE_READY`. + +If the target PCB is not in the `PCB_STATE_EMBRYO` state, the kernel will return `-EBADCALL`. + +If the target PCB does not have a system and interrupt stack, the kernel will return `-ENOTREADY`. + +If the target PCB is not in entry `PCB_ROOTDIR_SELF_I`, the kernel will return `-EBADPATH`. + +If the root directory of the target PCB does not have a `JOVE_OBJ_PAGEDIR` object at `PCB_ROOTDIR_PAGEDIR_I`, the kernel will return `-EBADPATH`. + +Successful calls return `0`. + +#### SYSCALL_PCB_STOP + +Removes the targeted PCB from the scheduler queue, sets the state to `PCB_STATE_STOPPED`, and sets the state code to the passed value. + +| Data | State Code | +|--------------|-------------| +| Size (bytes) | sizeof(int) | + +If the target PCB is not in the `PCB_STATE_READY` or `PCB_STATE_RUNNING` state, the kernel will return `-EBADCALL`. + +If the target PCB is not the current PCB, successful call will return `0`. + +Otherwise, the PCB will yield to the next process determined by the scheduler. + + +#### SYSCALL_PCB_STATE + +Gets the state code of the target PCB object. + +If the target PCB is not in the `PCB_STATE_STOPPED` state, the kernel will return `-ENOTDONE`. + + ### JOVE_OBJ_INITRD_FILE | Syscall | Target Permissions | -- cgit v1.2.3