Chap8 Devices and UDEV Flashcards
udev
device manager for discovering hardware and peripheral devices both during system boot, and later when they are connected to the system.
- It is the successor of devfs and hotplug.
device nodes
created automatically and then used by apps and o/s subsystems to communicate with and transfer data to and from devices
Character (‘c’) Device
Driver communicates by sending and receiving single characters (bytes, octes) IE. serial ports, sound cards
Block (‘b’) Device
Driver communicates by sending entire blocks of data IE. hard disks, USB cameras
Character and Block devices have filesystem entries associated with them; which devices do not?
Network devices.
These devices work by transmitting and receiving packets, which must be constructed by breaking up streams of data and reassembled
device driver
may manage multiple device nodes, which are normally placed in the /dev directory.
Major and Minor
numbers identify the driver associated with the device. 179 = major 0,1,2=minor
ryan@s6261-pi3:/lib/modules$ ls -l /dev/mmcblk0*
brw-rw—- 1 root disk 179, 0 Feb 11 2016 /dev/mmcblk0
brw-rw—- 1 root disk 179, 1 Feb 11 2016 /dev/mmcblk0p1
brw-rw—- 1 root disk 179, 2 Feb 11 2016 /dev/mmcblk0p2
The minor number is used only by the device driver to differentiate between the different devices it my control. IE. 1 and 2 HDD partition
The u in udev stands for?
user, and indicates that most of the work of creating, removing, and modifying device nodes is done in user-space
Persistent Device Naming?
names need not depend on the order of device connection or plugging in. Controlled by udev rules
library which allows access to information about the devices?
libudev
2 daemons that manages the /dev directory?
udevd
systemd-udevd
utility for control and diagnostics?
udevadm
/etc/udev/udev.conf
the main config file contains information such as where to place device nodes, default permissions and ownership. (Mostly empty file on new systems)
/etc/udev/rules.d
rules directory for device naming. IE. 30-usb.rules
udevadm info command to check HDD
$ sudo udevadm info /dev/sda