Lecture 16 Virtual Memory - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Lecture 16 Virtual Memory

Description:

Operating system maintains a page table for each process ... first fit/best fit. external fragmentation. From Operating System Concepts. Silberschatz & Galvin ... – PowerPoint PPT presentation

Number of Views:294
Avg rating:3.0/5.0
Slides: 15
Provided by: eam80
Category:

less

Transcript and Presenter's Notes

Title: Lecture 16 Virtual Memory


1
Lecture 16Virtual Memory
  • Paging
  • Segmentation

2
Virtual Memory as a Solution
  • A possible solution to the external fragmentation
    problem is to permit the logical address space of
    a process to be noncontiguous.
  • Virtual memory is also a solution to the problem
    that the combined size of the program, data and
    stack may exceed the amount of physical memory
    available for it

3
Paging
  • Frames
  • Physical memory is broken into fixed-sized
    blocks.
  • Pages
  • Logical memory is also broken into blocks of the
    same size
  • When a process is to be executed, its pages are
    loaded into any available memory frames from the
    backing store.

4
Paging (cont)
  • Operating system maintains a page table for each
    process
  • contains the frame location for each page in the
    process
  • memory address consist of a page number and
    offset within the page

5
Paging
From Operating Systems Internals and Design
Principles. W. Stalling
6
Page Tables for the Example
From Operating Systems Internals and Design
Principles. W. Stalling
7
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.

From Operating System Concepts. Silberschatz
Galvin
8
Address Translation Architecture
From Operating System Concepts. Silberschatz
Galvin
9
Segmentation
  • Memory-management scheme that supports user view
    of memory.
  • A program is a collection of segments. A segment
    is a logical unit such as
  • main program,
  • procedure,
  • function,
  • local variables, global variables,
  • common block,
  • stack,
  • symbol table, arrays From Operating
    System Concepts. Silberschatz Galvin

10
Logical View of Segmentation
From Operating System Concepts. Silberschatz
Galvin
11
Segmentation Architecture
  • Logical address consists of ltsegment-number,
    offsetgt
  • Segment table maps two-dimensional physical
    addresses each table entry has
  • base contains the starting physical address
    where the segments reside in memory.
  • limit specifies the length of the segment.
  • Segment-table base register (STBR) points to the
    segment tables location in memory.
  • Segment-table length register (STLR) indicates
    number of segments used by a program
  • segment number s is legal if s
    lt STLR. From Operating System Concepts.
    Silberschatz Galvin

12
Segmentation Architecture (Cont.)
  • Relocation.
  • dynamic
  • by segment table
  • Sharing.
  • shared segments
  • same segment number
  • Allocation.
  • first fit/best fit
  • external fragmentation

From Operating System Concepts. Silberschatz
Galvin
13
Segmentation Architecture (Cont.)
  • Protection. With each entry in segment table
    associate
  • validation bit 0 ? illegal segment
  • read/write/execute privileges
  • Protection bits associated with segments code
    sharing occurs at segment level.
  • Since segments vary in length, memory allocation
    is a dynamic storage-allocation problem.
  • A segmentation example is shown in the following
    diagram
  • From Operating System Concepts. Silberschatz
    Galvin

14
Sharing of segments
From Operating System Concepts. Silberschatz
Galvin
Write a Comment
User Comments (0)
About PowerShow.com