Device Manager Flashcards

1
Q

What is the Device Manger?

A

Monitors every device within the system, ensuring every process gets fair access to these devices. Some tasks include:
- keeps track of devices
- creates virtual files that map onto physical devices
- deals with multiple requests for same devices
- provides syscalls so software can use devices

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

Layers of Abstraction

A

Program Code ->
System Call Interface ->
Device Driver ->
Device Controller (memory and registers) ->
Mechanical/Electronic Hardware

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

Devices Categories

A

Character vs. block
Sequential vs. random
Shared vs. dedicated
Speed of Operation
Data Direction (read-write, read-only, write-only)
The device driver hides these differences from the kernel.

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

Character vs. block

A

Character devices handle data on a character-by-character basis, where each character is treated as a unit of data. Block devices are devices that handle data in fixed-sized blocks.

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

Sequential vs. random

A

Sequential devices write data sequentially, whilst random devices write data in any location/order.

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

Shared vs. dedicated

A

Shared devices can be accessed by multiple users or processes concurrently, whilst dedicated devices are exclusively assigned to a specific user/process.

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

Device Drivers

A

The connection between the operating system and the hardware devices.

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

Device Buses

A

PCIe - Peripheral Component Interconnect Express -> general purpose
USB - Universal Series Bus -> general purpose
NVMe - Non-Volatile Memory Express -> flash disks (SSD)
SATA - Serial AT attachment -> mechanical disks (HDD)
Each of these buses have their own protocol and format for sending and receiving data

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

Peripherals

A

External devices

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

System Bus

A

Used to connect devices buses and CPU, except for interrupts.

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

Ways of passing Commands and Data to Devices

A

Memory Mapped I/O -> virtual addresses in main memory are mapped on to device registers, allowing CPU to use its standard instructions to manipulate device registers which look and behave exactly like normal memory.
Port-Mapped I/O -> this is supported by Intel instruction sets, in which devices have a separate address space assigned to the CPU via dedicated pins. This allows in and out instructions to move data between EAX and devices addresses.
Essentially, devices are either assigned specific I/O port addresses, or mapped to main memory addresses.

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

Scheduling I/O Activities

A

The device manager schedules I/O activities to maximise system performance. This allows minimal time wasted by moving the HDD read/write head, and prioritise I/O requests. This also ensures disk access is shared equally between processes.

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

I/O Wait Queue and Scheduling Algorithms

A

Each disk has an I/O wait queue, which can be reordered depending on policy:
- first come first served
- shortest seek first
- elevator algorithm
- completely fair queueing
- anticipatory scheduling

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

Completely Fair Queueing

A

Requests are serviced via time slices according to priority values of the processes.

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

Anticipatory Scheduling

A

Essentially, AS takes a few milliseconds to anticipate the next I/O request a process is going to make based upon it historical I/O behaviour, grouping together I/O requests that are likely to be issued by the same process in the queue. So overall, we have a queue with groups of I/O requests which, by guesswork, should belong to different processes respectively.

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

Elevator Algorithm

A

Schedules block I/O in the order of travel of the read/write head, only accessing a block when the head is moving in that direction.

17
Q

Buffering

A

First of all, a buffer is a use of a temporary storage area to hold data as it is transferred between devices. We use this when we are reading, or writing, a large amount of data, so we do not have to constantly go between one device to another, or from a file to a device etc (for a read-only example, reading from a file for every single character could be very costly).
An issue with this could be that the data on the disk doesn’t match what the system thinks (aka the buffer stored the wrong memory), so it is important to flush the buffer regularly.

18
Q

Double Buffering

A

Use one buffer for reading/writing data whilst the other is being emptied.

19
Q

Buffering Locations

A
  • software programs
  • library subroutines
  • OS
  • hardware
20
Q

Flushing the Buffer

A

Actually writing what is on the buffer to the destination.

21
Q

Spooling

A

Some devices are non-shareable, so we use the spooler daemon, in which spooler creates a temporary file for each process, so the process writes data into the temporary file that is managed by the spooler. Therefore we do not need accessibility to the device that cannot be accessed, but we have files available.

22
Q

Direct Memory Access

A

Hardware devices can access main memory independently of the CPU. The DMA has its own registers, with the CPU initiating the rea/write operation and the DMA using its registers for data transfer.

23
Q

Devices in Linux

A

Linux creates a virtual file within /dev directory for all devices in the system, calling access via syscalls. Some devices include:
lp -> printer
sd -> disk
pp -> parallel port
tty -> terminal
pty -> pseudo-terminal (pipes between processes)