Module process_info_driver

Source
Expand description

Allow userspace to inspect and control processes on the board.

§Warning!

This capsule is designed for testing and experimental use cases only. It should not be used in production! It was originally written for use in an educational tutorial to make it easy to interact with processes stored on the board from userspace using a screen.

This capsule does require a capability to also indicate that this interacts with processes in a way that common capsules should not.

§Commands

  • 0: Check driver exists.
  • 1: Get the count of processes running on the board.
  • 2: Fill the allow RW buffer with the process IDs for the running processes on the board. Returns the number of running processes.
  • 3: Fill the allow RW buffer with the short IDs for the running processes on the board. Returns the number of running processes.
  • 4: Put the name of the process specified by the process ID in data1 in the allow RW buffer (as much as will fit). Returns the full length of the process name.
  • 5: Fill the allow RW buffer with the following information for the process specified by the process ID in data1.
    • The number of timeslice expirations.
    • The number of syscalls called.
    • The number of restarts.
    • The current process state (running=0, yielded=1, yieldedfor=2, stopped=3, faulted=4, terminated=5).
  • 6: Change the process state. data1 is the process ID, and data2 is the new state.(1=start, 2=stop, 3=fault, 4=terminate, 5=boot).

Structs§

ProcessInfo

Constants§

DRIVER_NUM