O'Reilly logo

Building Embedded Linux Systems by Karim Yaghmour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Device Files

Following Unix tradition, every object in a Linux system is visible as a file, including devices.[5] All the device files (a.k.a. device "nodes") in a Linux root filesystem are located in the /dev directory. Most workstation and server distributions come packaged with a /dev directory containing more than 2,000 entries to account for all the possible system variations. Because embedded Linux systems are custom built, there is no need to fill the target's /dev directory with as many entries as a Linux workstation or server. Only the entries required for the system's proper operation should be created.

Identifying which entries you need can be difficult if you don't have the required information. If you choose to use devfs instead of creating fixed static device entries, you will avoid having to look for the device information. Devfs has not been widely adopted, however, and static device entries are still the norm.

The official source of information for static device major and minor numbers is the Documentation/devices.txt file in the kernel sources. You can consult this file whenever you are uncertain about the name or numbering of a certain device.

Table 6-3 lists the most basic entries you will need in your /dev directory. Depending on your particular setup, you will probably need to add a few extra entries. In some cases, you may even need to use entries other than the ones listed below. On some systems, for example, the first serial port is not ttyS0. Such is the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required