Operating System Concepts - Assignment 5 | CGS 3763, Assignments of Operating Systems

Material Type: Assignment; Class: Operating System Concepts; Subject: Computer General; University: University of Central Florida; Term: Spring 2004;

Typology: Assignments

Pre 2010

Uploaded on 11/08/2009

koofers-user-ng4
koofers-user-ng4 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Operating System Concepts
CGS 3763, Spring 2004
Homework Assignment #5
Due Wednesday, April 14th Name _________________
(at beginning of class)
Please read the following certification and sign where indicated:
I hereby certify that the answers I am submitting for this homework assignment are my own and
that I have not obtained answers from any other student. I also certify that I have not provided
my answers to any other student to copy or use as the basis for his/her homework. I understand
that cheating on this or any other assignment or test will immediately result in a score of “0” for
the assignment in addition to possible disciplinary action by the University. I also acknowledge
that I have read and understand the University’s policies regarding “Student Academic
Behavior” as provided at www.ucf.edu/goldenrule.
_________________________________
Student Signature
1) (5 pts) Segmentation is a memory management scheme that does not reflect the programmer’s
view of memory?
TRUE FALSE
2) (5 pts) Segmentation looks similar to contiguous allocation with multiple dynamic partitions if
an entire program is treated as a single segment.
TRUE FALSE
3) (5 pts) Segmentation requires which of the following:
a. Unique hardware for address translation
b. Special compilers to divide programs into segments and generate two-tuple logical
addresses (<segment, offset>).
c. The ability for the OS to track free space in the system (e.g., free space table)
d. External fragments to keep the segments separated.
e. none of the above.
4) (10 pts) Small page tables (and segment tables) can be kept in fast registers for quick reference.
If the number of pages for a particular process is large, the page table must be stored in
memory. Assuming a page table is in memory and there is no TLB, how many memory
accesses are required for each logical address referenced? What is retrieved during each
access?
Two (2) memory accesses are required for each referenced logical address:
1) The first access retrieves the page table entry (frame).
2) After computing the physical address (frame + offset), the second access retrieves the
actual data or instruction required by the program
pf3
pf4

Partial preview of the text

Download Operating System Concepts - Assignment 5 | CGS 3763 and more Assignments Operating Systems in PDF only on Docsity!

Operating System Concepts

CGS 3763, Spring 2004

Homework Assignment

Due Wednesday, April 14th Name _________________

(at beginning of class)

Please read the following certification and sign where indicated:

I hereby certify that the answers I am submitting for this homework assignment are my own and

that I have not obtained answers from any other student. I also certify that I have not provided

my answers to any other student to copy or use as the basis for his/her homework. I understand

that cheating on this or any other assignment or test will immediately result in a score of “0” for

the assignment in addition to possible disciplinary action by the University. I also acknowledge

that I have read and understand the University’s policies regarding “Student Academic

Behavior” as provided at www.ucf.edu/goldenrule.

_________________________________

Student Signature

1) (5 pts) Segmentation is a memory management scheme that does not reflect the programmer’s view of memory? TRUE **FALSE

  1. (5 pts) Segmentation looks similar to contiguous allocation with multiple dynamic partitions if an entire program is treated as a single segment. TRUE** FALSE 3) (5 pts) Segmentation requires which of the following: a. Unique hardware for address translation b. Special compilers to divide programs into segments and generate two-tuple logical addresses (<segment, offset>). c. The ability for the OS to track free space in the system (e.g., free space table) d. External fragments to keep the segments separated. e. none of the above. 4) (10 pts) Small page tables (and segment tables) can be kept in fast registers for quick reference. If the number of pages for a particular process is large, the page table must be stored in memory. Assuming a page table is in memory and there is no TLB, how many memory accesses are required for each logical address referenced? What is retrieved during each access? _Two (2) memory accesses are required for each referenced logical address:
  2. The first access retrieves the page table entry (frame).
  3. After computing the physical address (frame + offset), the second access retrieves the actual data or instruction required by the program_

5) (10 pts) A process has associated with it the following table. For each logical address shown indicate if the address is legal. If it is, compute the physical address. Addresses are in the form <p, d>. Assume each page/frame is 1000 bytes in size. Page # Frame # 0 24 1 14 2 6 3 55 Logical Address < 0, 321 > Is it legal? ___ Y ___ Physical Address ___ 24321 ____ (24 * 1000 + 321) Logical Address < 1, 3100 > Is it legal? ___ N ___ Physical Address ____________ (Displacement of 6100 is greater than size of one page) Logical Address < 4, 754 > Is it legal? ___ N ___ Physical Address ____________ (Page 4 is invalid. Does not appear in the page table) Logical Address < 2, 208 > Is it legal? ___ Y ___ Physical Address ___ 6208 _____ (6 * 1000 + 208) Logical Address < 3, 0 > Is it legal? ___ Y ___ Physical Address ___ 55000 ___ (55 * 1000 + 0) 6) (10 pts) The same page table as the previous problem. What happens when the size of the page is increased to 4000 bytes per page? Logical Address < 0, 321 > Is it legal? ___ Y ___ Physical Address ___ 96,321 _____ (24 * 4000 + 321) Logical Address < 1, 3100 > Is it legal? ___ Y ___ Physical Address ___ 59,100 ______ (14 * 4000 + 321) Logical Address < 4, 754 > Is it legal? ___ N ___ Physical Address ____________ (Page 4 is invalid. Does not appear in the page table) Logical Address < 2, 208 > Is it legal? ___ Y ___ Physical Address ___ 24,208 _____ (6 * 4000 + 208) Logical Address < 3, 0 > Is it legal? ___ Y ___ Physical Address ___ 220,000 ___ (55 * 4000 + 0)

9) (15 pts) For this problem, assume we are working with a decimal (base 10) computer. Given a paged memory system where:each page contains 100 bytes (10^2 ),the physical memory contains a total of 1,000,000 bytes (10^6 ), andlogical memory (a program’s maximum logical address space) consists of 10,000 bytes (10^4 ). What is the maximum number of pages that can be used by a program? 104 / 10^2 = 10^2 or 100 pages How many frames are in the system? 106 / 10^2 = 10^4 or 10,000 frames Number of frames is equal to the size of physical memory (1,000,000) divided by the size of a frame (100). Since frames and pages must be equal in size, a frame for this question is 100 bytes in size. If every process that executes uses the maximum number of pages possible, what is the degree of multiprogramming in the system? 104 / 10^2 = 10^2 or 100 concurrent processes Divide the number of frames in the system (10,000) by the maximum pages per process (100) to get the maximum number of concurrent programs possible. **10) (5 pts) Pointers to page tables are kept where? ___________in a process’ PCB____________

  1. (5 pts) If paging is so complicated to implement, why do we bother with it?** The primary benefits of paging are an increase in memory utilization and therefore a higher degree of multiprogramming. This allows us to better utilize the CPU as well as other system resources.