SlideShare a Scribd company logo
Operating System
Main Memory
Memory Management
Memory Accessing
- Registers
- Cache
- Main Memory
Stall
Hardware Address Protection
Base and Limit Registers
Address Binding
Input Queue
- Single-tasking Procedure
Binding
- Mapping of symbolic into logical Address
Steps of Binding
- Compile Time
- Load Time
- Execution Time
Logical vs Physical Address Space
Logical Address
- Logical Address Space
Physical Address
- Physical Address Space
Memory Management Unit (MMU)
Loading when called.
Better memory utilization.
Useful when large amount of code needs to
be handled.
Dynamic relocation using a
relocation register
Mapping of virtual into Physical Address
- Relocation Registers
- MS-DOS on Intel 80x86 used 4 relocation registers
Dynamic Linking
Static linking
Stub Program
Libraries
- shared libraries
Swapping
A process can be swapped temporarily out of memory to a backing
store, and then brought back into memory for continued execution
Standard Swapping
Standard swapping involves moving processes between main memory
and Baking store.
• Backing store
• Roll out, roll in
• transfer time
• ready queue
Schematic View of Swapping
Context Switch Time including Swapping
• If next processes to be put on CPU is not in memory, need to swap out
a process and swap in target process
• Context switch time can then be very high
• 100MB process swapping to hard disk with transfer rate of 50MB/sec
• Swapping is constrained by other factors as well.
Pending I/O
Double buffering
Standard swapping not used in modern operating systems
Swapping on Mobile Systems
• Not typically supported
• Flash memory based
• Small amount of space
• Limited number of write cycles
• Poor throughput between flash memory and CPU on
mobile platform
• Instead use other methods to free memory if low
iOS asks
Read-only data
Failure to free
application state
Contiguous Memory Allocation
The main memory must accommodate
both the operating system and the
various user processes.
Main memory usually into two partitions.
- Resident operating system.
- User processes.
- single contiguous section.
• Relocation registers used to protect user processes
-Base register
-Limit register
-MMU maps
-transient
Memory Protection
Memory Allocation
Multiple-partition allocation
• Degree of multiprogramming limited by number of
partitions
• Variable-partition
• Hole
• process arrival
• Operating system maintains information about:
a) allocated partitions b) free partitions (hole)
Dynamic Storage-Allocation Problem
• which concerns how to satisfy a request of size n from a
list of free holes.
• First-fit
• Best-fit
• Worst-fit
Fragmentation
• External Fragmentation
• Internal Fragmentation
Reduce external fragmentation by compaction
• Shuffle
• Compaction
• I/O problem
Segmentation
Memory segmentation is the division of a computer's
primary memory into segments or sections.
A program is a collection of segments.
A segment is a logical unit such as.
- main program
- procedure
- local variables
- global variables
User’s View of a Program Logical View of Segmentation
1
3
2
4
1
4
2
3
user space physical memory space
Segmentation Architecture
Logical address consists of a two tuple
<segment-number, offset>
Segment table.
- Base
- Limit
Segment-table base register (STBR)
Segment-table length register (STLR)
Protection
With each entry in segment table associate:
validation bit = 0  illegal segment
read/write/execute privileges
Protection bits
segments length
Segmentation Hardware
Paging
• Physical address space of a process can be noncontiguous;
process is allocated physical memory whenever the latter is
available
• Avoids external fragmentation
• Avoids problem of varying sized memory chunks
• Frames
• Pages
• Set up a page table to translate logical to physical addresses
• Backing store likewise split into pages
• Still have Internal fragmentation
Address Translation Scheme
Address generated by CPU is divided into:
• Page number (p) – used as an index into a page table which
contains base address of each page in physical memory
• Page offset (d) – combined with base address to define the physical
memory address that is sent to the memory unit
page number page offset
p d
m -n n
• For given logical address space 2m and page size 2n
Paging Model of Logical and Physical Memory
Paging Hardware
• Each operating system has its own methods for storing page
tables.
• Some allocate a page table for each process.
• When the dispatcher is told to start a process, it must reload the user
registers and define the correct hardware page-table values from the
stored user page table.
• The hardware implementation of the page table can be
done in several ways.
In the simplest case
The page table is implemented as a set of
dedicated registers.
• Page-table base register (PTBR) points to the
page table.
Page-table Base Register (PTBR)
• The standard solution to this problem is to
use a special, small, fastlookup hardware
cache called a translation look-aside buffer
(TLB).
• The percentage of times that the page number of
interest is found in the TLB is called the hit ratio.
Protection
Memory protection in a paged environment is accomplished by protection bits
associated with each frame.
• One bit can define a page to be read–write or read-
only.
Valid–Invalid Bit
• One additional bit is generally attached
to each entry in the page table: a
valid–invalid bit.
Shared Pages
• An advantage of paging is the possibility of
sharing common code.
• This consideration is particularly important in a
time-sharing environment.
• If the text editor consists of 150 KB of code and 50 KB of data space,
we need 8,000 KB to support the 40 users.
• If the code is reentrant code (or pure code),
Sharing Of code in Paging environment

