Quiz 5 Flashcards

1
Q

A program must be in what for it to run?

A

In memory

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

What are the only sources of storage can the CPU access directly?

A

Main memory and registers

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

Why can main memory cause stalls?

A

Because accessing it may require multiple cycles

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

What is between main memory and CPU registers?

A

Cache

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

What is the order of memory from smallest to largest?

A

Register->Cache->Main Memory->External Storage

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

How does the OS ensures that a process can only access those addresses in its address space?

A

It uses a pair of base and limit registers to define the logical address space of a process

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

What must the CPU do to insure that every memory access generated in user mode is between the base and limit for the user?

A

It checks if the address is larger than the base register and smaller than the base + limit register, if this is not the case it causes an error.

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

Where do programs brought into memory execute from?

A

The input queue

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

What binds relocatable addresses to absolute addresses?

A

Linkers or loaders

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

What are the three stages where the binding of instructions and data to memory addresses can occur?

A

Compile time, Load Time and Execution Time

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

When memory addresses are bound during compile time what type of code can be generated?

A

Absolute code, assuming that the memory location is known a priori

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

When memory addresses are bound during load time what type of code can be generated?

A

Relocatable code

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

What is a logical address?

A

An address generated by the CPU

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

What is a physical address?

A

Address seen by the memory unit

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

When are logical and physical addresses are the same?

A

During compile time and load-time address-binding schemes

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

When do logical and physical addresses differ?

A

During execution time address binding schemes

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

What is the logical address space?

A

The set of all logical addresses generated by a program

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

What is the physical address space?

A

The set of all physical addresses generated by a program

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

What is the memory management unit?

A

A hardware device that maps virtual addresses to physical addresses

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

During a simple scheme what occurs?

A

The base register is called a relocation register
The value in the relocation register is added to every address generated by a user process

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

During a simple scheme what does the user program deal with?

A

Logical addresses

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

What is dynamic loading?

A

Loading only what you require into memory while executing a program

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

When are routines loaded during dynamic loading?

A

When they are called

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

Is special support needed from the operating system when you use dynamic loading?

A

No

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

What is static linking?

A

The system libraries and program code is combined by the loader into the binary program image

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

What is dynamic linking

A

When linking is postponed until execution time

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

What is used to locate the appropriate memory resident library routine?

A

The stub

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

What do stubs do?

A

Replaces itself with the address of the routine it stands in for and executes the routine

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

What is an early method of allocating memory?

A

Contiguous allocation

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

What was the two partitions of the main memory?

A

The low memory, which contained the resident operating system and the high memory which was held user processes

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

What does the limit register do with contiguous allocation?

A

It insures that the logical addresses are less than it

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

What is variable partition?

A

The memory is segmented into various sizes and when a process arrives it gets placed into one of these segments large enough to accommodate it

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

What are the three algorithms for dynamic storage?

A

First fit, Best fit and Worst fit

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

How does the first fit algorithm allocate holes?

A

It allocates holes large enough to fit the process

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

How does the best fit algorithm allocate holes?

A

Allocates the smallest hole big enough to fit the process

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

How does the worst fit fit algorithm allocate holes?

A

Allocate the largest hole

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

What are the two types of framentation?

A

External fragmentation and Internal Fragmentation

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

What is External Fragmentation?

A

Total memory space exists to satisfy a request, but it is not contiguous

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

What is internal fragmentation?

A

Allocated memory is slightly larger than the request memory, and is not being used by the process

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

For the first fit algorithm how much memory is lost due to fragmentation?

A

50%

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

What can be done to reduce external fragmentation?

A

Compaction, ie shuffling memory contents to place all free memory together in one large block

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

What are frames?

A

A section of physical memory divided into a block

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

What are the qualities of the memory of a frame?

A

The size of the memory is a power of 2, it is between 512 bytes and 16 megabytes

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

What are pages?

A

Sections of logical memory divided into chunks

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

What is a page table?

A

A table that keeps track of the pages in a program

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

What are the two sections of an address generated by the CPU?

A

A page number, and a page offset

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

What is a page number?

A

An index into a page table

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

What is a page offset?

A

A number added to the physical memory address that is sent to the memory unit

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

