Linux Device Handling Flashcards

(16 cards)

1
Q

Character Device

A

Device where data is read and written in streams and only with characters.

Character devices don’t have a fixed size.

A common example is a printer directly attached to the computer

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

Pipe devices

A

Devices that have the same characteristics as character devices (unknown size, read/write characters to streams) but are connected to another process instead of a kernel driver trying to communicate with physical hardware.

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

Socket devices

A

Devices used for inter process communication.

TODO STUB

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

Block device

A

Device where the data is accessed in fixed chunks or blocks such as hard drives.

Block devices always have a fixed, known size.

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

udevadm command

A

Command line utility to control and configure runtime behavior of udev

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

dd command

A

Utility application to read and write to a file/stream and possibly do some conversions

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

/dev/zero

A

A special pseudo file that provides an infinite stream of null characters.

It is often used for creating files or memory pages filled with only zeroes, often when the user wants an empty file but of a specific size.

Used in conjunction with the “dd” command

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

/dev/null

A

A special pseudo file that provides a stream that immediately discards any data sent to it.

It is often used to discard any unwanted data such as log output from an application.

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

What does the “sd” in /dev/sda1 stand for?

A

SCSI disk (Small Computer System Interface).

Although SCSI hardware is no longer being used, the protocol is still being used for its adaptability.

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

What type of device do /dev/sr* represent?

A

CD and DVD drives

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

What type of devices are /dev/tty, /dev/pts/ and /dev/tty?

A

Terminal devices which are responsible for moving characters from a user process to an I/O device.

Reading from the /dev/tty actually captures output to the screen (i.e. your monitor) and copying to the directory outputs to the screen.

Decades ago, terminals were actual hardware I/O devices.

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

pseudoterminals

A

Abstractions of /dev/tty but instead of outputting/capturing to/from an I/O device like a screen, it allows for the capture and sending of data to virtual I/O hardware like xterm/gnome-terminal/iTerm etc.

They are listed as character files in /dev/pts/*

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

What is the libata library?

A

A library that translates SCSI commands into ATA commands (for CD/DVD drives) and a full command substitution for SATA drives

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

What is the use of a generic SCSI device?

A

To do operations on the device that are too heavy or unnecessary to be implemented in the kernel such as writing to a CD/DVD.

The generic device is then used to bypass the kernel and interact with the device directly using SCSI commands.

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

What type of device does /dev/sg* represent?

A

Generic SCSI devices

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

lsscsi command

A

Lists info on SCSI devices and all their attributes