GROUP 3
Computer Operating System Course 2020
MULTIPROGRAMMING WITH
PARTITIONS
In a multiprogramming system, in order to share the processor, a
number of processes must be kept in memory. Memory management
is achieved through memory management algorithms. Each memory
management algorithm requires its own hardware support.
In order to be able to load programs at any address in memory, the
compiler must generate relocatable object code. Also we must make
it sure that a program in memory, addresses only its own area, and
no other program’s area. Therefore, some protection mechanism is
also needed.
MULTIPROGRAMMING WITH
PARTITIONS
There are two types of Partitions namely Fixed and Variable partitions.
FIXED PARTITIONS
There are two types of Partitions namely Fixed and Variable
partitions.
In this method, memory is divided into partitions whose sizes
are fixed. OS is placed into the lowest bytes of memory.
Processes are classified on entry to the system according to
their memory they requirements. We need one Process Queue
(PQ) for each class of process.
Continued…
If a process is selected to allocate memory, then it goes into
memory and competes for the processor. The number of fixed
partition gives the degree of multiprogramming. Since each
queue has its own memory region, there is no competition
between queues for the memory
VARIABLE PARTITIONING
With fixed partitions we have to deal with the problem of
determining the number and sizes of partitions to minimize
internal and external fragmentation. If we use variable
partitioning instead, then partition sizes may vary dynamically.
In the variable partitioning method, we keep a table (linked
list) indicating used/free areas in memory. Initially, the whole
memory is free and it is considered as one large block. When a
new process arrives, the OS searches for a block of free
memory large enough for that process. We keep the rest
available (free) for the future processes.
Variable partitioning: 3 types of searching algorithms
If a block becomes free, then the OS tries to merge it with its
neighbors if they are also free. There are three algorithms for
searching the list of free blocks for a specific amount of memory.
First Fit : Allocate the first free block that is large enough for the
new process. This is a fast algorithm.
Best Fit : Allocate the smallest block among those that are large
enough for the new process. In this method, the OS has to search
the entire list, or it can keep it sorted and stop when it hits an
entry which has a size larger than the size of new process. This
algorithm produces the smallest left over block. However, it
requires more time for searching all the list or sorting it
Variable partitioning: 3 types of searching algorithms
Worst Fit : Allocate the largest block among those that are large
enough for the new process. Again a search of the entire list or
sorting is needed. This algorithm produces the largest over block.
CONTIGUOUS MEMORY ALLOCATION
In contiguous memory allocation each process is allocated a single
contiguous area in memory
Issues: Memory protection, Relocation, Avoid Fragmentation
- Faces the problem of memory fragmentation
- Apply techniques of memory compaction and reuse in dynamic
. Compaction requires a relocation register
. Swapping
…cont
Main memory must support both OS and user processes
• Limited resource, must allocate efficiently
• Contiguous allocation is one early method
• Main memory usually into two partitions:
- Resident operating system, usually held in low memory with
interrupt vector
- User processes then held in high memory
-Each process contained in single contiguous section of memory
…cont
Multiple partitions for multiple processes
• Relocation register and limit registers to protect
processes from one another (and protect OS code)
• Both registers are part of process context (i.e., PCB)
• Relocation register contains value of smallest
physical address
• Limit register contains range of logical addresses
• Each logical address must be less than the limit
register.
…cont
GROUP NAMES
KAWINA MARY 18428
CHIPENGE ALICE 18442
MBEWE EMMA 18445
MUSEYA RACHEAL 18465
CHIIMA NAMOONGA 18467
SOMBELA PETER 18395
KALEYA ANDREW 18418
MWALE GEORGE 18450
MONDO MULENGA 18462
NGULUBE MAMBO 17249