The Linux Programming Interface
File Systems
(01)主要内容
The majority of this chapter is concern with file systems, which are organized collections of files and directories.
(02)设备解释,有必要的驱动,统一的接口,供上层调用。
A device special file corresponds to a device on the system. Within the kernel, each device type has a corresponding device driver, which handles all I/O requests for the device.
A device driver is an unit of kernel code that implements a set of operations that (normally) correspond to input and output actions on an associated piece of hardware.
The API provides a consistent interface, hiding the differences in operation of individual devices, allows for universality of I/O.
(03) /dev目录
Device files appear within the file system, just like other files, usually under the /dev directory.
The superuser can create a device file using the mknod command.
(04)设备ID
Each device file has a major ID number and a minor ID number.
The major ID identifies the general class of device, and is used by the kernel to look up the appropriate driver for this type of device.
(05)磁盘和分区
A hard disk drive is a mechanical device consisting of one or more platters that rotate at high speed.
Each disk is divided into one or more partitions.