Device Filesystem

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.

Contenido relacionado

GNU Project

The GNU project is a collaborative free software project with the goal of creating a completely free operating system: the GNU system. It was announced by...

Liero

Liero is a DOS computer game created by Finnish programmer Joosa Riekkinen in 1998. It is often compared to the strategy game Worms, although it works real...

Commodore Amiga

The Commodore Amiga was a personal computer marketed by Commodore International between 1985 and 1994. It was designed by Jay Glenn Miner and a small team of...
Más resultados...
Tamaño del texto:
Copiar