More Related Content

What's hot

Memory Management
Memory ManagementMemory Management
Memory Management
sangrampatil81
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
ManishaJha43
 
Computer memory management
Computer memory managementComputer memory management
Computer memory managementKumar
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
Ajit Nayak
 
Operating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management ConceptsOperating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management Concepts
Peter Tröger
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
Mukesh Chinta
 
Memory management
Memory managementMemory management
Memory management
PATELARCH
 
Memory Management
Memory ManagementMemory Management
Memory Management
Ramasubbu .P
 
Operating system
Operating systemOperating system
Operating system
Trinity Dwarka
 
Memory management
Memory managementMemory management
Memory management
Mohamed Safraz
 
Memory management
Memory managementMemory management
Memory managementSlideshare
 
Operating System
Operating SystemOperating System
Operating System
Subhasis Dash
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
Dr. Loganathan R
 
Unit IV Memory and I/O Organization
Unit IV Memory and I/O OrganizationUnit IV Memory and I/O Organization
Unit IV Memory and I/O Organization
Balaji Vignesh
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
SandhyaTatekalva
 

What's hot (20)

Memory Management
Memory ManagementMemory Management
Memory Management
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Computer memory management
Computer memory managementComputer memory management
Computer memory management
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
 
Operating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management ConceptsOperating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management Concepts
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
 
Memory management
Memory managementMemory management
Memory management
 
Ch4 memory management
Ch4 memory managementCh4 memory management
Ch4 memory management
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Operating system
Operating systemOperating system
Operating system
 
Memory management
Memory managementMemory management
Memory management
 
Memory management
Memory managementMemory management
Memory management
 
Operating System
Operating SystemOperating System
Operating System
 
Ch8
Ch8Ch8
Ch8
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Unit IV Memory and I/O Organization
Unit IV Memory and I/O OrganizationUnit IV Memory and I/O Organization
Unit IV Memory and I/O Organization
 
OSCh14
OSCh14OSCh14
OSCh14
 
Os4
Os4Os4
Os4
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 

Similar to Main Memory

Memory Management in Operating Systems for all
Memory Management in Operating Systems for allMemory Management in Operating Systems for all
Memory Management in Operating Systems for all
VSKAMCSPSGCT
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
ItechAnand1
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
ImranBhatti58
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
Welly Dian Astika
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
Amanuelmergia
 
Bab 4
Bab 4Bab 4
Bab 4
n k
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptx
MadhuraK13
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
Bitta_man
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
dilip kumar
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
Anwal Mirza
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
SourabhRaj29
 
Operating system 34 contiguous allocation
Operating system 34 contiguous allocationOperating system 34 contiguous allocation
Operating system 34 contiguous allocation
Vaibhav Khanna
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
Wayne Jones Jnr
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OSC.U
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
donny101
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
ssusera387fd1
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OSC.U
 

