Thursday, April 24, 2014

[OSDI] Major and Minor Number for Device Nodes

As we all know, we operate the devices as a file under linux. And the files are listed under /dev, such as /dev/sda, /dev/ram0, etc. However, in OSDI course, the instructor mentioned that the name, sda, ram0, etc, is only for human to read. And, for the machine, we are having a major and a minor number for each device. How they are converted is as below (it's one-to-one conversion):

Reference