Docsity

Memory Management in Operating System - Assignment | CGS 3763, Assignments of Operating Systems

Partial preview of the text

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

Page 1

CGS 3763: Operating System Concepts

Spring 2006

Memory Management – Part 2

School of Electrical Engineering and Computer Science

University of Central Florida

Instructor :

Mark [email protected] 242, 823-2790http://www.cs.ucf.edu/courses/cgs3763/spr

Page 2 © Mark Llewellyn

Memory Management

Memory Management Methods

Contiguous Allocation

Non-Contiguous Allocation

Single Partition

Multiple Partition

Fixed

Allocation

DynamicAllocation

Segmentation

Paging

"Basic"Paging

DemandPaging

(Virtual Memory)

Page 4 Assignment of Process Pages to Free Frames

Page 5 Assignment of Process Pages to Free Frames

Page 7

Paging

(cont.)

When presented with a logical address (page number,offset), the processor uses the page table to produce aphysical address (page frame, offset).

The next page, illustrates the page tables for the processesin the previous example at the time illustrated by figure(f), which is shown again for continuity.

Page 8 © Mark Llewellyn

Page Tables for Example on Page 4

Process B currently hasno pages loaded in mainmemory

Page 10 © Mark Llewellyn

Paging – Address Translation Scheme

Address generated by CPU is divided into:

Page number (

p

– used as an index into a

page table

which

contains base address of each page in physical memory.

Page offset (d)

– combined with base address to define the

physical memory address that is sent to the memory unit

– For given logical address space 2

m

and page size 2

n
page number
page offset
p
d
m - n
n

Page 11

Paging Hardware

Page 13

Simple Paging Example

32-byte memory and 4-byte pages

Page 14

Free Frames

Before allocation
After allocation

CGS 3763: OS Concepts (Memory Management) Page 16

Associative Memory

• Associative memory – parallel search

Address translation (p, d)– If p is in associative register, get frame # out– Otherwise get frame # from page table in memory

Page # Frame #

Page 17

Paging Hardware With TLB

CGS 3763: OS Concepts (Memory Management) Page 19

Memory Protection

Memory protection implemented by associating protection bitwith each frame.

Valid-invalid bit attached to each entry in the page table:

– “valid” indicates that the associated page is in the process’

logical address space, and is thus a legal page

– “invalid” indicates that the page is not in the process’ logical

address space

Page 20

Valid (v) or Invalid (i) Bit In A Page Table