Docsity

Virtual Memory Management: Midterm Preparation Material, Assignments of Operating Systems

Partial preview of the text

Download Virtual Memory Management: Midterm Preparation Material and more Assignments Operating Systems in PDF only on Docsity!

Virtual

Memory

Management

Klara^ Nahrstedt/Sam

King

October 5, 2007October

5,^2007

AdministrativeAdministrative

•^ Midterm

–^ October

8,^ Monday,

10 ‐10:50am

,^

y,

-^1304 SC

  • on‐campus

students

-^3405 SC

  • local^ Internet

students

T^ i• Topics^ –^ see^ newsgroup

for^ reading

list

-^ no VMM and memory management on midtermno^ VMM

and^ memory

management

on^ midterm

•^ HW

– deadline

October

5,^ Friday,

midnight

-^ Submission

on^ compass,

-^ Submission

format^

pdf or^ doc

-^ Length

  • as^ much

as^ you^ need

to^ explain

the^ problems

Memory

Management (

) (Review)

-^ Basic^ Memory

Management

-^ Mono‐programming

without^ Swapping

or^ Paging

-^ Multiprogramming

with^ Fixed

Partitions

-^ Swapping

bl– Variable^ Partitions

-^ Virtual

Memory^

Management

-^ PagingP^ T bl–^ Page^ Table –^ Multi‐level

Page^ Tables

-^ TLB^ – Translation

Lookaside Buffers

-^ Page Replacement Algorithms–^ Page^ Replacement

Algorithms

-^ Optimal •^ FIFO •^ Second^ ChanceLRU•^ LRU •^ Clock^ Page

Replacement

-^ Working^ Set

Basic^ Memory

Management

Monoprogramming

without^

Swapping

or^ Paging

Three simple ways of organizing memory Three^ simple

ways^ of

organizing

memory

‐^ an^ operating

system

with^ one

user^ process

Multiprogramming

with^

Fixed Partitions

-^ Fixed^ memory

partitions

-^ separate

input^ queues

for^ each^ partition

-^ single input queue single^ input

queue

Modeling

Multiprogramming^ Degree^ of^ multiprogramming

CPU^ utilization

as^ a^ function

of^ number

of^ processes

in^ memory

Relocation RegisterRelocation

Register Base RegisterBase RegisterBA

Memory

CPUInstruction^

MA

PhysicalAddress LogicalAddress^

Memory

InstructionAddress

MA^

MA+BA

ProtectionProtection

•^ Problem:Problem:^ –^ How

to^ prevent

a^ malicious

process

to^ write

or

jump into other user

's or OS partitions?

jump^ into

other^ user s

or^ OS^ partitions?

SwappingSwapping

•^ What is swapping?What

is^ swapping?

•^ Why

was^ swapping

introduced?

10/3/^

CS^ 423g^ ‐^ Operating

Systems,^ Klara Nahrstedt^

Variable

Partitions

and^ Fragmentation

Monitor^

Job 1^

Job 2^

Job 3^

Job 4^

Free

1 Monitor

Job 1^

Job 3^

Job 4^

Free

2 Monitor

Job 1^

Job 3^

Job 4^

Free

2 Monitor

Job 1^

Job 3^

Job 4^

Free

Job 5 3 Monitor

Job 3^

Job 4^

Free

Job 5^

Job 6

4 Monitor

Job 3^

Free

Job 5^

Job 6

Job 7^

Job 8

55^ Memory

wasted^ by

External

Fragmentation

10/3/^

CS^ 423g^ ‐^ Operating

Systems,^ Klara Nahrstedt^

Storage Placement StrategiesStorage

Placement

Strategies

•^ Analogy:Analogy:^ – Shoe

FittingValet parking

– Valet

parking

•^ Best

Fit Fi t Fit

•^ First

Fit

•^ Next

Fit.

•^ Worst

Fit.

Virtual

Memory

Virtual

Memory

h^

d f^

f h

The^ position

and^ function

of^ the

MMU

Paging

Request

1 Page Table

Real Memory

Request Page 3

3 1 2 Memory^

1 2 Page TableVM Frame^234 1 2

3 4

3 4

Virtual Memory Stored on Disk

Disk

1 2

3 4

5 6

7 8

Paging

1 Page Table

Real Memory

Request Page 1

3 1 1 2 Memory^

1 2 Page TableVM Frame^1 1 2

3 4

3 4

1 2 Virtual Memory Stored on Disk

3 4

Disk

1 2

3 4

5 6

7 8