From: Thadeu Lima de Souza Cascardo Date: Sun, 16 May 2010 18:56:51 +0000 (-0300) Subject: Imported more from last LDD course. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fkernel%2Fslides%2F.git;a=commitdiff_plain;h=4f1d1ad6fa03ac3a627aae2844a4b5627d5bf711 Imported more from last LDD course. --- diff --git a/04char/chrdev b/04char/chrdev index 5b6f7e9..e66490f 100644 --- a/04char/chrdev +++ b/04char/chrdev @@ -39,3 +39,51 @@ calls to do that for character devices are: * int alloc\\_chrdev\\_region (dev\\_t *dev, unsigned int firstminor, unsigned int count, char *name); * void unregister\\_chrdev\\_region (dev\\_t dev, unsigned int count); + + + + +# VFS + +# Introduction + +The virtual file system is the hub for almost all operations in a Linux-based +system. It allows IPC with pipes, access to devices, including storage through +regular files and organization with directories. + +# Everything is a file + +In Unix, there's a say: "everything is a file, if it's not a file, it's a +process". Well, most things are really files, and that's why the VFS is at the +center of the system, including for device drivers. + +# Special files, procfs and others + +When handling with special files (character and block device nodes), procfs +files and others, we'll use some common structures. These include the +*struct file\\_operations*, *struct file* and *struct inode*. + +# File Operations + +* open +* release +* read +* write +* ioctl +* llseek +* poll +* mmap +* many others + +# Opened File + +* f\\_mode +* f\\_flags +* f\\_pos +* f\\_op +* private\\_data + +# Filesystem File: inode + +The inode is a representation of the file as in its filesystem, including its +major/minor numbers and pointers to the corresponding device representation.