|
ginnOS
The reference: libc, the libraries and the kernel
|
a small read-only pseudo-filesystem that surfaces the device registry. More...
Go to the source code of this file.
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. | |
a small read-only pseudo-filesystem that surfaces the device registry.
devfs has no backing block device: its "files" are the devices registered in the kernel device model (see src/kernel/device/device.h). mounting it at "/dev" makes ls /dev enumerate registered devices (fb0, tty0, hda, ...) and lets a program open a device node like "/dev/fb0" by name.
it is deliberately minimal for now: the directory listing and opening a node by name work; byte read/write and ioctl/mmap on a node are added per device family (the Linux-style /dev/fb0 fbdev is the first, see framebuffer-plan.md). the namespace is flat (no sub-directories) and read-only (no create/remove).
| 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. |