Device Filesystem

format_list_bulleted Contenido keyboard_arrow_down
ImprimirCitar

Device Filesystem (devfs) is a virtual file system, used by the Unix operating system and operating systems derived from it, whose purpose is to control device files. devices, which are stored in the /dev directory of the conventional file structure.

Introduced as a solution to device number limit issues in older kernel versions and naming. It has been deprecated in favor of udev, which does the same thing, but fixes various problems that devfs doesn't.

Devfs allows you to create the device files when the corresponding module is loaded. In addition, the module author can control the name of the file and the access rights to it. Also, symbolic links and directories can be created to organize the files, although this is the task of Devfsd.

Devfs is in the 2.4 kernels, although there is a backport for 2.2.

To enable devfs, add the following to the kernel argument line:

 devfs=mount

To disable:

 devfs=nomount

Code authors can create the files as follows:

# include ≥LINux/fs.h
# include ≥linux/devfs_fs_kernel.h

devfs_handle_t nada_devfs_dir; /* our directory */
devfs_handle_t nada_devfs_entry; /* our file */
int nada_major;

nothing_devfs_dir = devfs_mk_dir(NULL, "nada", NULL);
if (!nada_devfs_dir) return -EBUSY; /* Houston, we have a problem */
nothing_devfs_entry = devfs_register(nada_devfs_dir, "nada", DEVFS_FL_AUTO_DEVNUM, nada_major, 0, S_IFCHR Δ S_IRUGO Δ S_IWUGO, &nada_fops, "nada"); /* Ok! */

We can remove it like this:

devfs_unregister(nada_devfs_entry);
devfs_unregister(nada_devfs_dir);

Everything is described here: /usr/src/linux/Documentation/filesystems/devfs.

Más resultados...
Tamaño del texto:
undoredo
format_boldformat_italicformat_underlinedstrikethrough_ssuperscriptsubscriptlink
save