Chapter 23 Flashcards

Dealing with Linux Devices

1
Q

Describe how Linux systems communicate with devices.

A

Linux systems create files in the /dev folder that applications use to send data to devices and retrieve data from devices. Device files can be either character files, which send and receive data one character at a time, or block files, which send and receive data in blocks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain how you would find the hardware settings for a PCI board plugged into the Linux system.

A

The lspci command displays the PCI devices currently connected to the system. You can use that information with the lsdev command, which displays the interrupts, I/O ports, and DMA channels used by each device. You can also find that information in the /proc/interrupts, /proc/ioports, and /proc/dma files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain how Linux can detect hot-pluggable devices.

A

The udev application runs in the background, monitoring the kernel ring buffer for new devices. When a new device is added, the udev application detects it from the kernel ring buffer messages and follows instructions defined in rules contained in the /etc/udev/rules.d directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What type of hardware interface uses interrupts, I/O ports, and DMA channels to communicate with the PC motherboard?

USB
GPIO
PCI
Monitors
Printers
A

C. PCI boards use interrupts, I/O ports, and DMA channels to send and receive data with the PC motherboard, so option C is correct. USB devices transmit data using a serial bus connected to the motherboard and don’t use DMA channels, so option A is incorrect. The GPIO interface uses memory-mapped specialty IC chips and not interrupts and I/O ports, so option B is incorrect. Monitors and printers are hardware devices and not hardware interfaces, so options D and E are incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What filesystem does the Linux system use to track ports used to communicate with PCI boards?

/proc/ioports
/proc/interrupts
/sys
/dev
/proc/dma
A

A. The Linux kernel uses the /proc/ioports file to track the I/O ports used by the installed PCI boards on the system, so option A is correct. The kernel uses the /proc/interrupts and /proc/dma files to track interrupts and the DMA channel, not I/O ports, so options B and E are incorrect. The /sys directory contains files used to track kernel, module, and system features, not I/O ports, so option C is incorrect. The /dev directory contains files used to transfer data to and from devices, not track their I/O ports, so option D is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Where does Linux create files to send data to and receive data from directly with devices?

/sys
/proc
/etc
/dev
/dev/mapper
A

D. The kernel creates files in the /dev directory for each device on the Linux system. These files are used to send data to the device and read data from the device. Thus, option D is correct. The /sys and /proc directories are used by the kernel to display system information, not transfer data, so options A and B are incorrect. The /etc directory is used for configuration files, not for transferring data, so option C is incorrect. The /dev/mapper directory is used by virtual systems such as LVM and LUKS to create virtual files that indirectly interface with devices through another application, not directly, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Katie Jane created a new LVM volume on her Linux system. Where in the virtual directory should she look to find the virtual file related to the new volume?

/dev
/dev/mapper
/proc
/sys
/etc
A

B. The kernel uses the /dev/mapper directory to create virtual files that interface with applications that manipulate data on a virtual LVM volume before being sent to a physical hard drive device, so option B is correct. The /dev directory contains the physical device files, not virtual files, so option A is incorrect. The kernel uses the /proc and /sys directories to display kernel and system information, not virtual files for LVM volumes, so options C and D are incorrect. The /etc directory contains configuration files for applications, not LVM volumes, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Joel installed a new PCI card in his Linux system but is now getting a conflict with another device on the system. What command can he use to display the interrupts, I/O ports, and DMA channels in use by all the existing devices?

lsdev
lsblk
lspci
lsusb
dmesg
A

A. The lsdev command displays all the hardware information about all the devices connected to the system, so option A is correct. The lsblk command only displays information on block devices, so option B is incorrect. The lspci command only displays information about PCI devices, so option C is incorrect. The lsusb command only displays information about USB devices, so option D is incorrect. The dmesg command displays messages from the kernel ring buffer, not information about the current devices, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which Linux command displays the contents of the kernel ring buffer?

lsdev
lsblk
lspci
lsusb
dmesg
A

E. The dmesg command displays the kernel event messages contained in the kernel ring buffer, so option E is correct. The lsdev command displays hardware information about devices, but not messages from the kernel, so option A is incorrect. The lsblk command only displays information about block devices, not kernel event messages, so option B is incorrect. The lspci command only displays information about PCI devices, not kernel event messages, so option C is incorrect. The lsusb command only displays information about USB devices, not kernel event messages, so option D is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which software packages implement the X Windows graphical system in Linux? (Choose two.)

X.org
CUPS
Wayland
X11
udev
A

A, C. The X.org and Wayland software packages implement the X Windows graphical system for Linux, so options A and C are correct. The CUPS software package implements PostScript printing for Linux, not X Windows graphical systems, so option B is incorrect. X11 is an X Windows standard but not a software package, so option D is incorrect. The udev program is used to detect hot-pluggable devices, not implement the X Windows graphical system, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Sophia needs to connect her Linux system to a new network printer on the office network. What software package does she need to ensure is installed so she can configure the new network printer?

X.org
CUPS
Wayland
X11
udev
A

B. The CUPS software package provides an interface to convert PostScript documents and send them to common printers, so option B is correct. The X.org and Wayland software packages are used to implement the X Windows graphical system in Linux, not interface with printers, so options A and C are incorrect. X11 is a standard for X Windows, not a software package for printers, so option D is incorrect. The udev program detects hot-pluggable devices but doesn’t interact directly with the printers, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which program runs in the background monitoring the kernel ring buffer messages for new devices?

X.org
CUPS
Wayland
X11
udev
A

E. The udev program runs in the background and monitors the kernel ring buffer for event messages from new devices, so option E is correct. The X.org and Wayland software packages implement the X Windows graphical system but don’t listen for new devices, so options A and C are incorrect. The CUPS package interfaces with printers on the Linux system and doesn’t listen for new devices, so option B is incorrect. X11 is a standard for X Windows and not a software package that listens for new devices, so option D is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which program allows you to reload the defined rules for detecting and installing new devices?

udevadm
udev
lsusb
lspci
lsdev
A

A. The udevadm program allows you to send control messages to the udev application running in background, signaling it to reload the rules defined in the /etc/udev/rules.d directory, so option A is correct. The udev application can’t direct itself to reload the rules, so option B is incorrect. The lsusb, lspci, and lsdev programs are used for displaying hardware information for the system, not for directing the udev program to reload defined rules, so options C, D, and E are all incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly