0% found this document useful (0 votes)
695 views185 pages

Operating System Bcs401 Complete Notes

Uploaded by

cvanshika979
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
695 views185 pages

Operating System Bcs401 Complete Notes

Uploaded by

cvanshika979
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 185

lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES
OS UNIT 1 - best notes unit 1 operating system student

Operating Systems (Dr. A.P.J. Abdul Kalam Technical University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Arman Ali ([email protected])
lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES
Operating System (OS) Unit-2

Operating Systems (Dr. A.P.J. Abdul Kalam Technical University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Arman Ali ([email protected])
lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES
Complete Unit- 3 (OS) - Operating System Unit 3 Full Notes

B.tech (Dr. A.P.J. Abdul Kalam Technical University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Arman Ali ([email protected])
lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S
Downloaded by Arman Ali ([email protected])
lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES
OS UNIT 4 - Very well explained notes of Operating System

B.tech (Dr. A.P.J. Abdul Kalam Technical University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Arman Ali ([email protected])
lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES

Downloaded by Arman Ali ([email protected]) Scanned by CamScanner


lOMoARcPSD|30415125

R
R
SI
M
Numerical on Paging

T
C
*Note: 210 = 1K, 220 = 1M, 230 = 1G, 240 = 1T, 250 = 1P

LA
SS
Type 01 Numerical: Address to Space/Memory Translation

ES
*Note: The total size of memory (to find) depends upon two values:
1. Number of locations the memory has (2n); where n is no of address bits
2. Size of Memory Location (if Size of Location is not given in question,
then by default we take it as 1Byte (1B) as our system is Byte Addressable.)*

Now, Size of memory = No. of Memory Location (2n) x Size of


Memory Location
Using the above information we can solve the numerical on address to space
translation
Q1. An address of 10 bits can support memory of how much size?
Sol:
Given Data:
No. of address bits (n) = 10bits

Therefore, no. of memory locations = 2n = 210


Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of memory = no. of memory locations x size of memory location
= 210 x 1B = 1KB (ans)
Q2. An address of 14 bits can support memory of how much size?
Sol:
Given Data:
No. of address bits (n) = 14bits

Therefore, no. of memory locations = 2n = 214


Size of memory location = 1B (by default, as it’s not given in question)

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Now, Size of memory = no. of memory locations x size of memory location

T
C
= 214 x 1B = 24 x 210 x 1B = 16 x 1K x 1B = 16KB (ans)

LA
Q3. An address of 22 bits can support memory of how much size, when the size

SS
of memory location is 2B?

ES
Sol:
Given Data:
No. of address bits (n) = 22bits

Therefore, no. of memory locations = 2n = 222


Size of memory location = 2B
Now, Size of memory = no. of memory locations x size of memory location
= 222 x 2B = 22 x 220 x 2B = 4 x 1M x 2B = 8MB (ans)

Q4. An address of 34 bits can support memory of how much size?


Sol:
Given Data:
No. of address bits (n) = 34bits

Therefore, no. of memory locations = 2n = 234


Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of memory = no. of memory locations x size of memory location
= 234 x 1B = 24 x 230 x 1B = 16 x 1G x 1B = 16GB (ans)

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Type 02 Numerical: Space/Memory to Address Translation

T
C
*Note: As we have seen above, the total size of memory depends upon two

LA
values:

SS
1. Number of locations the memory has (2n); where n (to find) is no of

ES
address bits
2. Size of Memory Location (if Size of Location is not given in question,
then by default we take it as 1Byte (1B) as our system is Byte Addressable.)*

w.k.t, Size of memory = No. of Memory Location (2 n) x Size of


Memory Location
now, No. of Memory Location (2n)= Size of memory/ Size of
Memory Location
and n (to find) =upper bound of Log2n
Using the above information we can solve the numerical on address to space
translation
Q1. A memory of 64KB can support an address of how many bits?
Sol:
Given Data:
Size if memory = 64KB
Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of memory = no. of memory locations x size of memory location
Therefore,
no. of memory locations (2n) = size of memory/size of memory location
= 64KB/1B = 64K = 26 x 210 = 216
Therefore n = 16bits (ans)
Q2. A memory of 32KB can support an address of how many bits?
Sol:
Given Data:

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Size if memory = 32KB

T
Size of memory location = 1B (by default, as it’s not given in question)

C
LA
Now, Size of memory = no. of memory locations x size of memory location

SS
Therefore,

ES
no. of memory locations (2n) = size of memory/size of memory location
= 32KB/1B = 32K = 25 x 210 = 215
Therefore n = 15bits (ans)
Q3. A memory of 256 MB can support an address of how many bits?
Sol:
Given Data:
Size if memory = 256MB
Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of memory = no. of memory locations x size of memory location
Therefore,
no. of memory locations (2n) = size of memory/size of memory location
= 256MB/1B = 256M = 28 x 220 = 228
Therefore n = 28bits (ans)
Q4. A memory of 16 GB can support an address of how many bits, when the size
of location is 4B?
Sol:
Given Data:
Size if memory = 16 GB
Size of memory location = 4B
Now, Size of memory = no. of memory locations x size of memory location
Therefore,
no. of memory locations (2n) = size of memory/size of memory location

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
= 16 GB/4B = 4G = 22 x 230 = 232

T
C
Therefore n = 32bits (ans)

LA
SS
ES

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Types 03 Numericals: To find number of Pages (Sec Memory) and

T
number of Frames (Main Memory) from Logical Address, Physical

C
LA
Address and Page Size.

SS
Steps to solve the numerical

ES
1. Find the size of Secondary Memory using given Logical Address (LA)
bits (numerical type 01)
2. Find the size of Main Memory using given Physical Address (PA) bits
(numerical type 01)
3. Using given Page Size, find the bits of instruction offset (d) of Logical
Address and Physical Address. (d is same in both address)
4. Using d, find the bits of p in Logical Address and f in Physical Address
5. Using the bits of p and d, find the number of pages and frames.
Q1. When LA= 24 bits, PA = 16bits and Page Size= 1KB, find the total
number of pages and frames in the system.
Sol.
Step 01: To find the size of Secondary Memory using given Logical
Address (LA) bits.
No. of LA bits (n) = 24bits

Therefore, no. of memory locations = 2n = 224


Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of secondary memory = no. of memory locations x size of memory
location
= 224 x 1B = 24 x 220 x 1B = 16 x 1M x 1B = 16MB
Step 02: To find the size of Main Memory using given Physical Address
(PA) bits.
No. of LA bits (n) = 16bits

Therefore, no. of memory locations = 2n = 216


Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of main memory = no. of memory locations x size of memory
location

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
= 216 x 1B = 26 x 210 x 1B = 64 x 1K x 1B = 64KB

T
C
Step 03: Using given Page Size, find the bits of instruction offset (d) of

LA
Logical Address and Physical Address. (d is same in both address)

SS
Page Size (size of memory) = 1KB

ES
Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of memory = no. of memory locations x size of memory location
Therefore,
no. of memory locations (2n) = size of memory/size of memory location
= 1KB/1B = 1K = 210
Therefore n = 10bits
i.e. d = n = 10bits
now the value of d in LA and also in PA is same i.e. 10bits
Step 04: Using d, find the bits of p in Logical Address and f in Physical
Address
w.k.t, LA= p+d
Therefore, p= LA-d = 24-10 bits = 14 bits
Also, w.k.t, PA= f+d
Therefore, f= PA-d = 16-10 bits = 6 bits
Step 05: Using the bits of p and d, find the number of pages and frames.
Now, p=14 bits
Therefore, no of pages (no. of locations) = 2p = 214 = 24 x 210 = 16K no of pages
approx. (ans)
Now, f=6 bits
Therefore, no of frames (no. of locations) = 2f = 26 = 64 no of frames approx.
(ans)

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Q2. When LA= 33 bits, PA = 24bits and Page Size= 2KB, find the total number

T
of pages and frames in the system.

C
LA
Sol.

SS
Step 01: To find the size of Secondary Memory using given Logical

ES
Address (LA) bits.
No. of LA bits (n) = 33bits

Therefore, no. of memory locations = 2n = 233


Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of secondary memory = no. of memory locations x size of memory
location
= 233 x 1B = 23 x 230 x 1B = 8 x 1G x 1B = 8GB
Step 02: To find the size of Main Memory using given Physical Address
(PA) bits.
No. of LA bits (n) = 24bits

Therefore, no. of memory locations = 2n = 224


Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of main memory = no. of memory locations x size of memory location
= 224 x 1B = 24 x 220 x 1B = 16 x 1M x 1B = 16KB
Step 03: Using given Page Size, find the bits of instruction offset (d) of
Logical Address and Physical Address. (d is same in both address)
Page Size (size of memory) = 2KB
Size of memory location = 1B (by default, as it’s not given in question)
Now, Size of memory = no. of memory locations x size of memory location
Therefore,
no. of memory locations (2n) = size of memory/size of memory location
= 2KB/1B = 2K = 21 x 210 = 211
Therefore n = 11bits

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
i.e. d = n = 11bits

T
C
now the value of d in LA and also in PA is same i.e. 11bits

LA
Step 04: Using d, find the bits of p in Logical Address and f in Physical

SS
Address

ES
w.k.t, LA= p+d
Therefore, p= LA-d = 33-11 bits = 22 bits
Also, w.k.t, PA= f+d
Therefore, f= PA-d = 24-11 bits = 13 bits
Step 05: Using the bits of p and d, find the number of pages and frames.
Now, p=22 bits
Therefore, no of pages (no. of locations) = 2 p = 222 = 22 x 220 = 4M no of pages
approx. (ans)
Now, f=13 bits
Therefore, no of frames (no. of locations) = 2f = 213 = 23 x 210 = 8K no of frames
approx. (ans)

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Types 04 Numerical: To find the total space/memory wasted in

T
maintaining the page table for all processes in the system or a

C
LA
single process in the system (*NOT IN SYLLABUS* only for
GATE)

SS
ES
Refer https://www.youtube.com/watch?v=NMtHuK2i2dc
Types 05 Numerical: To find the size of process using the size of
Page Table system (*NOT IN SYLLABUS* only for GATE)
Refer https://www.youtube.com/watch?v=gRzwXIRG1Dc

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
Paging Diagram

LA
SS
Translation Lookaside Buffer (TLB) in Paging ES

In Operating System (Memory Management Technique: Paging), for each process page table
will be created, which will contain Page Table Entry (PTE). This PTE will contain information
like frame number (The address of main memory where we want to refer), and some other
useful bits (e.g., valid/invalid bit, dirty bit, protection bit etc.). This page table entry (PTE) will
tell where in the main memory the actual page is residing.
Now the question is where to place the page table, such that overall access time (or reference
time) will be less.
The problem initially was to fast access the main memory content based on address generated
by CPU (i.e. logical/virtual address). Initially, some people thought of using registers to store
page table, as they are high-speed memory so access time will be less.
The idea used here is, place the page table entries in registers, for each request generated from
CPU (virtual address), it will be matched to the appropriate page number of the page table,
which will now tell where in the main memory that corresponding page resides. Everything

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
seems right here, but the problem is register size is small (in practical, it can accommodate

T
maximum of 0.5k to 1k page table entries) and process size may be big hence the required page

C
table will also be big (let’s say this page table contains 1M entries), so registers may not hold
all the PTE’s of Page table. So this is not a practical approach.

LA
SS
To overcome this size issue, the entire page table was kept in main memory. But the problem
here is two main memory references are required:

ES
1. To find the frame number
2. To go to the address specified by frame number
To overcome this problem a high-speed cache is set up for page table entries called a
Translation Lookaside Buffer (TLB). Translation Lookaside Buffer (TLB) is nothing but a
special cache used to keep track of recently used transactions. TLB contains page table entries
that have been most recently used. Given a virtual address, the processor examines the TLB if
a page table entry is present (TLB hit), the frame number is retrieved and the real address is
formed. If a page table entry is not found in the TLB (TLB miss), the page number is used to
index the process page table. TLB first checks if the page is already in main memory, if not in
main memory a page fault is issued then the TLB is updated to include the new page entry.

Steps in TLB hit:


1. CPU generates virtual address.
2. It is checked in TLB (present).
3. Corresponding frame number is retrieved, which now tells where in the main memory
page lies.

Steps in TLB miss:


1. CPU generates virtual address.
2. It is checked in TLB (not present).
3. Now the page number is matched to page table residing in main memory (assuming
page table contains all PTE).

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
4. Corresponding frame number is retrieved, which now tells where in the main memory

T
page lies.

C
5. The TLB is updated with new PTE (if space is not there, one of the replacement

LA
technique comes into picture i.e. either FIFO, LRU or MFU etc.).

SS
ES
Effective memory access time (EMAT): TLB is used to reduce effective memory access
time as it is a high speed associative cache.
EMAT = h*(c+m) + (1-h)*(c+2m) where h*(c+m) refers t0 TLB HIT and (1-h)*(c+2m)
refers to TLB MISS
where, h = hit ratio of TLB
m = Memory access time
c = TLB access time

Numerical on TLB

Q1. If memory access time is 400µs and TLB access time is 50µs and TLB hit%
is 90%. Find the average instruction access time and effective memory access
time.
Sol.
Given:
m= 400µs, c= 50µs, h= 0.9
If TLB is not present,
Then Total memory access time = 2 x m = 2 x 400µs = 800 µs (*solve only if
asked*)
If TLB is present,
Then Effective memory access time (EMAT) = h*(c+m) + (1-h)*(c+2m)

= 0.9*(50 µs+400 µs) + 0.1*(50 µs+2x400 µs)

= 405 µs + 85 µs = 490 µs (ans)

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Difference between Segmentation and Paging

T
C
Sr. Key Paging Segmentation

LA
No.

SS
ES
Memory Size In Paging, a process address In Segmentation, a process
space is broken into fixed address space is broken in
1
sized blocks called pages. varying sized blocks called
sections.

Accountability Operating System divides the Compiler is responsible to


memory into pages. calculate the segment size, the
2
virtual address and actual
address.

Size Page size is determined by Section size is determined by the


3
available memory. user.

Speed Paging technique is faster in Segmentation is slower than


4
terms of memory access. paging.

Fragmentation Paging can cause internal Segmentation can cause external


5 fragmentation as some pages fragmentation as some memory
may go underutilized. block may not be used at all.

Logical During paging, a logical During segmentation, a logical


6 Address address is divided into page address is divided into section
number and page offset. number and section offset.

Table During paging, a logical During segmentation, a logical


7 address is divided into page address is divided into section
number and page offset. number and section offset.

Data Storage Page table stores the page Segmentation table stores the
8
data. segmentation data.

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
UNIT 04

T
Page Replacement Algorithm – Numerical

C
LA
Q1. Consider the following page reference string 3,2,1,3,4,1,6,2,4,3,4,2,1,4,5,2,1,3,4. How

SS
many page faults would occur assuming three frames are made available for FIFO, LRU, and

ES
optimal page replacement algorithm?

FIFO: First In First Out Page Replacement Algorithm

- Oldest page in the memory will be replaced.


- Has the highest page fault rate.

Frames 3 2 1 3 4 1 6 2 4 3 4 2 1 4 5 2 1 3 4
0 3 3 3 3 4 4 4 4 4 3 3 3 3 3 5 5 5 5 4
1 2 2 2 2 2 6 6 6 6 4 4 4 4 4 2 2 2 2
2 1 1 1 1 1 2 2 2 2 2 1 1 1 1 1 3 3
Page * * * * * *
Hit

Total Page Hit = 6

Total Page Fault/Page Miss = Total Page – Page Hit = 19-6 = 13

Hit Ratio = Page Hit/Total no of Pages = 6/19 = 0.315

Miss Ratio = Page Fault/Total no of Pages =13/19 = 0.6842

LRU: Least Recently Used Page Replacement Algorithm

- Page which has not been used for the longest time is replaced.

FRAME 3 2 1 3 4 1 6 2 4 3 4 2 1 4 5 2 1 3 4
0 3 3 3 3 3 3 6 6 6 3 3 3 1 1 1 2 2 2 4
1 2 2 2 4 4 4 2 2 2 2 2 2 2 5 5 5 3 3
2 1 1 1 1 1 1 4 4 4 4 4 4 4 4 1 1 1
Page * * * * *
Hit

Total Page Hit = 5

Total Page Fault/Page Miss = Total Page – Page Hit = 19-5 = 14

Hit Ratio = Page Hit/Total no of Pages = 5/19 = 0.263

Miss Ratio = Page Fault/Total no of Pages = 14/19 = 0.736

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
Optimal Page Replacement Algorithm

LA
- Replace the page that will not be used for the longest time.

SS
- Has the lowest page fault.

ES
FRAME 3 2 1 3 4 1 6 2 4 3 4 2 1 4 5 2 1 3 4
0 3 3 3 3 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5
1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3
2 1 1 1 1 6 6 6 3 3 3 1 1 1 1 1 1 4
Page * * * * * * * * *
Hit
1

Total Page Hit = 9

Total Page Fault/Page Miss = Total Page – Page Hit = 19-9=10

Hit Ratio = Page Hit/Total no of Pages = 9/19=0.473

Miss Ratio = Page Fault/Total no of Pages=10/19=0.5263

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Q2. Consider the following page reference string 1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6. How

T
many page faults would occur assuming three frames are made available for FIFO, LRU, and

C
optimal page replacement algorithm?

LA
FIFO: First In First Out Page Replacement Algorithm

SS
ES
- Oldest page in the memory will be replaced.
- Has the highest page fault rate.

Frames 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
0 1 1 1 4 4 4 4 6 6 6 6 3 3 3 3 2 2 2 2 6
1 2 2 2 2 1 1 1 2 2 2 2 7 7 7 7 1 1 1 1
2 3 3 3 3 5 5 5 1 1 1 1 6 6 6 6 6 3 3
Page * * * *
Hit

Total Page Hit = 4

Total Page Fault/Page Miss = Total Page – Page Hit = 20-4 = 16

Hit Ratio = Page Hit/Total no of Pages = 4/20 = 0.2

Miss Ratio = Page Fault/Total no of Pages = 16/20 = 0.8

LRU: Least Recently Used Page Replacement Algorithm

- Page which has not been used for the longest time is replaced.

FRAME 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
0 1 1 1 4 4 4 5 5 5 1 1 1 7 7 7 2 2 2 2 2
1 2 2 2 2 2 2 6 6 6 6 3 3 3 3 3 3 3 3 3
2 3 3 3 1 1 1 2 2 2 2 2 6 6 6 1 1 1 6
Page * * * * *
Hit

Total Page Hit = 5

Total Page Fault/Page Miss = Total Page – Page Hit = 20-5 = 15

Hit Ratio = Page Hit/Total no of Pages = 5/20 = 0.25

Miss Ratio = Page Fault/Total no of Pages = 15/20 = 0.75

Optimal Page Replacement Algorithm

- Replace the page that will not be used for the longest time.
- Has the lowest page fault.
-

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
FRAME 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6

T
0 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 6

C
1 2 2 2 2 2 2 2 2 2 2 2 7 7 7 2 2 2 2 2

LA
2 3 4 4 4 5 6 6 6 6 6 6 6 6 6 1 1 1 1
Page * * * * * * * * *

SS
Hit

ES
Total Page Hit = 9

Total Page Fault/Page Miss = Total Page – Page Hit = 20-9 = 11

Hit Ratio = Page Hit/Total no of Pages = 9/20 = 0.45

Miss Ratio = Page Fault/Total no of Pages = 11/20 = 0.55

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Q3. How many page faults would occur for the following reference string for four page

T
frames using LRU and FIFO algorithms: 1,2,3,4,5,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.

C
LA
FIFO: First In First Out Page Replacement Algorithm

SS
- Oldest page in the memory will be replaced.

ES
- Has the highest page fault rate.

Frames 1 2 3 4 5 5 3 4 1 6 7 8 7 8 9 7 8 9 5 4 5 4 2
0 1 1 1 1 5 5 5 5 5 5 5 8 8 8 8 8 8 8 8 8 8 8 2
1 2 2 2 2 2 2 2 1 1 1 1 1 1 9 9 9 9 9 9 9 9 9
2 3 3 3 3 3 3 3 6 6 6 6 6 6 6 6 6 5 5 5 5 5
3 4 4 4 4 4 4 4 7 7 7 7 7 7 7 7 7 4 4 4 4
Page * * * * * * * * * *
Hit

Total Page Hit = 10

Total Page Fault/Page Miss = Total Page – Page Hit = 23-10 = 13

Hit Ratio = Page Hit/Total no of Pages = 10/23 = 0.4347

Miss Ratio = Page Fault/Total no of Pages = 13/23 = 0.5652

LRU: Least Recently Used Page Replacement Algorithm

- Page which has not been used for the longest time is replaced.

Frames 1 2 3 4 5 5 3 4 1 6 7 8 7 8 9 7 8 9 5 4 5 4 2
0 1 1 1 1 5 5 5 5 5 6 6 6 6 6 6 6 6 6 5 5 5 5 5
1 2 2 2 2 2 2 2 1 1 1 1 1 1 9 9 9 9 9 9 9 9 9
2 3 3 3 3 3 3 3 3 7 7 7 7 7 7 7 7 7 4 4 4 4
3 4 4 4 4 4 4 4 4 8 8 8 8 8 8 8 8 8 8 8 2
Page * * * * * * * * * *
Hit

Total Page Hit = 10

Total Page Fault/Page Miss = Total Page – Page Hit = 23-10 = 13

Hit Ratio = Page Hit/Total no of Pages = 10/23 = 0.4347

Miss Ratio = Page Fault/Total no of Pages = 13/23 = 0.5652

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
Q4. Consider a main memory with five page frames and the following sequence of page

T
references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. which one of the following is true with

C
respect to page replacement policies First-In-First-out (FIFO) and Least Recently Used

LA
(LRU)?

SS
A. Both incur the same number of page faults

ES
B. FIFO incurs 2 more page faults than LRU
C. LRU incurs 2 more page faults than FIFO
D. FIFO incurs 1 more page faults than LRU

Q5. Consider the following page reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1. How


many page faults would occur assuming three frames are made available for FIFO, LRU, and
optimal page replacement algorithm?

Q6. Consider the following page reference string 1,2,3,2,1,5,2,1,6,2,5,6,3,1,3,6,1,2,4,3. How


many page faults would occur assuming three frames are made available for FIFO, LRU, and
optimal page replacement algorithm?

Q7. Consider the following page reference string 5,4,3,2,1,4,3,5,4,3,2,1,5. How many page
faults would occur assuming three frames are made available for FIFO page replacement
algorithm? Would the FIFO page replacement algorithm suffer from Belady’s Anomaly if
number of frames increase from three to four? Justify.

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
SS
ES
OS UNIT-5

Operating Systems (Dr. A.P.J. Abdul Kalam Technical University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Arman Ali ([email protected])
lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])


lOMoARcPSD|30415125

R
R
SI
M
T
C
LA
S
SE
S

Downloaded by Arman Ali ([email protected])

You might also like