Midterm 26-50 Flashcards

1
Q

What are the primary and secondary memory layers?

A

Primary/volatile:

  • registers
  • cache (SRAM)
  • main (DRAM)

Secondary/non-volatile:

  • solid-state disk (flash)
  • magnetic disk (electro-mechanical)
  • optical disk (DVD blue-ray)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the four categories of memories in terms of “access-type”?

A

RAM, SAM, DASD, CAM

Look these up beyond this simple answer!

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

What is the inclusion principle in the context of the memory hierarchy?

A

Content of layer 𝑖 of the hierarchy has to exist in layer 𝑖 + 1.

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

What are the four policies or questions in the management of a memory hierarchy?

A

1- placement policy
2- identification policy
3- replacement policy
4- update policy

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

What is “mapping” in the context of memory management?

A

Conversion of virtual addresses to physical addresses is called mapping.

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

What is address binding?

A

As a general definition, binding means mapping from one address space to another. Traditionally, binding is categorized into three groups: compile-time-binding, load-time-binding, and execution-time-binding.

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

Explain why load-time binding is not “dynamically relocatable” and why execution-time binding is dynamically relocatable.

A

Load time binding: The compiler translates symbolic addresses to relative (relocatable) addresses. The loader translates these to absolute addresses. If it is not known at compile time where the process will reside in memory, then the compiler must generate relocatable code. This is done once, and swapping cannot be performed, which makes the method static.

Execution time binding: If the process can be moved during its execution from one memory segment to another, then binding must be delayed until run time. The absolute addresses are generated by hardware. Most general- purpose OSs use this method (Dynamic).

Static-binding means locations are determined before execution. Dynamic- binding means locations are determined during execution.

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

What are “logical” and “physical” addresses?

A

Logical address are addresses generated by a program and sent to the CPU; also referred to as virtual address.

Physical addresses are addresses seen by the memory unit assigned to a program depending on where the program resides in the main memory.

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

What is the job of the memory management unit (MMU)?

A

The run-time mapping from virtual to physical addresses is performed by hardware called the memory-management unit (MMU).

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

What is dynamic relocation?

A

Dynamic relocation is the process of relocating data or code currently in the computer memory to other parts of the computer, creating more efficient memory storage while a program is still active.

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

What are the minimum hardware requirements of an MMU for a dynamic relocation?

A

A relocation register.

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

Which type of program benefits most from dynamic relocation?

A

In some programs, a significant portion of the code is used for rare cases, and only a small piece of the code is frequently used. For such applications, dynamic relocation can be used efficiently. Such applications are known as 20-80, which means that 20% of the code is used 80% of the time.

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

What is a stub?

A

Stub is used for dynamic linking where linking is postponed until execution time. A stub is a small piece of code used to locate the appropriate memory-resident library routine. Stub replaces itself with the address of the library routine and executes the routine.

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

What is the “Contiguous allocation” of memory?

A

Contiguous allocation means the allocation of a contiguous region of the main memory to a program.

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

Why is segmentation considered as “Contiguous” and paging is considered as “non-Contiguous”?

A

Segmentation allocates one piece of memory, called a segment, to one program. In paging, different parts of the memory, called pages, could contain a part of a program. These pages could be non- contiguous.

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

What are the elements of the two-tuple that a segment is referred by?

A

Segment number and offset.

17
Q

What are the minimum hardware requirements in a multiprogramming system to ensure each program only accesses its own memory space? Draw a simple block diagram for this protection system.

A

Base register and limit register are needed.

Draw a diagram.

(Review Q 42).

18
Q

a) How could we define efficiency in a “variable partitioning” memory system?
b) What happens when a new process arrives?
c) What happens when the process exists?
d) What kind of information does the OS maintain in such a system?

A

a) The percentage of occupied memory, when there is no room for a new process, is the efficiency. The higher this percentage, the lower is the size of useless fragments.
b) When a process arrives, it is allocated memory from a hole large enough to accommodate it.
c) The exiting process frees its partition. Adjacent accessible partitions are combined.
d) OS maintains information about: allocated partitions, and free partitions (holes)

19
Q

What strategies are possible for “placement policy” in a “dynamic allocation” memory system?

A

First fit, best fit, worst fit.

20
Q

What are the two types of memory fragmentation?

A

Internal fragmentation and external fragmentation.

21
Q

Which type of fragmentation occurs in the Contiguous allocation system?

A

External fragmentation occurs in between segments.

22
Q

True or false?: The 50-percent rule states that 50% of memory is lost to external fragmentation when the first-fit policy is used. Explain your answer.

A

False. 50% rule means that 50% of the occupied space is useless fragments. Hence, if segments occupy N bytes, then N/2 bytes are fragments, which is 1/3 of the total memory space.

23
Q

What is a solution for memory fragmentation? What are the prerequisites of such a remedy, and what are the problems?

A

Compaction is the solution. It requires that the code and data be relocatable.

PROBLEMS????

24
Q

How does the “paging” system partition a program? Does it have to bring the whole program into the memory?

A

Page size is a power of 2. In paging, only one page of a program or data has to bring into the memory. Other parts of the code or data are brought into the memory as they are needed.

25
Q

What is the difference between a “frame” and a “page”?

A

Frame and page are of the same size. A frame is referred to as a physical piece of memory, and a page is referred to as the virtual address space.