|
ginnOS
The reference: libc, the libraries and the kernel
|
a read-only filesystem that shows kernel state as text. More...
#include "procfs.h"#include "common/div64.h"#include "common/memory.h"#include "common/stdio.h"#include "common/string.h"#include "kernel/errno.h"#include "kernel/fs/block_cache.h"#include "drivers/pci/pci.h"#include "drivers/pci/pci_irq.h"#include "arch/arch_cpu.h"#include "kernel/audio/audio.h"#include "kernel/cpu/cpu.h"#include "kernel/memory/heap.h"#include "kernel/memory/pmm.h"#include "kernel/process/process.h"#include "kernel/sync/mutex.h"#include "kernel/time/timer.h"#include "kernel/net/netif.h"#include "kernel/vfs/stat.h"#include "kernel/vfs/vfs.h"Macros | |
| #define | PROCFS_TEXT_MAX 8192 |
| #define | PROCFS_PIDS_MAX PROCESS_MAX |
| #define | ROOT_FILE_COUNT 10 |
| #define | FORMAT(...) |
Enumerations | |
| enum | node_kind_t { NODE_ROOT , NODE_PID_DIR , NODE_TEXT } |
Functions | |
| kerr_t | procfs_mount (fs_mount_t *mount) |
| set up procfs on a mount. | |
a read-only filesystem that shows kernel state as text.
/proc/meminfo physical memory and kernel heap use /proc/uptime seconds since boot /proc/pci the PCI functions (drivers/pci) /proc/interrupts the device interrupts and their counts /proc/audio the sound device and its counters /proc/net the network interfaces and their counters /proc/cpuinfo the cores that run /proc/stat the time of each core: user, nice, system, idle /proc/<pid>/status a process's name, state, parent and resources /proc/self the calling process's directory
a file's text is made when the file is opened and kept with the open file, so a reader sees one consistent snapshot.
| #define PROCFS_TEXT_MAX 8192 |
| #define PROCFS_PIDS_MAX PROCESS_MAX |
| #define ROOT_FILE_COUNT 10 |
| #define FORMAT | ( | ... | ) |
| enum node_kind_t |
| kerr_t procfs_mount | ( | fs_mount_t * | mount | ) |
set up procfs on a mount.
hand it to vfs_mount afterwards.
| mount | filesystem mount object to initialize. |