Linux/proc/devices &/dev

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.