Where is the page table located?

A

In main memory

50
Q

What does the page table base register point to?

A

The page table

51
Q

What does the page table length register do?

A

Indicate the size of the page table

52
Q

What is used to resolve the two memory access problem?

A

A fast lookup hardware cache called a translation look-aside buffer

53
Q

What is an address space identifier?

A

A number in each translation look aside buffer that identifies each process to provide address space protection for said process

54
Q

What occurs on a translation look aside buffer miss?

A

A value is loaded into the translation look aside buffer for faster access

55
Q

What is effective access time?

A

The time it takes for a memory to be accessed using a TLB

56
Q

How is memory protection implemented in page tables?

A

By indicating if a read-only or read-write access is allowed

57
Q

What does valid mean in reference to a valid-invalid bit?

A

The associated page is in the process’ logical address space and is thus a legal page

58
Q

What does invalid means in reference to a valid-invalid bit?

A

That a page is not in the process’ logical address space

59
Q

What is reentrant code?

A

A single copy of read only code shared among processes

60
Q

What does each process keep a separate copy of when using pages?

A

The code and data

61
Q

What are the three ways of dividing the page table into smaller units?

A

Hierarchical Paging
Hashed Page Tables
Inverted Page Tables

62
Q

How does hierarchical page tables function?

A

By breaking up the logical address space into multiple page tables, then paging the page table

63
Q

How does Two Level Paging function?

A

By breaking up the page number into another section

64
Q

What are Inverted Page Tables?

A

Page tables that store the information about the process that holds a page rather than the page itself

65
Q

What is Roll Out Roll In?

A

A swapping variant used with priority-based scheduling algorithms, swaps lower priority processes with higher priority processes.

66
Q

Does swapped out processes need to swap back into the same physical addresses?

A

Depends on the address binding method

67
Q

What is the modified version of swapping?

A

Swapping is allowed only if a threshold of memory is allocated

68
Q

What is one constraint on swapping?

A

Pending I/O

69
Q

What is double buffering?

A

When you have to transfer I/O to kernel space then back to I/O device

70
Q

The Intel IA-32 Architecture supports what types of segmentation?

A

Normal segmentation and segmentation with paging

71
Q

What is Virtual Memory?

A

Separation of user logical memory from physical memory

72
Q

What are some of the benefits of using virtual memory?

A

Only need a part of the program in memory for execution
Logical address space can be larger than physical address space
Address spaces can be shared by several processes
Allows for more efficient process creation
More programs running concurrently
Less I/O needed to load or swap processes

73
Q

What are the two ways virtual memory can be implemented?

A

Demand paging or Demand Segmentation

74
Q

How is logical address space normally allocated in reference to the stack and heap?

A

The stack starts at the max and grows down while the heap starts at the bottom and grows upward

75
Q

What is demand paging?

A

Bringing a page into memory only when its needed

76
Q

What is a lazy swapper?

A

A swapper that only swaps a page into memory when the page is needed

77
Q

What is a valid-invalid bit?

A

A bit that shows if a page is in memory or is not in memory

78
Q

What are the steps in handing a page fault?

A

Find a Free frame
Swap the page into a frame via scheduled disk operation
Reset tables to indicate page is in memory
Restart the instruction that caused the page fault

79
Q

What is a free frame list?

A

A pool of free frames for satisfying page swaps

80
Q

What is zero-fill-on-demand?

A

The content of a frame being zeroed out before it is allocated to another process

81
Q

What are the stages in demand paging in the worst case?

A

1 Trap to the operating system
2 Save the user registers and process state
3 Determine that the interrupt was a page fault
4 Check that the page reference was legal and determine the location of the page on the disk
5 Issue a read from the disk to a free frame
6 While waiting allocate the CPU to some other user
7 Receive an interrupt from the disk I/O subsystem
8 Determine that the interrupt was from the disk
9 Determine that the interrupt was from the disk
10 Correct the page table and other tables to show page is now in memory
11 Wait for the CPU to be allocated to this process
12 Restore the user registers process state and a new page table and resume the interrupted instruction

82
Q

What is Effective Access Time?

A

(1-p)x memory access + p (page fault overhead + swap page out + swap page in)

