• Home
  • Textbooks
  • Operating System Concepts Essentials
  • Main Memory

Operating System Concepts Essentials

Abraham Silberschatz, Peter B. Galvin, Greg Gagne

Chapter 7

Main Memory - all with Video Answers

Educators


Chapter Questions

Problem 1

Name two differences between logical and physical addresses.

Check back soon!
02:02

Problem 2

Consider a system in which a program can be separated into tw parts: code and data. The CPU knows whether it wants an instructio (instruction fetch) or data (data fetch or store). Therefore, two base limit register pairs are provided: one for instructions and one for data The instruction base-limit register pair is automatically read-only, s programs can be shared among different users. Discuss the advantage and disadvantages of this scheme.

James Kiss
James Kiss
Numerade Educator
02:01

Problem 3

Why are page sizes always powers of 2?

Jennifer Hudspeth
Jennifer Hudspeth
Numerade Educator
00:55

Problem 4

Consider a logical address space of 64 pages of 1,024 words each, mapped onto a physical memory of 32 frames.
a. How many bits are there in the logical address?
b. How many bits are there in the physical address?

Vysakh M
Vysakh M
Numerade Educator
00:57

Problem 5

What is the effect of allowing two entries in a page table to point to the same page frame in memory? Explain how this effect could be used to decrease the amount of time needed to copy a large amount of memory from one place to another. What effect would updating some byte on the one page have on the other page?

Kashif Qureshi
Kashif Qureshi
Numerade Educator
04:32

Problem 6

Describe a mechanism by which one segment could belong to the address space of two different processes.

Shiksha Dutta
Shiksha Dutta
Numerade Educator
01:17

Problem 7

Sharing segments among processes without requiring that they have the same segment number is possible in a dynamically linked segmentation system.
a. Define a system that allows static linking and sharing of segments without requiring that the segment numbers be the same.
b. Describe a paging scheme that allows pages to be shared without requiring that the page numbers be the same.

James Kiss
James Kiss
Numerade Educator
02:00

Problem 8

In the IBM/370, memory protection is provided through the use of keys. A key is a 4-bit quantity. Each 2-K block of memory has a key (the storage key) associated with it. The CPU also has a key (the protection key) associated with it. A store operation is allowed only if both keys are equal or if either is zero. Which of the following memory-management schemes could be used successfully with this hardware?
a. Bare machine
b. Single-user system
c. Multiprogramming with a fixed number of processes
d. Multiprogramming with a variable number of processes
e. Paging
f. Segmentation

James Kiss
James Kiss
Numerade Educator
00:43

Problem 9

Explain the difference between internal and external fragmentation.

Vipender Yadav
Vipender Yadav
Numerade Educator

Problem 10

Consider the following process for generating binaries. A compiler is used to generate the object code for individual modules, and a linkage editor is used to combine multiple object modules into a single program binary. How does the linkage editor change the binding of instructions and data to memory addresses? What information needs to be passed from the compiler to the linkage editor to facilitate the memory-binding tasks of the linkage editor?

Check back soon!

Problem 11

Given five memory partitions of $100 \mathrm{~KB}, 500 \mathrm{~KB}, 200 \mathrm{~KB}, 300 \mathrm{~KB}$, and 600 $\mathrm{KB}$ (in order), how would the first-fit, best-fit, and worst-fit algorithms place processes of $212 \mathrm{~KB}, 417 \mathrm{~KB}, 112 \mathrm{~KB}$, and $426 \mathrm{~KB}$ (in order)? Which algorithm makes the most efficient use of memory?

Check back soon!

Problem 12

Most systems allow a program to allocate more memory to its address space during execution. Allocation of data in the heap segments of programs is an example of such allocated memory. What is required to support dynamic memory allocation in the following schemes?
a. Contiguous memory allocation
b. Pure segmentation
c. Pure paging

Check back soon!

Problem 13

Compare the memory organization schemes of contiguous memory allocation, pure segmentation, and pure paging with respect to the following issues:
a. External fragmentation
b. Internal fragmentation
c. Ability to share code across processes

Check back soon!
01:22

Problem 14

