DOC PREVIEW
U of I CS 241 - LECTURE NOTES

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS241 Section: Week 101Topics• LMP2 changes• Problem solving session: Memory2LMP2 Changes• In .c and .h file, change the return type of my_mwrite to int, instead of void• In the tester programs, change the following line:–sprintf(filename[i], "file%d", i+1); –sprintf(filename[i], "file%d", i+1); to– sprintf(filename[i], "tester/file%d", i+1);• File map table: initialization and maintenance may be done in the encrypt and decrypt function3Memory: Problem Solving SessionSession4Problem 1Consider a system in which the memory has the following hole sizes inthe following memory order:1KB, 4 KB, 15 KB, 20 KB, 4 KB, 7 KB, 18 KB, 12 KB, 15 KB, 9 KBYou are given successive requests for program segments in thefollowing order:10KB,5KB,3KB,2KB,19KB,9KB,24KB,10KB.10KB,5KB,3KB,2KB,19KB,9KB,24KB,10KB.For each of the following algorithms, show how the holes get filled foreach of the above requests. If a particular request cannot be satisfied,you can skip it (but do mention which ones cannot be satisfied):– First fit– Best fit– Worst fit– Next fit5Problem 2For each of the following decimal virtual addresses, compute the virtual page number and offset for a 4 KB page and for and 8 KB page: 20000, 32768, 60000.page: 20000, 32768, 60000.6Problem 3Consider the page table of the figure. Give the physical address corresponding to each of the following virtual addresses:– 29–4100–4100– 83007Problem 4A machine has 48 bit virtual addresses and 32bit physical addresses. Pages are 8 KB. Howmany entries are needed for the page table?8Problem 5Consider a machine such as the DEC Alpha 21064which has 64 bit registers and manipulates 64-bitaddresses.Ifthepagesizeis8KB,howmanybitsofvirtualpageIfthepagesizeis8KB,howmanybitsofvirtualpagenumber are there?If the page table used for translation from virtual tophysical addresses were 8 bytes per entry, how muchmemory is required for the page table and is thisamount of memory feasible?9Problem 6A computer with a 32-bit address uses a two-level page table. Virtual addresses are split into 9-bit top-level page table field, an 11 bit second-level page table field, and an offset. second-level page table field, and an offset. How large are the pages and how many are there in the address space?10Problem 7Virtual Address (bits)Page Size # of Page Frames# of Virtual PagesOffset Length(bits)Addressable Physical MemoryFill in the following table:(bits)(bits)Memory16 256 B 2^232 1 MB 2^432 1 KB 2^864 16 KB 2^2064 8 MB 2^1611Problem 8Fill in this table with the correct page evictions. Physical memory contains 4 pages.Page Accesses0 1 2 3 4 1 3 4 4 5 3 1 2 0 4 5 4AccessesOptimal - - - - 0 - - - - 4 - - - 3 2 - -FIFO - - - -LRU - - - -LFU - - - -MRU - - -


View Full Document

U of I CS 241 - LECTURE NOTES

Documents in this Course
Process

Process

28 pages

Files

Files

37 pages

File I/O

File I/O

52 pages

C Basics

C Basics

69 pages

Memory

Memory

23 pages

Threads

Threads

14 pages

Lecture

Lecture

55 pages

C Basics

C Basics

24 pages

Signals

Signals

27 pages

Memory

Memory

45 pages

Threads

Threads

47 pages

Threads

Threads

28 pages

LECTURE

LECTURE

45 pages

Threads

Threads

30 pages

Threads

Threads

55 pages

Files

Files

37 pages

SIGNALS

SIGNALS

22 pages

Files

Files

37 pages

Threads

Threads

14 pages

Threads

Threads

13 pages

Load more
Download LECTURE NOTES
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view LECTURE NOTES and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view LECTURE NOTES 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?