83
Q

What is copy on write?

A

It allows parent and child processes to share pages in the same memory

84
Q

The dirty bit ensures what?

A

That only modified pages are written to disk

85
Q

What is the steps for a basic page replacement?

A

1 Find the location of the desired page on a disk
2 Find a free frame, if one is present use it otherwise free a frame using a page replacement algorithm
3 Bring desired page into the new frame, update page and frame tables
4 Restart the instruction that caused the trap

86
Q

What issue may arise due to using the FIFO algorithm?

A

Belady’s Anomaly, ie more page faults occuring with more frames

87
Q

What is the issue that may arise with the FIFO algorithm?

A

Bayle’s Algorithm, ie more page faults occurring with more frames

88
Q

What is the optimal algorithm?

A

Replace the page that will not be used for the longest period of time

89
Q

What is the LRU algorithm?

A

Replace the page that has not been used in the most amount of time.

90
Q

What are the two ways of implementing the LRU algorithm?

A

Counters and Stacks

91
Q

Explain the implementation of LRU algorithm using stacks

A

Keep a stack of page umbers in a double link form, when a page is reference you move it to the top, however this results in each update becoming more expensive

92
Q

Explain the implementation of LRU algorithm using counters

A

Each page entry has a counter, and this counter gets updated every time a page is referenced and copied over into the page that was updated

93
Q

What are the two major allocation schemes?

A

Fixed allocation and Priority allocation

94
Q

What are the two types of fixed allocation?

A

Equal allocation, each process gets the same amount of frames
Proportional allocation, allocation is given to the size of each process

95
Q

What is Global replacement?

A

A replacement frame is selected from the set of all frames

96
Q

What is local replacement?

A

Each process selects from only its own set of allocated frames

97
Q

What is the benefit and downsides of global replacement?

A

Benefit-greater throughput is more common
Downside-Execution time varies greatly

98
Q

What are the benefits and downsides of local replacement?

A

Benefit-more consistent per process performance
Downside-possibly underutilized memory

99
Q

What is the strategy to implement a global page replacement policy?

A

Memory requests are satisfied from the free-frame list, and page replacement is triggered when the list falls below a certain threshold

100
Q

What is thrashing?

A

Slowdown caused by a process having a very high page fault rate

101
Q

What are the two main forms of secondary storage?

A

Hard disk drives and nonvolatile memory

102
Q

What are some of the benefits and downsides of nonvolatile memory devices?

A

Benefits: Faster
Downsides: Shorter life span, more expensive, and less capacity

103
Q

How are disk drives addressed?

A

As large 1d logical blocks

104
Q

What is disk bandwidth?

A

Total number of bytes transferred divided by the total time between the first request for service and the completion of the last transfer

105
Q

What is the FCFS disk scheduling algorithm?

A

The head moves to the first pin in the queue

106
Q

What is the SCAN algorithm?

A

The disk arm starts at the end of the disk and moves toward the other end

107
Q

What is the C-SCAN?

A

A varient of the SCAN goes from one end of the disk to the other sericing requests as it goes

108
Q

What is physical formatting?

A

Dividing a disk into sectors that the disk controller can read and write

109
Q

What is the RAID structure?

A

Having multiple disk drives holding copies of the same data to increase reliability

110
Q

What is RAID 0?

A

Non-redundant striping

111
Q

What is RAID 1?

A

Mirrored disks

112
Q

What is RAID 4?

A

Block interleaved parity

113
Q

What is RAID 5?

A

Block interleaved distributed parity

114
Q

What is a port?

A

A connection point for a device

115
Q

What is a Bus?

A

A shared direct access

116
Q

What receives interrupts?

A

The Interrupt handler

117
Q

What is dispatched to correct the interrupt handler?

A

The Interrupt Vector

118
Q

What is used for exceptions?

A

The interrupt mechanism

119
Q

What does the Direct Memory Access controller do?

A

Bypasses the CPU to transfer data directly between I/O device and memory

120
Q

What are the various interfaces for devices?

A

Character-stream/block, Sequential/random-access, Synchronous/asynchronous, Sharable/dedicated, Read-write, Read-only, Write-only