Files and IO Flashcards

1
Q

All files stored in root directory

A

Single level directory

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

Files stored in tree structure

A

Hierarchial directory

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

Direct copy of a file to another place in directory tree

A

Hard link

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

Sector 0 stores this

A

Master Boot Record

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

Stores start and end of each partition. Used to boot

A

Master Boot Record

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

Each file stored as continuous run of blocks

A

Contiguous allocation

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

Benefits from fast read times and easier to track blocks

A

Contiguous allocation

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

Leads to disk fragmentation and can be expensive to compact

A

Contiguous allocation

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

Each block stores pointer to next block in file, not necessarily same physical block

A

Linked list allocation

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

No external fragmentation, but slow random access

A

Linked list allocation

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

Store linked list as array, with index as physical block and value is next file block. Value of -1 is the last block

A

Linked list allocation using In-Memory table

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

Each directory entry only needs to store starting block number for file

A

Linked list allocation using In-Memory table

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

Entire table must be in memory at same time for faster access than LL

A

Linked list allocation using In-Memory table

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

Store attributes and disk addresses of file blocks

A

I-nodes

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

Only needs to be in-memory when file accesses

A

I-nodes

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

Dependent on number of files open at once

A

I-nodes

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

Each directory entry points to fixed portion, with length of entry and data

A

Directory implementation

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

I-node stores file length, attributes and file name in memory

A

Directory implementation with contiguous memory

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

I-nodes stores file names in a heap, pointed to by file entry

A

Directory implementation with heap

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

Used to guard against lost files during crashes

A

Journaling file system

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

Keep a list of actions before taking them, then perform actions

A

Journaling file system

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

Operations should be ________ to ensure that actions can be replayed without harm

A

idempotent

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

a measure of state change

A

idempotent

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

Each file has many blocks, leading to more seeks and rotation delay

A

Smaller blocks in disk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Waster space within blocks, but better transfering
Larger blocks in disk
26
Start at block 0 of disk. Write every block to output disk and stop during last block.
Physical dump
27
Also copies bad blocks, which can cause corruption
physical dump
28
Cannot restore individual files
physical dump
29
Start at specific directory and recursively dump all files and directories since last modified
logical dump
30
Easier to restore specific file
logical dump
31
Start at root, mark bit for modified files and all directories
logical dump - phase 1
32
walk tree, unmark directories without any modified files
logical dump - phase 2
33
go through i-nodes and dump marked directories
logical dump - phase 3
34
Stores collection of blocks that are kept in memory for frequent access
caching
35
Some blocks may not actually be referenced twice within a short interval (anti-temporality)
issue with caching
36
Blocks likely not needed again are placed at front of queue, and blocks needed again are at back of queue
caching, addressing temporality
37
If reading block k to cache, read in k + 1 if block not already in cache
block read ahead
38
Can store all i-nodes at beginning of disk. Requires half rotation for any seek on average
Reducing disk arm motion
39
Put all i-nodes in middle of disk, instead of start, reducing average seek between i-node and block by factor of two
Alternative approach to reducing disk arm motion
40
Divide disk into groups, each with own i-nodes, blocks, free list
Approach to reducing disk arm motion
41
Stores information in fixed blocks. Transfers are fixed blocks
Block devices
42
Stream of character. Not addressable and no support for seeking
character devices
43
Each controller for I/O device is assigned a unique memory address in same physical memory as rest of computer
memory mapped i/o
44
Requires that I/O memory not be cached
memory mapped i/o
45
Requires hardware to have DMA controller. Allows hardware to directly read and write memory without blocking
direct memory access
46
CPU programs DMA controller by setting registers to desired memory location
direct memory access - step 1
47
DMA controller initiates transfer via read request from DMA to disk controller
direct memory access - step 2
48
Disk controller writes from disk to main memory
DMA - step 3
49
Disk controller sends ACK to DMA controller to
DMA - step 4
50
DMA controller interrupts CPU to notify transfer complete
DMA - step 5
51
Interrupt that leaves machine in well-defined state
precise interrupt
52
interrupt that leaves machine in undefined state
imprecise interrupt
53
- PC must be saved in known place - All instructions before PC must fully execute - No instructions after PC executed - Execution state at current PC is known
precise interrupt
54
- User level I/O software - Device independent I/o software - Device drivers - Interrupt handlers - Hardware
I/O software layers
55
For each class of driver, OS defines set of functions that driver must support
Uniform interfacing for device drivers
56
Request a buffer of blocks rather than a single block
Buffering in I/O
57
Solution to buffer being read/written to at the same time
double buffering
58
Should be able to determine what to do in case of I/O errors. If cannot, should pass to device-independent I/O software
Error reporting
59
- Accept read / write requests from software - Must initialize device if required - Manage power and logging of device
Roles of device driver
60
Must assume that multiple calls can be made into driver code before first one finishes
reeentrant code
61
Cannot make system calls, except for limited subset
drivers
62
Organized into cylinders, each contains as many tracks as vertically-stacked heads. Tracks divided into sectors, with variable number of sectors
organization of magnetic disks
63
Disk controller informs OS with number of cylinders, heads, and sectors
Dealing with multi-zone sectoring approach
64
Disk sectors numbered consecutively starting at 0
logical block addressing
65
Each disk divided into strips of k sectors each. Write to consecutive strips over drives in round-robin fashion
Raid 0
66
Duplicate all disks. No performance gain or parallelism. Still uses sector stripping
Raid 1
67
Works on word memory size basis. Use hamming code/ECC to ensure bytes are properly stored. Requires devices to be synchronized
Raid 2
68
Single parity bit for each data word, written to dedicated parity drive
Raid 3
69
Strip-for-strip copy written onto parity drive. Protects against loss of drive, but bad for small updates
Raid 4
70
If one sector lost or changed, must recalculate parity for all relevant sectors
Raid 4
71
Distribute parity bits over all devices, but do not store parity bits for own sector on device
Raid 5
72
Store extra copy of parity bits on each block. Use two strips rather than one. Slightly more fault-tolerant, but less storage
Raid 6
73
Stores bit pattern to allow hardware to recognize start of sector, as well as number of cylinders and sectors
Preamble of disk
74
Used to recover from read errors
ECC section of disk
75
Each sector on track is offset from previous track
Cylinder skew
76
RPM = 10,000, 30 sectors, track-to-track seek time of 800 microseconds
40 seconds of cylinder skew
77
Sectors may be too close to each other, causing excess seek time
Interleaving of sectors
78
- Seek time - Rotation delay - Data transfer time
Factors of speed / time to write to disk
79
Disk executes requests to read from sector one at a time
First-come-first serve
80
Handle request to closest sector next
Shortest seek first
81
Can lead to starvation depending on sectors being read
Shortest seek first
82
SSF, but can only go in one direction at a time. If no pending requests, flip direction
Elevator scheduling
83
- Stable writes - Stable reads - Crash recovery
Requirements for stable storage
84
After write, the data read out = data written. Keep trying to write sector until valid one found
stable writes
85
Reading data and checking ECC leads to correct EC
stable reads
86
able to overwrite bad sector from one disk with good sector from other disk
crash recovery
87
Copy value of holding register into counter and decrement counter at each pulse. When counter is 0, throw an interrupt by CPU. Must be manually restarted
One-shot mode
88
Holding register copied automatically when clock reaches 0 and process repeats.
Square wave mode
89
Linked list of actions to take at certain ticks. each node in ll stores number of ticks until next action. decrement ll on each tick
connecting multiple clocks
90