Operating System Lecture Nine: DR Jamal Altuwaijari
Operating System Lecture Nine: DR Jamal Altuwaijari
Lecture nine
part1
Dr jamal altuwaijari
9. Memory Management
9.1 Introduction.
The organization and management of the main memory or primary, or real memory of
a CIS has been one of most important factors influencing 0/S design, programs and data
need to be in main storage in order to be executed or referenced, and if they do not
needed immediately may be kept on secondary storage media such as tapes or disk
until needed and then brought into the main storage for execution or reference.
The figure 9.1 show the typical storage hierarchy.
a User
b Un used
Now we have two different types of addresses logical addresses 0 —> mix
and physical addresses R+0 —> R ÷ max (R fence value). The user only generate
the logical addresses.
9.4.3 Overlays allocation methods
The size of program (process) can be larger than the a mount of
memory
allocated to it, a technique called overlays is sometimes used. The idea
of
overlays is to keep in memory only those instruction and data that are
needed at
any given time. When other instruction are needed they are loaded
into space
that was occupied previously by instruction that are no longer needed.
9.4.3 Overlays allocation methods
. Example
Consider a two—pass assembler:' During pass 1 it constructs symbol table
then during pass 2 it generates – inachine — languages code. We may able to
partition such as assembler into pass I code, pass 2 code the symbol table and
common support routines used by both pass 1 and pass 2. Assume the size of
these components are as follows:
Pass 1 = 70 KB.
Pass 2 = SO KB
S. Table = 20 KB.
Common routines = 30 KB
To load every thing at once we require 200 KB of memory. If only 150 KB
is available we cannot run our process. But that pass I and pass 2 do not used to
be in memory at the same time, so we can define two overlays:
A =Pass 1+ S.T.+ C.R = SO + 20 + 30 = 130
B= Pass 2+ S.T.+ C.R = 70 + 20 + 30 = 120
9.4.3 Overlays allocation methods
2K
6K
12K