In Linux, what is the difference between the content in the/dev/directory and that in the/proc/file devices? I'm
When I did an experiment on the board, I found that when I loaded the driver module to the Board, there were changes in the devices file, and there was no change at all under/dev, shouldn't it be a device connection under/dev/? Why?
When the module establishes a device contact, it does not change under/dev?
Thank you for your help !!!
The devices in/proc/devices/are loaded to the kernel through insmod, which generates a major for mknod
Parameters.
/Dev/*. * is added by mknod. Format: mknod device1 C/B major minor, for example, mknod DR1 C
254 0. You can use this device name to access your driver.
Device
File
, Device # ll-A/dev
The device file and device number (primary and secondary) are displayed in each row)
For each hardware device, the system kernel has a device driver responsible for processing it. In Unix
Device files are used to represent hardware devices, and each device driver is abstracted.
In this way, a consistent file interface is provided for the application to facilitate communication between the application and the operating system.
Traditionally, all Device Files
All placed in/dev
Directory.
The devices in/proc/devices/are loaded to the kernel through insmod, which generates a major for mknod as the parameter.
.
/Dev/*. * is added by mknod. Format: mknod device1 C/B major minor, for example, mknod DR1 C
254 0. You can use this device name to access your driver.
Mknod-Make block or
Character special files
Mknod [Option]... name type [major minor]
Option is-M.
Name Customization
Type has B, c, and P
Master device number
Device No.
Master
The device number is defined by/usr/src/Linux/include/Linux/major. h. A doc device is defined as follows:
# Define
Igel_flash_major 62
Assume that there is a command mknod Doc B 62 0:
The doc is the defined name.
B Indicates the block device, and 0 indicates the entire Doc. If 0 is changed to 1, 1 indicates the first partition of the doc. 2 is 2nd, and so on.