|
miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
|
#include <miniOS/fs/procfs.h>#include <miniOS/fs/vfs.h>#include <miniOS/mm/pmm.h>#include <miniOS/mm/vmm.h>#include <miniOS/sched/sched.h>#include <miniOS/io.h>#include <string.h>
Macros | |
| #define | PROCFS_INO_ROOT 1 |
| #define | PROCFS_INO_MEMINFO 2 |
| #define | PROCFS_INO_MOUNTS 3 |
| #define | PROCFS_INO_STAT 4 |
| #define | PROCFS_PID_BASE 0x1000u |
| #define | PROCFS_PID_SHIFT 3u |
| #define | PROCFS_SUB_MASK ((1u << PROCFS_PID_SHIFT) - 1u) |
| #define | PROCFS_SUB_DIR 0u |
| #define | PROCFS_SUB_STATUS 1u |
| #define | PROCFS_SUB_STAT 2u |
| #define | PROCFS_SUB_CMDLINE 3u |
| #define | PROCFS_SUB_CWD 4u |
| #define | PROCFS_SUB_MAPS 5u |
Functions | |
| static uint32_t | procfs_pid_ino (uint32_t pid, uint32_t sub) |
| static int | procfs_ino_is_pid (uint32_t ino) |
| static uint32_t | procfs_ino_pid (uint32_t ino) |
| static uint32_t | procfs_ino_sub (uint32_t ino) |
| static struct thread * | procfs_find_thread (uint32_t pid) |
| static int | procfs_generate_mounts (char *buf, uint32_t bufsiz) |
| static int | procfs_generate_meminfo (char *buf, uint32_t bufsiz) |
| static int | procfs_generate_stat_global (char *buf, uint32_t bufsiz) |
| static char | procfs_state_char (thread_state_t s) |
| static const char * | procfs_state_str (thread_state_t s) |
| static int | procfs_generate_status (struct thread *t, char *buf, uint32_t bufsiz) |
| static int | procfs_generate_stat (struct thread *t, char *buf, uint32_t bufsiz) |
| static int | procfs_generate_cmdline (struct thread *t, char *buf, uint32_t bufsiz) |
| static int | procfs_generate_cwd (struct thread *t, char *buf, uint32_t bufsiz) |
| static int | procfs_generate_maps (struct thread *t, char *buf, uint32_t bufsiz) |
| static int | procfs_lookup (const char *path, vfs_inode_info_t *out) |
| static int | procfs_read (uint32_t ino, uint64_t off, void *buf, uint32_t len) |
| static int | procfs_readdir (uint32_t ino, uint64_t *offset, vfs_dirent_cb_t cb, void *ud) |
| static int | procfs_statfs (vfs_statfs_t *out) |
| static int | procfs_unlink (uint32_t parent_ino, const char *name) |
| static int | procfs_rmdir (uint32_t parent_ino, const char *name) |
| static int | procfs_mount (const char *source, const char *target, const void *data) |
| void | procfs_init (void) |
Variables | |
| static vfs_ops_t | procfs_ops |
| #define PROCFS_INO_MEMINFO 2 |
| #define PROCFS_INO_MOUNTS 3 |
| #define PROCFS_INO_ROOT 1 |
| #define PROCFS_INO_STAT 4 |
| #define PROCFS_PID_BASE 0x1000u |
| #define PROCFS_PID_SHIFT 3u |
| #define PROCFS_SUB_CMDLINE 3u |
| #define PROCFS_SUB_CWD 4u |
| #define PROCFS_SUB_DIR 0u |
| #define PROCFS_SUB_MAPS 5u |
| #define PROCFS_SUB_MASK ((1u << PROCFS_PID_SHIFT) - 1u) |
| #define PROCFS_SUB_STAT 2u |
| #define PROCFS_SUB_STATUS 1u |








|
static |


|
static |




|
static |




| void procfs_init | ( | void | ) |


|
static |






|
static |


|
static |






|
static |


|
static |


|
static |


|
static |


|
static |


|
static |


|
static |