For a device file, the really important mark is its primary and secondary device number (major and minor device numbers). If we use ls Command lists /dev Next device :

frank@under:~$ ls -l /dev/console
crw------- 1 root root 5, 1 Nov 28 11:56 /dev/console

You can see , This is a character device , But in the normal file display size of the place with “5,1” Instead of . among 5 It's this device file major number, and 1 It's its minor number. When we communicate with this device , The kernel loads the corresponding driver through the master device number of the device . When loading the driver, the secondary device number will be passed in as a parameter , How it is interpreted depends on the drive itself . The document corresponding to the driver will usually write how the driver reacts to different secondary device numbers .

Primary and secondary equipment number Device Major and Minor Numbers More articles about

  1. mknod Usage and primary and secondary equipment number 【 turn 】

    from :http://www.cnblogs.com/hnrainll/archive/2011/06/10/2077583.html mknod purpose Create special files . mknod Name { b | ...

  2. linux Primary and secondary equipment number 【 Reprint 】

    A character device or block device has a primary device number and a secondary device number . The master device number and the secondary device number are collectively referred to as set Spare number . The master device number is used to represent a specific driver . The secondary device number is used to indicate each device that uses the driver equipment . For example, an embedded system , There are two LED Indicator light ...

  3. Linux Device driver And Primary and secondary equipment number

    Main equipment number and secondary equipment number Access to character devices is through device names within the file system , These names are called special files . Device file . Or simply called the node of the file system tree , They are usually located in /dev Catalog . The device file of character device driver can be accessed through ls ...

  4. Major and minor numbers

    The major nuber is the driver associated with the device, while the minor number is used by the kern ...

  5. linux Introduction of primary and secondary equipment number

    1. The function of the master device number and the secondary device number stay Linux The kernel , The master device number identifies the driver corresponding to the device , tell Linux Which driver does the kernel use for the device ( That is to say /dev Device files under ) service : The secondary device number is used to identify a specific and unique device ...

  6. linux Introduction of primary and secondary equipment number

    1. The function of the master device number and the secondary device number stay Linux The kernel , The master device number identifies the driver corresponding to the device , tell Linux Which driver does the kernel use for the device ( That is to say /dev Device files under ) service : The secondary device number is used to identify a specific and unique device ...

  7. linux Drive device number

    One . Equipment number Foundation Generally speaking , Use ls -l The number of the command in the first column of the time column represents the file size , But if the file represents a device , The first column in the time column will have two numbers , Separate... With commas , Here's the picture : The previous number represents the master device number , ...

  8. linux Device number assignment

    Reference resources :http://blog.chinaunix.net/uid-24460251-id-2606762.htmlhttp://blog.csdn.net/zjjyliuweijie/article/ ...

  9. C lstat major MAJOR Get the device number

    #cat lstat.c #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #inc ...

Random recommendation

  1. 【BZOJ-4523】 Routing table Trie Trees + fool around with

    4523: [Cqoi2016] Routing table Time Limit: 30 Sec  Memory Limit: 512 MBSubmit: 155  Solved: 98[Submit][Status][ ...

  2. Hive Realization HBase Batch insertion of data

    HBase Data insertion can use Java API To write Java The program is poured in one by one , But it's not very convenient . utilize Hive Bring one with you Jar package , Can be established Hive and HBase The mapping relation of utilize Hive Of insert You can batch ...

  3. The front-end development -Weex First try

    1 Weex Introduce weex It's Ali 2016 Open source's set of cross mobile terminal (Andriod/IOS/Wap) Front-end frame , use VUE, a React Native The introduction is relatively simple Official website address 2 Weex Installation and initialization 2.1 ...

  4. 【gcd+ Mathematical proof 】【HDU1722】 CAKE

    Cake Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submi ...

  5. Vue Way of learning ---No.2( Sharing experience , Welcome criticism and correction )

    Yesterday we learned about Vue Basic knowledge and grammar : Today we continue to work in the big V This way forward . First , Let's recall the relevant knowledge points mentioned yesterday : 1. understand Vue Core concept of ------" Data-driven view " 2. ...

  6. [BZOJ1008] [HNOI2008] Prison break ( mathematics )

    Description The prison has a serial number of 1...N Of N A room , One prisoner in each room , Yes M Religion , Every prisoner may believe in one of them . If the prisoners in the adjacent rooms share the same religion , There could be a prison break , How many states can escape from prison In ...

  7. Python3 practice

    Hello Python3 print("Hello Python!") #print("Hello, Python!"); '''a=1 b=2 c=a+b ...

  8. zabbix Monitor actual combat &lt;3&gt; User defined monitoring instance

    Chapter one     Custom monitoring tcp state The command can choose ss perhaps netstat    ss Printing is based on socket Statistical information , Actually running ,ss It's faster than netstat It's much faster 1.1  tcp Eleven states of ...

  9. ajax Medium contendType and dataType Sort out the knowledge points

    stay ajax There is 2 Two parameters are important , I haven't figured it out before , Now let's start to sort out 1.contentType Field : This field means ,ajax What type of data is sent to the back end If in ajax This property is not specified in , Default is u ...

  10. How to use cacti monitor windwos

    1: Template download address https://github.com/mrlesmithjr/cacti resource \ snmp_queries  To the cacti In the directory corresponding to the server Import template file ( stay te ...