Main Memory - II Tevfik Ko ar Louisiana State University March 27 - - PDF document

main memory ii
SMART_READER_LITE
LIVE PREVIEW

Main Memory - II Tevfik Ko ar Louisiana State University March 27 - - PDF document

CSC 4103 - Operating Systems Spring 2008 Lecture - XIV Main Memory - II Tevfik Ko ar Louisiana State University March 27 th , 2008 1 Paging Example 20 Users View of a Program 24 Segmentation Memory-management scheme that


slide-1
SLIDE 1

1

CSC 4103 - Operating Systems Spring 2008

Tevfik Koar

Louisiana State University

March 27th, 2008

Lecture - XIV

Main Memory - II

20

Paging Example

slide-2
SLIDE 2

24

User’s View of a Program

25

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, method,

  • bject,

local variables, global variables, common block,

slide-3
SLIDE 3

26

Logical View of Segmentation

1 3 2 4 1 4 2 3 user space physical memory space

27

Segmentation Architecture

  • Logical address consists of a two tuple:

<segment-number, offset>,

  • 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 table’s location in memory

  • Segment-table length register (STLR)

indicates number of segments used by a program;

slide-4
SLIDE 4

28

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

29

Address Translation Architecture

slide-5
SLIDE 5

30

Example of Segmentation Exercise

  • Consider the following segment table:
  • Segment Base

Length

  • 219
  • 600
  • 1

2300 14

  • 2

90 100

  • 3

1327 580

  • 4

1952 96 What are the physical addresses for the following logical addresses?

  • a. 1, 100
  • b. 2, 0
  • c. 3, 580

10

slide-6
SLIDE 6

Solution

  • Consider the following segment table:
  • Segment Base

Length

  • 219
  • 600
  • 1

2300 14

  • 2

90 100

  • 3

1327 580

  • 4

1952 96 What are the physical addresses for the following logical addresses?

  • a. 1, 100

illegal reference (2300+100 is not within segment limits)

  • b. 2, 0

physical address = 90 + 0 = 90

  • c. 3, 580

illegal reference (1327 + 580 is not within segment limits)

11 31

Sharing of Segments

slide-7
SLIDE 7

32

Segmentation with Paging

  • Modern architectures use segmentation with

paging (or paged-segmentation) for memory

33

MULTICS Address Translation Scheme

slide-8
SLIDE 8

15

Acknowledgements

  • “Operating Systems Concepts” book and supplementary

material by A. Silberschatz, P . Galvin and G. Gagne

  • “Operating Systems: Internals and Design Principles”

book and supplementary material by W. Stallings

  • “Modern Operating Systems” book and supplementary

material by A. Tanenbaum

  • R. Doursat and M. Yuksel from UNR