Similar to Main Memory (20)

Os4
Os4Os4
Os4
 
Memory Management in Operating Systems for all
Memory Management in Operating Systems for allMemory Management in Operating Systems for all
Memory Management in Operating Systems for all
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
 
Bab 4
Bab 4Bab 4
Bab 4
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptx
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
 
Operating system 34 contiguous allocation
Operating system 34 contiguous allocationOperating system 34 contiguous allocation
Operating system 34 contiguous allocation
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Ch8
Ch8Ch8
Ch8
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 

More from Usama ahmad

Assembly language
Assembly language Assembly language
Assembly language
Usama ahmad
 
Non-Current Assets & Depreciation
Non-Current Assets & DepreciationNon-Current Assets & Depreciation
Non-Current Assets & Depreciation
Usama ahmad
 
MANAGEMENT PROCESS HRM PROCESS
MANAGEMENT PROCESS HRM PROCESSMANAGEMENT PROCESS HRM PROCESS
MANAGEMENT PROCESS HRM PROCESS
Usama ahmad
 
INTERNET AND E-COMMERCE
INTERNET AND E-COMMERCEINTERNET AND E-COMMERCE
INTERNET AND E-COMMERCE
Usama ahmad
 
Introduction to Set Theory
Introduction to Set TheoryIntroduction to Set Theory
Introduction to Set Theory
Usama ahmad
 
MAGNITUDE COMPARATOR & DECODER
MAGNITUDE COMPARATOR & DECODERMAGNITUDE COMPARATOR & DECODER
MAGNITUDE COMPARATOR & DECODER
Usama ahmad
 
Present of Raid and Its Type
Present of Raid and Its TypePresent of Raid and Its Type
Present of Raid and Its Type
Usama ahmad
 

More from Usama ahmad (7)

Assembly language
Assembly language Assembly language
Assembly language
 
Non-Current Assets & Depreciation
Non-Current Assets & DepreciationNon-Current Assets & Depreciation
Non-Current Assets & Depreciation
 
MANAGEMENT PROCESS HRM PROCESS
MANAGEMENT PROCESS HRM PROCESSMANAGEMENT PROCESS HRM PROCESS
MANAGEMENT PROCESS HRM PROCESS
 
INTERNET AND E-COMMERCE
INTERNET AND E-COMMERCEINTERNET AND E-COMMERCE
INTERNET AND E-COMMERCE
 
Introduction to Set Theory
Introduction to Set TheoryIntroduction to Set Theory
Introduction to Set Theory
 
MAGNITUDE COMPARATOR & DECODER
MAGNITUDE COMPARATOR & DECODERMAGNITUDE COMPARATOR & DECODER
MAGNITUDE COMPARATOR & DECODER
 
Present of Raid and Its Type
Present of Raid and Its TypePresent of Raid and Its Type
Present of Raid and Its Type
 

Recently uploaded

June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 

Recently uploaded (20)

June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 

