Chapter 7: Main Memory Flashcards

1
Q
Absolute code can be generated for \_\_\_\_.
A) compile time binding 
B) load time binding 
C) execution time binding
D) interrupt binding
A

A- COMPILE TIME BINDING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
Which of the following methods of binding instructions and data to memory is performed by most general-purpose operating systems?
A) interrupt binding 
B) compile time binding 
C) execution time binding
D) load time binding
A

C- EXECUTION TIME BINDING

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

An address generated by a CPU is referred to as a ____.
A) physical address
B) logical address
C) post relocation register address
D) Memory-Management Unit (MMU) generated address

A

B- LOGICAL ADDRESS

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

In a dynamically linked library, ____.
A) loading is postponed until execution time
B) system language libraries are treated like any other object module
C) more disk space is used than the option of using a statically-linked library
D) a stub is included in the image for each library-routine reference

A

D- A STUB IS INCLUDED IN THE IMAGE FOR EACH LIBRARY-ROUTINE REFERENCE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
Which of the following binding schemes facilitates swapping?
A) interrupt time 
B) load time 
C) assembly time 
D) execution time
A

D- EXECUTION TIME

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

The roll out, roll in variant of swapping is used ____.
A) when a backing store is not necessary
B) for the round-robin scheduling algorithm
C) for priority-based scheduling algorithms
D) when the load on the system has temporarily been reduced

A

C- FOR PRIORITY-BASED SCHEDULING ALGORITHMS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Which of the following dynamic storage-allocation algorithms results in the smallest leftover hole in memory?
A) first fit 
B) best fit 
C) worst fit 
D) None of the above
A

B- BEST FIT

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

Which of the following is true of compaction?
A) It can be done at assembly, load, or execution time.
B) It is used to solve the problem of internal fragmentation.
C) It cannot shuffle memory contents.
D) It is possible only if relocation is dynamic and done at execution time

A

D- IT IS POSSIBLE ONLY IF RELOCATION IS DYNAMIC AND DONE AT EXECUTION TIME

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A(n) \_\_\_\_ page table has one page entry for each real page (or frame) of memory.
A) inverted 
B) clustered 
C) forward-mapped 
D) virtual
A

A- INVERTED

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

How is a limit register used for protecting main memory?

A

When the CPU is executing a process, it generates a logical memory address that is added to a relocation register in order to arrive at the physical memory address actually used by main memory. A limit register holds the maximum logical address that the CPU should be able to access. If any logical address is greater than or equal to the value in the limit register, then the logical address is a dangerous address and an error results.

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

What is the advantage of using dynamic loading?

A

Dynamic loading enables a program to not have to store itself, in its entirety, in main memory. This allows the system to obtain better memory-space utilization. This also allows unused routines to stay out of main memory so that memory can be used more effectively. For example, code used to handle an obscure error would not always use up main memory.

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

What is the context switch time, associated with swapping, if a disk drive with a transfer rate of 2 MB/s is used to swap out part of a program that is 200 KB in size? Assume that no seeks are necessary and that the average latency is 15 ms. The time should reflect only the amount of time necessary to swap out the process.

A

200KB / 2048 KB per second + 15 ms = 113 ms

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

When does external fragmentation occur?

A

As processes are loaded and removed from memory, the free memory space is broken into little pieces. External fragmentation exists when there is enough total memory space to satisfy a request, but the available spaces are not contiguous; storage is fragmented into a large number of small holes. Both the first-fit and best-fit strategies for memory allocation suffer from external fragmentation.

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

Explain the basic method for implementing paging.

A

Physical memory is broken up into fixed-sized blocks called frames while logical memory is broken up into equal-sized blocks called pages. Whenever the CPU generates a logical address, the page number and offset into that page is used, in conjunction with a page table, to map the request to a location in physical memory.

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

How does a transaction look-aside buffer (TLB) assist in the hardware implementation of a page table?

A

Typically, large page tables are stored in main memory, and a page-table base register points to the page table. Therefore, two memory accesses are needed to access a byte (one for the page-table entry, one for the byte), causing memory access to be slowed by a factor of 2. The standard solution to this problem is to use a TLB, a special, small fast-lookup hardware cache. The TLB is associative, high speed memory. Each entry consists of a key and value. An item is compared with all keys simultaneously, and if the item is found, the corresponding value is returned.

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

How are illegal page addresses trapped by the operating system?

A

Illegal addresses are trapped by the use of a valid-invalid bit, which is generally attached to each entry in the page table. When this bit is set to “valid”, the associated page is in the process’s logical address space and is thus a legal (or valid) page. When the bit is set to “invalid”, the page is not in the process’s logical address space. The operating system sets this bit for each page to allow or disallow access to the page.

17
Q

Describe the elements of a hashed page table.

A

A hashed page table contains hash values which correspond to a virtual page number. Each entry in the hash table contains a linked list of elements that hash to the same location (to handle collisions). Each element consists of three fields: (1) the virtual page number, (2) the value of the mapped page frame, and (3) a pointer to the next element in the linked list.

18
Q

Briefly describe the segmentation memory management scheme. How does it differ from the paging memory management scheme in terms of the user’s view of memory?

A

Segmentation views a logical address as a collection of segments. Each segment has a name and length. The addresses specify both the segment name and the offset within the segment. The user therefore specifies each address by two quantities: a segment name and an offset. In contrast, in a paging scheme, the user specifies a single address, which is partitioned by the hardware into a page number and an offset, all invisible to the programmer

19
Q

A relocation register is used to check for invalid memory addresses generated by a CPU (T/F)

A

FALSE

20
Q

Pure code cannot be shared (T/F)

A

FALSE

21
Q

In current systems, pages are typically between 4 KB and 8 KB in size. (T/F)

A

TRUE

22
Q

Hierarchical page tables are appropriate for 64-bit architectures. (T/F)

A

FALSE

23
Q

The Linux operating system does not rely on segmentation and uses it minimally (T/F)

A

TRUE

24
Q

A word is a

A

fixed-size unit of data. A typical word size is 1, 2, or 4 bytes.

25
Q

A word is a

A

fixed-size unit of data. Typical word size is 1, 2, or 4 bytes.

26
Q

first fit vs next fit

A

First fit looks in taken places trying to fill up. Next fit doesn’t attempt used holes.

27
Q

The role of the linker is to

A

combine all object files into a single executable file such as a.out on Linux systems or a .exe file on Windows systems. The loader can then load the executable file into memory and make it available to run on a CPU core.

28
Q

External memory fragmentation is the

A

loss of usable memory space due to holes between allocated blocks of variable sizes.

29
Q

The 50% rule states that, if the

A

probability of finding an exact match for a request approaches 0, one third of all memory partitions are holes and two thirds are occupied blocks.

30
Q

The 50% rule talks only about the number of holes and blocks but not the amount of

A

memory occupied by each. Memory utilization depends on the average sizes of holes and occupied blocks.

31
Q

A page table is an

A

array that keeps track of which pages of a given logical address space reside in which page frames.

32
Q

A page frame is a

A

fixed-size contiguous block of physical memory identified by a single number, the page frame number.

33
Q

A segment is a

A

variable-size block of a logical address space identified by a single number, the segment number.

34
Q

A segment table is an

A

array that keeps track of which segment resides in which area of physical memory.

35
Q

A translation lookaside buffer (TLB) is a

A

fast associative memory buffer that maintains recent translations of logical addresses to frames in physical memory for faster retrieval.

36
Q

The principle of locality states that

A

locations accessed recently are more likely to be accessed again than locations accessed in the distant past.