قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
Table of Contents
........................................................................ 3
.................................................................. 3
..................................................... 4
Process Address Space .................................................. 5
............................................... 6
................................................ 6
Swapping ..................................................................... 7
......................................................... 8
Fragmentation ............................................................. 9
Paging ....................................................................... 10
Address Translation .................................................... 11
.......................... 12
............................................................... 13
........................................................... 14
............................................... 15
.................................................. 16
قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
MEMORY MANAGEMENT
قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
الحاسبات: قسم الهندسة
. A : الشعبة الثالثة: المرحلة كلية الهندسة الجامعة المستنرصية صادق طاهر دويـ ــخ: االس ـ ـ ـ ـ ـم
Process Address Space
The process address space is the set of logical addresses that a process references in its
code. For example, when 32-bit addressing is in use, addresses can range from 0
to0x7fffffff; that is, 2^31 possible numbers, for a total theoretical size of 2 gigabytes.
The operating system takes care of mapping the logical addresses to physical addresses
at the time of memory allocation to the program. There are three types of addresses used
in a program before and after memory is allocated
S. N Memory Addresses & Description
1 Symbolic addresses
The addresses used in a source code. The variable names, constants, and
instruction labels are the basic elements of the symbolic address space.
2 Relative addresses
At the time of compilation, a compiler converts symbolic addresses into
relative addresses.
3 Physical addresses
The loader generates these addresses at the time when a program is
loaded into main memory.
Virtual and physical addresses are the same in compile-time and load-time address-binding
schemes. Virtual and physical addresses differ in execution-time address-binding scheme.
The set of all logical addresses generated by a program is referred to as a logical address
space the set of all physical addresses corresponding to these logical addresses is referred to
as a physical address space
. The runtime mapping from virtual to physical address is done by the memory management
unit (MMU) which is a hardware device. MMU uses the following mechanism to convert
virtual address to physical address.
1. The value in the base register is added to every address generated by a user process,
which is treated as offset at the time it is sent to memory. For example, if the base
register value is 10000, then an attempt by the user to use address location 100 will be
dynamically reallocated to location 10100.
قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
2. The user program deals with virtual addresses; it never sees the real physical addresses.
قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
Swapping
.
الحاسبات: قسم الهندسة
. A : الشعبة الثالثة: المرحلة كلية الهندسة الجامعة المستنرصية صادق طاهر دويـ ــخ: االس ـ ـ ـ ـ ـم
S. N Memory Allocation & Description
Single-partition allocation
In this type of allocation, relocation-register scheme is used to protect
user processes from each other, and from changing operating-system
1 code and data. Relocation register contains value of smallest physical
address whereas limit register contains range of logical addresses. Each
logical address must be less than the limit register.
Multiple-partition allocation
In this type of allocation, main memory is divided into a number of
fixed-sized partitions where each partition should contain only one
2
process. When a partitionis free, a process is selected from the input
queue and is loaded into the free partition. When the process
terminates, the partition becomes available for another process.
الحاسبات: قسم الهندسة
. A : الشعبة الثالثة: المرحلة كلية الهندسة الجامعة المستنرصية صادق طاهر دويـ ــخ: االس ـ ـ ـ ـ ـم
Fragmentation
S. N Fragmentation & Description
1 External fragmentation
Total memory space is enough to satisfy a request or to reside a process in it,
but it is not contiguous, so it cannot be used
2 Internal fragmentation
Memory block assigned to process is bigger. Some portion of memory is left
unused, as it cannot be used by another process.
.
قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
Paging
الحاسبات: قسم الهندسة
. A : الشعبة الثالثة: المرحلة كلية الهندسة الجامعة المستنرصية صادق طاهر دويـ ــخ: االس ـ ـ ـ ـ ـم
Address Translation
Page address is called logical address and represented by page number and the offset
Logical Address = Page number + page offset
Frame address is called physical address and represented by frame number and the
offset
Physical Address = Frame number + page offset
A data structure called page map table is used to keep track of the relation between a
page of a process to a frame in physical memory.
قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
.
قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
.
قسم الهندسة :الحاسبات
الشعبة . A : المرحلة :الثالثة كلية الهندسة الجامعة المستنرصية االس ـ ـ ـ ـ ـم :صادق طاهر دويـ ــخ
.
الحاسبات: قسم الهندسة
. A : الشعبة الثالثة: المرحلة كلية الهندسة الجامعة المستنرصية صادق طاهر دويـ ــخ: االس ـ ـ ـ ـ ـم
www.academia.edu
https://www.academia.edu/10481468/OS_-_PDF
https://www.inf.ed.ac.uk/teaching/courses/os/slides/09-memory16.pdf
https://www.researchgate.net/publication/332912311_MEMORY_MANAGEMENT_IN_COMPUTER_S
YSTEM
https://web.cs.wpi.edu/~cs3013/c07/lectures/Section08-Memory_Management.pdf
https://sites.ualberta.ca/~smartynk/Resources/CMPUT%20379/beck%20notes/memory.pdf
https://whatis.techtarget.com/definition/memory-management
https://en.wikipedia.org/wiki/Memory_management
https://www.cc.gatech.edu/~milos/yan_isca06.pdf
https://link.springer.com/article/10.1007/s13389-018-0180-2