|
ginnOS
The reference: libc, the libraries and the kernel
|
read-only pseudo-filesystem backing the device registry. More...
#include "devfs.h"#include "kernel/errno.h"#include "common/string.h"#include "kernel/device/device.h"#include "kernel/vfs/stat.h"#include "common/memory.h"#include "kernel/tty/pty.h"Macros | |
| #define | PTS_PREFIX "pts/" |
| #define | PTS_PREFIX_LENGTH 4 |
Functions | |
| kerr_t | devfs_mount (fs_mount_t *mount) |
| initialize a mount to be backed by devfs. | |
| struct device * | devfs_device (const fs_file_t *file) |
| the device of an open devfs node. | |
read-only pseudo-filesystem backing the device registry.
implements the fs_ops_t vtable so the generic fs_* layer can dispatch to it exactly like ext2. paths arriving here are already mount-relative (the VFS strips the "/dev" prefix, see vfs_resolve_mount_path): the directory root is "/", and a device node is "/name" (e.g. "/fb0").
state lives in the generic fs_file fields added for non-ext2 filesystems:
| #define PTS_PREFIX "pts/" |
| #define PTS_PREFIX_LENGTH 4 |
| kerr_t devfs_mount | ( | fs_mount_t * | mount | ) |
initialize a mount to be backed by devfs.
unlike fs_mount(), devfs has no block device to probe: it reads the live device registry on demand. after this returns KERR_OK, hand mount to vfs_mount("/dev", mount).
| mount | filesystem mount object to initialize. |