7

If /dev is suppose to list all the devices that is connected, like usb, hdd, webcam, how come on my ubuntu 15 VM I don't see a monitor? I am running the desktop edition so there should be a monitor.

Or maybe it is named something different?

  • May be the OS does not communicate with the monitor? – Sree May 22 '15 at 3:47
  • 1
    Some physical devices need an interface in the filesystem, others don't. Network cards don't have corresponding entries in /dev either. – lcd047 May 22 '15 at 4:00
  • how could the OS not communicate with the monitor? how else does it display anything? – D.Zou May 22 '15 at 4:13
  • 1
    Mostly, the OS communicates with the graphics card, and the graphics card communicates with the monitor. – Gilles May 22 '15 at 21:12
10

Device files on Unix systems in general are just one way for user programs to access device drivers; there isn't a one-to-one mapping from devices files to physical hardware, and not all hardware has a device file (or even a device driver). The kernel itself doesn't use device files to interact with hardware.

As pointed out by lcd047, network cards don't have device files at all. Programs interact with the network using APIs, e.g. the BSD socket API; even ethtool uses a socket and ioctl() to manipulate the network interface.

So when determining whether your monitor has a device file, it's useful to think of the ways programs interact with it. There aren't many tools which interact directly with a monitor... Programs display information on a monitor via a graphics card, and that does have device files: /dev/dri/*, /dev/fb* etc. But that's not the monitor. The only programs I know of which interact with a monitor directly are backlight control programs and ddccontrol; the former generally use ACPI or laptop-specific devices (so the monitor's backlight is just a part of the system's power-usage model), and ddccontrol uses the I²C bus whose devices appear as /dev/i2c-* once the i2c-dev module is loaded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.