Main Memory

  • 2. Memory Management Memory Accessing - Registers - Cache - Main Memory Stall Hardware Address Protection Base and Limit Registers
  • 3. Address Binding Input Queue - Single-tasking Procedure Binding - Mapping of symbolic into logical Address Steps of Binding - Compile Time - Load Time - Execution Time
  • 4. Logical vs Physical Address Space Logical Address - Logical Address Space Physical Address - Physical Address Space Memory Management Unit (MMU) Loading when called. Better memory utilization. Useful when large amount of code needs to be handled. Dynamic relocation using a relocation register Mapping of virtual into Physical Address - Relocation Registers - MS-DOS on Intel 80x86 used 4 relocation registers
  • 5. Dynamic Linking Static linking Stub Program Libraries - shared libraries
  • 6. Swapping A process can be swapped temporarily out of memory to a backing store, and then brought back into memory for continued execution Standard Swapping Standard swapping involves moving processes between main memory and Baking store. • Backing store • Roll out, roll in • transfer time • ready queue
  • 7. Schematic View of Swapping
  • 8. Context Switch Time including Swapping • If next processes to be put on CPU is not in memory, need to swap out a process and swap in target process • Context switch time can then be very high • 100MB process swapping to hard disk with transfer rate of 50MB/sec • Swapping is constrained by other factors as well. Pending I/O Double buffering Standard swapping not used in modern operating systems
  • 9. Swapping on Mobile Systems • Not typically supported • Flash memory based • Small amount of space • Limited number of write cycles • Poor throughput between flash memory and CPU on mobile platform • Instead use other methods to free memory if low iOS asks Read-only data Failure to free application state
  • 10. Contiguous Memory Allocation The main memory must accommodate both the operating system and the various user processes. Main memory usually into two partitions. - Resident operating system. - User processes. - single contiguous section.
  • 11. • Relocation registers used to protect user processes -Base register -Limit register -MMU maps -transient Memory Protection
  • 12. Memory Allocation Multiple-partition allocation • Degree of multiprogramming limited by number of partitions • Variable-partition • Hole • process arrival • Operating system maintains information about: a) allocated partitions b) free partitions (hole)
  • 13. Dynamic Storage-Allocation Problem • which concerns how to satisfy a request of size n from a list of free holes. • First-fit • Best-fit • Worst-fit
  • 14. Fragmentation • External Fragmentation • Internal Fragmentation Reduce external fragmentation by compaction • Shuffle • Compaction • I/O problem
  • 15. Segmentation Memory segmentation is the division of a computer's primary memory into segments or sections. A program is a collection of segments. A segment is a logical unit such as. - main program - procedure - local variables - global variables
  • 16. User’s View of a Program Logical View of Segmentation 1 3 2 4 1 4 2 3 user space physical memory space
  • 17. Segmentation Architecture Logical address consists of a two tuple <segment-number, offset> Segment table. - Base - Limit Segment-table base register (STBR) Segment-table length register (STLR) Protection With each entry in segment table associate: validation bit = 0  illegal segment read/write/execute privileges Protection bits segments length
  • 19. Paging • Physical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter is available • Avoids external fragmentation • Avoids problem of varying sized memory chunks • Frames • Pages • Set up a page table to translate logical to physical addresses • Backing store likewise split into pages • Still have Internal fragmentation
  • 20. Address Translation Scheme Address generated by CPU is divided into: • Page number (p) – used as an index into a page table which contains base address of each page in physical memory • Page offset (d) – combined with base address to define the physical memory address that is sent to the memory unit page number page offset p d m -n n • For given logical address space 2m and page size 2n
  • 21. Paging Model of Logical and Physical Memory
  • 22. Paging Hardware • Each operating system has its own methods for storing page tables. • Some allocate a page table for each process. • When the dispatcher is told to start a process, it must reload the user registers and define the correct hardware page-table values from the stored user page table. • The hardware implementation of the page table can be done in several ways. In the simplest case The page table is implemented as a set of dedicated registers.
  • 23. • Page-table base register (PTBR) points to the page table. Page-table Base Register (PTBR) • The standard solution to this problem is to use a special, small, fastlookup hardware cache called a translation look-aside buffer (TLB). • The percentage of times that the page number of interest is found in the TLB is called the hit ratio.
  • 24. Protection Memory protection in a paged environment is accomplished by protection bits associated with each frame. • One bit can define a page to be read–write or read- only. Valid–Invalid Bit • One additional bit is generally attached to each entry in the page table: a valid–invalid bit.
  • 25. Shared Pages • An advantage of paging is the possibility of sharing common code. • This consideration is particularly important in a time-sharing environment. • If the text editor consists of 150 KB of code and 50 KB of data space, we need 8,000 KB to support the 40 users. • If the code is reentrant code (or pure code),
  • 26. Sharing Of code in Paging environment