On a system with paging, a process cannot access memory that it does not own. Why? How could the operating system allow access to other memory? Why should it or should it not?

Adam Conner
Adam Conner
Numerade Educator
View

Problem 15

Compare paging with segmentation with respect to the amount of memory required by the address translation structures in order to convert virtual addresses to physical addresses.

James Kiss
James Kiss
Numerade Educator
03:28

Problem 16

Program binaries in many systems are typically structured as follows. Code is stored starting with a small, fixed virtual address, such as 0 . The code segment is followed by the data segment that is used for storing the program variables. When the program starts executing, the stack is allocated at the other end of the virtual address space and is allowed to grow toward lower virtual addresses. What is the significance of this structure for the following schemes?
a. Contiguous memory allocation
b. Pure segmentation
c. Pure paging

Shelby Mohamed
Shelby Mohamed
Numerade Educator
01:02

Problem 17

Assuming a 1-KB page size, what are the page numbers and offsets for the following address references (provided as decimal numbers):
a. 2375
b. 19366
c. 30000
d. 256
e. 16385

Vysakh M
Vysakh M
Numerade Educator
00:55

Problem 18

Consider a logical address space of 32 pages with 1,024 words per page, mapped onto a physical memory of 16 frames.
a. How many bits are required in the logical address?
b. How many bits are required in the physical address?

Vysakh M
Vysakh M
Numerade Educator
00:55

Problem 19

Consider a computer system with a 32-bit logical address and 4-KB page size. The system supports up to $512 \mathrm{MB}$ of physical memory. How many entries are there in each of the following?
a. A conventional single-level page table
b. An inverted page table

Vysakh M
Vysakh M
Numerade Educator
01:47

Problem 20

Consider a paging system with the page table stored in memory.
a. If a memory reference takes 200 nanoseconds, how long does a paged memory reference take?
b. If we add TLBs, and 75 percent of all page-table references are found in the TLBs, what is the effective memory reference time? (Assume that finding a page-table entry in the TLBs takes zero time if the entry is there.)

James Kiss
James Kiss
Numerade Educator

Problem 21

Why are segmentation and paging sometimes combined into one scheme?

Check back soon!

Problem 22

Explain why sharing a reentrant module is easier when segmentation is used than when pure paging is used.

Check back soon!
02:24

Problem 23

Consider the following segment table:
$$
\begin{array}{|c|c|c|}
\hline \text { Segment } & \text { Base } & \text { Length } \\
\hline 0 & 219 & 600 \\
\hline 1 & 2300 & 14 \\
\hline 2 & 90 & 100 \\
\hline 3 & 1327 & 580 \\
\hline 4 & 1952 & 96 \\
\hline
\end{array}
$$
What are the physical addresses for the following logical addresses?
a. 0,430
b. 1,10
c. 2,500
d. 3,400
e. 4,112

James Kiss
James Kiss
Numerade Educator
01:03

Problem 24

What is the purpose of paging the page tables?

Sanchit Jain
Sanchit Jain
Numerade Educator

Problem 25

Consider the hierarchical paging scheme used by the VAX architecture. How many memory operations are performed when a user program executes a memory-load operation?
Chapter 7 Main Memory

Check back soon!

Problem 26

Compare the segmented paging scheme with the hashed page table scheme for handling large address spaces. Under what circumstances is one scheme preferable to the other?

Check back soon!
02:02

Problem 27

Consider the Intel address-translation scheme shown in Figure 7.22.
a. Describe all the steps taken by the Intel Pentium in translating a logical address into a physical address.
b. What are the advantages to the operating system of hardware that provides such complicated memory translation?
c. Are there any disadvantages to this address-translation system? If so, what are they? If not, why is this scheme not used by every manufacturer?

James Kiss
James Kiss
Numerade Educator

Problem 28

Assume that a system has a 32-bit virtual address with a 4-KB page size. Write a C program that is passed a virtual address (in decimal) on the command line and have it output the page number and offset for the given address. As an example, your program would run as follows:
./a.out 19986
Your program would output:
The address 19986 contains:
page number $=4$
of set $=3602$
Writing this program will require using the appropriate data type to store 32 bits. We encourage you to use unsigned data types as well.

Check back soon!