Virtual Memory and Secondary Memory
27 November 2024 20:24
Virtual Memories and Secondary Memory Page 1
Page table is also present in the RAM
Page Table contains the location of the
virtual pages in the page frames of the
RAM.
Apart from that it also stores some control
Bits
Virtual page No. : Konsa Virtual page hai
Offest : uss page mei kis location par hai vo
data.
Virtual Memories and Secondary Memory Page 2
Example for better understanding
Virtual Memories and Secondary Memory Page 3
The entries in the Page Table and TLB must be consistent(same).
If there is an update it should be translated to both (Page Table and TLB).
When a Processor sends a virtual address its
Virtual page No. is
first checked in the TLB.. Agar udhar hi milgya
then it’s a hit.. And we don’t need to check the
Page Table.
in this case Page frame information in the TLB will
be used to generate the physical Address… No
access is required to the Page table present in the
M/M… Now the physical address is generated by
the MMU Alone.
Otherwise , if it was a miss, then the Page table in
M/M will be accessed, Page frame information
will be obtained and then the Physical address will
be generated.
Most of the time if a page is recently being
accessed and a subsequent address from the
same page is to be accessed again, the page frame
information is updated in the TLB so that you
don’t have to access the Page Table again and
again.
Virtual Memories and Secondary Memory Page 4
Secondary Storage in the systems
is usually implemented as a
Magnetic Hard Disk.
Coencentric Tracks mei aise data store hota hai…
Read Write Heads radially move kr sakte hai to
access each coencentric Track
Ek baar read write head proper track
Virtual Memories and Secondary Memory Page 5
Ek baar read write head proper track
tak pahuch jaaye(radial movement) …
in seek time..
then spindle ghumta hai aur jo sector
par information read/write krni hoti hai
vo read/write head ke theek neeche aa
jaata hai…
This is Latency Time.
When data is read from the track.. It can
be kept in the Data Buffer.. From where it
can be transferred to the Main Memory at
a very high speed..
Locality of Reference
Agar koi address gaya hai abhi
toh high chance hai ki uski close proximity
mei jo next address hai use read karne ko
bolde.
As soon as the contents of the Data Buffer
are Transferred, The subsequent addresses
are also being brought into the Data Buffer
to ensure smooth and fast transfer of Data
through them.
Virtual Memories and Secondary Memory Page 6
Seek: Once the address is generated by the
processor , Seek operation will be initiated to locate
the particular track and sector where the address
would be found.
Error Checking : The controller will compute and Error
Correcting Code (ECC) and will match it from the ECC
of the Sector that is being read..
If they are match that means there is no loss of Data..
No error.
Read: Once assembled in the Data buffer, the data is
sent in parallel to the interconnection b/w the Disk
and the Memory.
Write: Read ka ulta hojata hai.. Interconnection b/w
Disk and memory se data aata hai.. Data Buffer mei
store kkia jaata hai..
And then they will be sent in a serial form to the
required Sector in a given track of a Disk.
BAS PADHLE
Solved Examples
Virtual Memories and Secondary Memory Page 7
Ek Platter par 2 Surfaces hote hai
Ek Upper Surface and Lower
Surface jaha data can be stored.
First all the surfaces and subsequent Sectors of the Same
cylinders will be Filled…
Then we will go to the next Cylinder
Virtual Memories and Secondary Memory Page 8
Virtual Memories and Secondary Memory Page 9
Basically 1 poore
rotation mei Pure
track ki saari Bytes
transfer hojayengi
Virtual Memories and Secondary Memory Page 10
Note: Jab ek baar rotation hota hai toh sirf ek track se nahi … saare tracks ke saare
surfaces se data transfer hota hai…
so 1 rotation ka nikala pehle 1 track ke liye = 128*256 Bytes
Fir 4 surface the total mei (2 tracks honge ) , toh total bytes transferred chaaro surfaces se
= 128*256*4
Virtual Memories and Secondary Memory Page 11
Doubt: Why do we divide by 100 in the Blocks used for Book Keeping.
Virtual Memories and Secondary Memory Page 12
Virtual Memories and Secondary Memory Page 13