Basics Of Device Driver Types Flashcards

1
Q

The directory on a Linux machine where all the device files for the system are located.

A

/dev

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

/dev is a very interesting directory that highlights one important aspect of the Linux filesystem

A

Everything in Linux is a file

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

An example of the Printer driver in your Linux System. The device file of printer is /dev/lp0.

A

Any data written to this file by your application will be re-directed to your computer.

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

Data read/written to /dev/ttys0 will

A

allow you to communicate with a device like a serial terminal or a modem device.

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

In Linux we have following device types:

A
  1. Character Devices
  2. Block Devices
  3. Network Devices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Character Devices Driver

A

A character device typically transfers data to and from a user application- they behave like pipes or serial ports, instantly reading or writing the byte data in a character-by-character stream.

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

Character Device Drivers Framework

A

They provide the framework for many typical drivers, such as those that are required for interfacing to serial communications, video capture, and audio devices.

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

Block Device

A

Block devices behave in a similar fashion to regular files, allowing a buffered array of cached data to be viewed or manipulated with operations such as reads, writes, and seeks.

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

LKM

A

Linux Kernal Space

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

Major and Minor Numbers

A

Device drives have an associated major and minor number. For example /dev/ram0 and /dev/null are associated with a drive with a major number 1, and /dev/tty0 and /dev/ttys0 are associated with a driver with major number 4. The Major number is used by the kernel to identify the correct device driver when the device is accessed. The role of the minor number is device dependent and is handled internally within the driver.

molloyd@beaglebone:/dev$ ls -l
crw-rw—T 1 root i2c 89, 0 Jan 1 2000 i2c-0
brw-rw—T 1 root disk 1, 0 Mar 1 20:46 ram0
brw-rw—T 1 root floppy 179, 0 Mar 1 20:46 mmcblk0
crw-rw-rw- 1 root root 1, 3 Mar 1 20:46 null
crw——- 1 root root 4, 0 Mar 1 20:46 tty0
crw-rw—T 1 root dialout 4, 64 Mar 1 20:46 ttyS0

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

molloyd@beaglebone:/dev$ ls -l
crw-rw—T 1 root i2c 89, 0 Jan 1 2000 i2c-0
brw-rw—T 1 root disk 1, 0 Mar 1 20:46 ram0
brw-rw—T 1 root floppy 179, 0 Mar 1 20:46 mmcblk0
crw-rw-rw- 1 root root 1, 3 Mar 1 20:46 null
crw——- 1 root root 4, 0 Mar 1 20:46 tty0
crw-rw—T 1 root dialout 4, 64 Mar 1 20:46 ttyS0

A

Character devices are identified by a ‘c’ in the first column of a listing, and block devices are identified by a ‘b’. The access permissions, owner, and the group of the device is provided for each device.

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

Examples of character device drivers are

A
  • Serial port ( /dev/ttyS0 )
  • Text console ( /dev/console )
  • Mice
  • Parallel printer ports
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Examples of Block device

A
  • Hard Drive

- Cd-Rom

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

In what way do Block and Character devices differ?

A

Block and Character devices differ only in the way the data is managed internally by the kernal.

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

Block devices in short are

A

Block devices in short are devices that store or hold data.

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

Network device

A

Network devices receive and transmit data packets on hardware interface that connect to external systems and provide a uniform interface that network protocols can access.

17
Q

Network device vs. Block device

A

Block drivers operate only in response to requests from the kernal, whereas network drivers receive packets asynchronously from outside. Thus, while a block driver is asked to send a buffer toward the kernal, the network device asks to push incomming packets tooward the kerrnal. The kernal interface for network drivers is designed for this different mode of operation.