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
Q

Waster space within blocks, but better transfering

A

Larger blocks in disk

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

Start at block 0 of disk. Write every block to output disk and stop during last block.

A

Physical dump

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

Also copies bad blocks, which can cause corruption

A

physical dump

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

Cannot restore individual files

A

physical dump

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

Start at specific directory and recursively dump all files and directories since last modified

A

logical dump

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

Easier to restore specific file

A

logical dump

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

Start at root, mark bit for modified files and all directories

A

logical dump - phase 1

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

walk tree, unmark directories without any modified files

A

logical dump - phase 2

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

go through i-nodes and dump marked directories

A

logical dump - phase 3

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

Stores collection of blocks that are kept in memory for frequent access

A

caching

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

Some blocks may not actually be referenced twice within a short interval (anti-temporality)

A

issue with caching

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

Blocks likely not needed again are placed at front of queue, and blocks needed again are at back of queue

A

caching, addressing temporality

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

If reading block k to cache, read in k + 1 if block not already in cache

A

block read ahead

38
Q

Can store all i-nodes at beginning of disk. Requires half rotation for any seek on average

A

Reducing disk arm motion

39
Q

Put all i-nodes in middle of disk, instead of start, reducing average seek between i-node and block by factor of two

A

Alternative approach to reducing disk arm motion

40
Q

Divide disk into groups, each with own i-nodes, blocks, free list

A

Approach to reducing disk arm motion

41
Q

Stores information in fixed blocks. Transfers are fixed blocks

A

Block devices

42
Q

Stream of character. Not addressable and no support for seeking

A

character devices

43
Q

Each controller for I/O device is assigned a unique memory address in same physical memory as rest of computer

A

memory mapped i/o

44
Q

Requires that I/O memory not be cached

A

memory mapped i/o

45
Q

Requires hardware to have DMA controller. Allows hardware to directly read and write memory without blocking

A

direct memory access

46
Q

CPU programs DMA controller by setting registers to desired memory location

A

direct memory access - step 1

47
Q

DMA controller initiates transfer via read request from DMA to disk controller

A

direct memory access - step 2

48
Q

Disk controller writes from disk to main memory

A

DMA - step 3

49
Q

Disk controller sends ACK to DMA controller to

A

DMA - step 4

50
Q

DMA controller interrupts CPU to notify transfer complete

A

DMA - step 5

51
Q

Interrupt that leaves machine in well-defined state

A

precise interrupt

52
Q

interrupt that leaves machine in undefined state

A

imprecise interrupt

53
Q
  • 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
A

precise interrupt

54
Q
  • User level I/O software
  • Device independent I/o software
  • Device drivers
  • Interrupt handlers
  • Hardware
A

I/O software layers

55
Q

For each class of driver, OS defines set of functions that driver must support

A

Uniform interfacing for device drivers

56
Q

Request a buffer of blocks rather than a single block

A

Buffering in I/O

57
Q

Solution to buffer being read/written to at the same time

A

double buffering

58
Q

Should be able to determine what to do in case of I/O errors. If cannot, should pass to device-independent I/O software

A

Error reporting

59
Q
  • Accept read / write requests from software
  • Must initialize device if required
  • Manage power and logging of device
A

Roles of device driver

60
Q

Must assume that multiple calls can be made into driver code before first one finishes

A

reeentrant code

61
Q

Cannot make system calls, except for limited subset

A

drivers

62
Q

Organized into cylinders, each contains as many tracks as vertically-stacked heads. Tracks divided into sectors, with variable number of sectors

A

organization of magnetic disks

63
Q

Disk controller informs OS with number of cylinders, heads, and sectors

A

Dealing with multi-zone sectoring approach

64
Q

Disk sectors numbered consecutively starting at 0

A

logical block addressing

65
Q

Each disk divided into strips of k sectors each. Write to consecutive strips over drives in round-robin fashion

A

Raid 0

66
Q

Duplicate all disks. No performance gain or parallelism. Still uses sector stripping

A

Raid 1

67
Q

Works on word memory size basis. Use hamming code/ECC to ensure bytes are properly stored. Requires devices to be synchronized

A

Raid 2

68
Q

Single parity bit for each data word, written to dedicated parity drive

A

Raid 3

69
Q

Strip-for-strip copy written onto parity drive. Protects against loss of drive, but bad for small updates

A

Raid 4

70
Q

If one sector lost or changed, must recalculate parity for all relevant sectors

A

Raid 4

71
Q

Distribute parity bits over all devices, but do not store parity bits for own sector on device

A

Raid 5

72
Q

Store extra copy of parity bits on each block. Use two strips rather than one. Slightly more fault-tolerant, but less storage

A

Raid 6

73
Q

Stores bit pattern to allow hardware to recognize start of sector, as well as number of cylinders and sectors

A

Preamble of disk

74
Q

Used to recover from read errors

A

ECC section of disk

75
Q

Each sector on track is offset from previous track

A

Cylinder skew

76
Q

RPM = 10,000, 30 sectors, track-to-track seek time of 800 microseconds

A

40 seconds of cylinder skew

77
Q

Sectors may be too close to each other, causing excess seek time

A

Interleaving of sectors

78
Q
  • Seek time
  • Rotation delay
  • Data transfer time
A

Factors of speed / time to write to disk

79
Q

Disk executes requests to read from sector one at a time

A

First-come-first serve

80
Q

Handle request to closest sector next

A

Shortest seek first

81
Q

Can lead to starvation depending on sectors being read

A

Shortest seek first

82
Q

SSF, but can only go in one direction at a time. If no pending requests, flip direction

A

Elevator scheduling

83
Q
  • Stable writes
  • Stable reads
  • Crash recovery
A

Requirements for stable storage

84
Q

After write, the data read out = data written. Keep trying to write sector until valid one found

A

stable writes

85
Q

Reading data and checking ECC leads to correct EC

A

stable reads

86
Q

able to overwrite bad sector from one disk with good sector from other disk

A

crash recovery

87
Q

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

A

One-shot mode

88
Q

Holding register copied automatically when clock reaches 0 and process repeats.

A

Square wave mode

89
Q

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

A

connecting multiple clocks

90
Q
A