SlideShare una empresa de Scribd logo
1 de 53
OPERATING SYTEMS
       B.TECH II YR (TERM 08-09)
          UNIT 4 PPT SLIDES
TEXT BOOKS:
Operating System Concepts- Abraham Silberchatz,
   Peter B. Galvin, Greg Gagne 7th Edition, John
   Wiley
Operating systems- A Concept based Approach-
   D.M.Dhamdhere, 2nd Edition, TMH.

No. of slides:
INDEX
                UNIT 4 PPT SLIDES
S.NO. TOPIC                    LECTURE NO. PPTSLIDES
2 Swapping                          L25   L25.1 to L25.6
3 contiguous memory allocation      L26   L26.1 to L26.5
4 Paging                            L27   L27.1 to L27.6
5 structure of the page table       L28   L28.1 to L28.10
6 Segmentation                      L29   L29.1 to L29.13
7 page replacement                  L30   L30.1 to L30.9
8 case studies UNIX, Linux, Windows L31   L31.1 to L31.3
9 REVISION
Swapping
• A process can be swapped temporarily out of memory
  to a backing store, and then brought back into memory
  for continued execution

• Backing store – fast disk large enough to
  accommodate copies of all memory images for all
  users; must provide direct access to these memory
  images

• Roll out, roll in – swapping variant used for priority-
  based scheduling algorithms; lower-priority process is
  swapped out so higher-priority process can be loaded
  and executed

• Major part of swap time is transfer time; total transfer
  time is directly proportional to the amount of memory
  swapped
Schematic View of Swapping
Base and Limit Registers
• A pair of base and limit registers
  define the logical address space
Multistep Processing of a User
           Program
Memory-Management Unit (MMU)
• Hardware device that maps virtual to physical
  address

• In MMU scheme, the value in the relocation
  register is added to every address generated
  by a user process at the time it is sent to
  memory

• The user program deals with logical
  addresses; it never sees the real physical
  addresses
Dynamic relocation using a relocation
              register
Contiguous Allocation
• Main memory usually into two partitions:
  – Resident operating system, usually held in low memory
    with interrupt vector
  • User processes then held in high memory
    Relocation registers used to protect user processes
    from each other, and from changing operating-system
    code and data
  – Base register contains value of smallest physical
    address
  – Limit register contains range of logical addresses –
    each logical address must be less than the limit register
  – MMU maps logical address dynamically
Hardware Support for Relocation and Limit Registers
Contiguous Allocation (Cont)
• Multiple-partition allocation
  – Hole – block of available memory; holes of various
    size are scattered throughout memory
  – When a process arrives, it is allocated memory
    from a hole large enough to accommodate it
  – Operating system maintains information about:
    a) allocated partitions b) free partitions (hole)
        OS          OS          OS           OS

      process 5   process 5   process 5   process 5
                              process 9   process 9

      process 8                           process 10


      process 2   process 2   process 2   process 2
Fragmentation
• External Fragmentation – total memory space exists to satisfy a
  request, but it is not contiguous
• Internal Fragmentation – allocated memory may be slightly
  larger than requested memory; this size difference is memory
  internal to a partition, but not being used
• Reduce external fragmentation by compaction
   – Shuffle memory contents to place all free memory together in
      one large block
   – Compaction is possible only if relocation is dynamic, and is
      done at execution time
   – I/O problem
       • Latch job in memory while it is involved in I/O
       • Do I/O only into OS buffers
Paging
• Logical address space of a process can be
  noncontiguous; process is allocated physical memory
  whenever the latter is available
• Divide physical memory into fixed-sized blocks called
  frames (size is power of 2, between 512 bytes and 8,192
  bytes)
• Divide logical memory into blocks of same size called
  pages
• Keep track of all free frames
• To run a program of size n pages, need to find n free
  frames and load program
• Set up a page table to translate logical to physical
  addresses
• 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 Hardware
Paging Model of Logical and
     Physical Memory
Paging Example




32-byte memory and 4-byte pages
Free Frames




Before allocation   After allocation
Implementation of Page Table
• Page table is kept in main memory
• Page-table base register (PTBR) points to the page table
• Page-table length register (PRLR) indicates size of the
  page table
• In this scheme every data/instruction access requires two
  memory accesses. One for the page table and one for the
  data/instruction.
• The two memory access problem can be solved by the
  use of a special fast-lookup hardware cache called
  associative memory or translation look-aside buffers
  (TLBs)
• Some TLBs store address-space identifiers (ASIDs) in
  each TLB entry – uniquely identifies each process to
  provide address-space protection for that process
Paging Hardware With TLB
Shared Pages
• Shared code
  – One copy of read-only (reentrant) code shared
    among processes (i.e., text editors, compilers,
    window systems).
  – Shared code must appear in same location in the
    logical address space of all processes

• Private code and data
  – Each process keeps a separate copy of the code
    and data
  – The pages for the private code and data can appear
    anywhere in the logical address space
Shared Pages Example
Two-Level Page-Table Scheme
Two-Level Paging Example
•   A logical address (on 32-bit machine with 1K page size) is divided into:
    – a page number consisting of 22 bits
    – a page offset consisting of 10 bits
•   Since the page table is paged, the page number is further divided into:
    – a 12-bit page number
    – a 10-bit page offset
•   Thus, a logical address is as follows:

    where pi is an index into the outer page table, and p2 is the
    displacement within the page of the outer page table
                                page         page offset
                              number p
                             pi       2        d

                                12    10        10
Address-Translation Scheme
Three-level Paging Scheme
Hashed Page Tables
• Common in address spaces > 32 bits
 The virtual page number is hashed into a page table
    – This page table contains a chain of elements hashing to the same
       location
  Virtual page numbers are compared in this chain searching for a
   match
    – If a match is found, the corresponding physical frame is extracted
Inverted Page Table
•   One entry for each real page of memory
•   Entry consists of the virtual address of the page stored in that real
    memory location, with information about the process that owns that page
•   Decreases memory needed to store each page table, but increases time
    needed to search the table when a page reference occurs
•   Use hash table to limit the search to one — or at most a few — page-
    table entries
Segmentation
• Memory-management scheme that supports user view
  of memory
• A program is a collection of segments
  – A segment is a logical unit such as:
          main program
          procedure
          function
          method
          object
          local variables, global variables
          common block
          stack
          symbol table
          arrays
Segmentation Architecture
• Logical address consists of a two tuple:
             <segment-number, offset>,
• Segment table – maps two-dimensional physical
  addresses; each table entry has:
   – base – contains the starting physical address
     where the segments reside in memory
   – limit – specifies the length of the segment
• Segment-table base register (STBR) points to
  the segment table’s location in memory
• Segment-table length register (STLR) indicates
  number of segments used by a program;
              segment number s is legal if s < STLR
Segmentation Hardware
Logical to Physical Address Translation in Pentium
Pentium Paging Architecture
Three-level Paging in Linux
Demand Paging
• Bring a page into memory only when it is needed
   – Less I/O needed
   – Less memory needed
   – Faster response
   – More users

• Page is needed ⇒ reference to it
   – invalid reference ⇒ abort
   – not-in-memory ⇒ bring to memory
• Lazy swapper – never swaps a page into memory unless page
  will be needed
   – Swapper that deals with pages is a pager
Page Fault
• If there is a reference to a page, first reference to that
   page will trap to operating system:
          page fault
3. Operating system looks at another table to decide:
    – Invalid reference ⇒ abort
    – Just not in memory
s Get empty frame
s Swap page into frame
s Reset tables
s Set validation bit = v
s Restart the instruction that caused the page fault
Steps in Handling a Page Fault
Performance of Demand Paging
• Page Fault Rate 0 ≤ p ≤ 1.0
  – if p = 0 no page faults
  – if p = 1, every reference is a fault

• Effective Access Time (EAT)
             EAT = (1 – p) x memory access
                + p (page fault overhead
                       + swap page out
                       + swap page in
                       + restart overhead
Copy-on-Write
• Copy-on-Write (COW) allows both parent
  and child processes to initially share the
  same pages in memory

 If either process modifies a shared page,
 only then is the page copied

• COW allows more efficient process
  creation as only modified pages are
  copied
Before Process 1 Modifies Page
              C
After Process 1 Modifies Page
              C
Page Replacement
• Prevent over-allocation of memory by modifying
  page-fault service routine to include page
  replacement

• Use modify (dirty) bit to reduce overhead of
  page transfers – only modified pages are
  written to disk

• Page replacement completes separation
  between logical memory and physical memory
  – large virtual memory can be provided on a
  smaller physical memory
Need For Page Replacement
Page Replacement
Graph of Page Faults Versus The
      Number of Frames
FIFO Page Replacement




  FIFO Illustrating Belady’s Anomaly
Optimal Page Replacement




     LRU Page Replacement
Use Of A Stack to Record The Most Recent
            Page References
Second-Chance (clock) Page-
  Replacement Algorithm
Counting Algorithms
• Keep a counter of the number of references
  that have been made to each page

• LFU Algorithm: replaces page with
  smallest count

• MFU Algorithm: based on the argument that
  the page with the smallest count was
  probably just brought in and has yet to be
  used
Windows XP
• Uses demand paging with clustering. Clustering brings
  in pages surrounding the faulting page
• Processes are assigned working set minimum and
  working set maximum
• Working set minimum is the minimum number of pages
  the process is guaranteed to have in memory
• A process may be assigned as many pages up to its
  working set maximum
• When the amount of free memory in the system falls
  below a threshold, automatic working set trimming is
  performed to restore the amount of free memory
• Working set trimming removes pages from processes
  that have pages in excess of their working set minimum
Solaris
• Maintains a list of free pages to assign faulting processes
• Lotsfree – threshold parameter (amount of free memory) to
  begin paging
• Desfree – threshold parameter to increasing paging
• Minfree – threshold parameter to being swapping
• Paging is performed by pageout process
• Pageout scans pages using modified clock algorithm
• Scanrate is the rate at which pages are scanned. This
  ranges from slowscan to fastscan
• Pageout is called more frequently depending upon the
  amount of free memory available
Solaris 2 Page Scanner

Más contenido relacionado

La actualidad más candente

ITFT_Device management in Operating System
ITFT_Device management in Operating SystemITFT_Device management in Operating System
ITFT_Device management in Operating SystemSneh Prabha
 
Unit 1 computer architecture (1)
Unit 1   computer architecture (1)Unit 1   computer architecture (1)
Unit 1 computer architecture (1)DevaKumari Vijay
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Memory management ppt
Memory management pptMemory management ppt
Memory management pptManishaJha43
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSvampugani
 
Process management os concept
Process management os conceptProcess management os concept
Process management os conceptpriyadeosarkar91
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process managementArnav Chowdhury
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process managementAisyah Rafiuddin
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory managementMukesh Chinta
 
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 ConceptsPeter Tröger
 
System Z operating system
System Z operating systemSystem Z operating system
System Z operating systemArpana shree
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSKumar Pritam
 

La actualidad más candente (20)

ITFT_Device management in Operating System
ITFT_Device management in Operating SystemITFT_Device management in Operating System
ITFT_Device management in Operating System
 
Unit 1 computer architecture (1)
Unit 1   computer architecture (1)Unit 1   computer architecture (1)
Unit 1 computer architecture (1)
 
Ch4 memory management
Ch4 memory managementCh4 memory management
Ch4 memory management
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Ch8
Ch8Ch8
Ch8
 
Cs8493 unit 1
Cs8493 unit 1Cs8493 unit 1
Cs8493 unit 1
 
Operating system
Operating systemOperating system
Operating system
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process management
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
 
Operating system
Operating systemOperating system
Operating system
 
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
 
System Z operating system
System Z operating systemSystem Z operating system
System Z operating system
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Os
OsOs
Os
 

Destacado

Unit 4 designing classes
Unit 4  designing classesUnit 4  designing classes
Unit 4 designing classesgopal10scs185
 
Uml structural diagrams
Uml structural diagramsUml structural diagrams
Uml structural diagramsSwathy T
 
Unit 3 system models
Unit 3 system modelsUnit 3 system models
Unit 3 system modelsAzhar Shaik
 
Unt 3 attributes, methods, relationships-1
Unt 3 attributes, methods, relationships-1Unt 3 attributes, methods, relationships-1
Unt 3 attributes, methods, relationships-1gopal10scs185
 
Unit 5 usability and satisfaction test
Unit 5 usability and satisfaction testUnit 5 usability and satisfaction test
Unit 5 usability and satisfaction testgopal10scs185
 
System model.Chapter One(GEOFFREY GORDON)
System model.Chapter One(GEOFFREY GORDON)System model.Chapter One(GEOFFREY GORDON)
System model.Chapter One(GEOFFREY GORDON)Towfiq218
 
Unit 3 object analysis-classification
Unit 3 object analysis-classificationUnit 3 object analysis-classification
Unit 3 object analysis-classificationgopal10scs185
 
Object-Oriented Analysis And Design With Applications Grady Booch
Object-Oriented Analysis And Design With Applications Grady BoochObject-Oriented Analysis And Design With Applications Grady Booch
Object-Oriented Analysis And Design With Applications Grady BoochSorina Chirilă
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologiesnaina-rani
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagramsbarney92
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignHaitham El-Ghareeb
 

Destacado (20)

Unit 4 designing classes
Unit 4  designing classesUnit 4  designing classes
Unit 4 designing classes
 
Uml structural diagrams
Uml structural diagramsUml structural diagrams
Uml structural diagrams
 
Unit 3 system models
Unit 3 system modelsUnit 3 system models
Unit 3 system models
 
UML Modeling in Java
UML Modeling in JavaUML Modeling in Java
UML Modeling in Java
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unt 3 attributes, methods, relationships-1
Unt 3 attributes, methods, relationships-1Unt 3 attributes, methods, relationships-1
Unt 3 attributes, methods, relationships-1
 
Uml3
Uml3Uml3
Uml3
 
Unit 5 usability and satisfaction test
Unit 5 usability and satisfaction testUnit 5 usability and satisfaction test
Unit 5 usability and satisfaction test
 
Ooad
OoadOoad
Ooad
 
System model.Chapter One(GEOFFREY GORDON)
System model.Chapter One(GEOFFREY GORDON)System model.Chapter One(GEOFFREY GORDON)
System model.Chapter One(GEOFFREY GORDON)
 
Unit 4
Unit 4Unit 4
Unit 4
 
Unit 3 object analysis-classification
Unit 3 object analysis-classificationUnit 3 object analysis-classification
Unit 3 object analysis-classification
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Object-Oriented Analysis And Design With Applications Grady Booch
Object-Oriented Analysis And Design With Applications Grady BoochObject-Oriented Analysis And Design With Applications Grady Booch
Object-Oriented Analysis And Design With Applications Grady Booch
 
Ooad unit – 1 introduction
Ooad unit – 1 introductionOoad unit – 1 introduction
Ooad unit – 1 introduction
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
Chap 2 behaviour models
Chap 2 behaviour modelsChap 2 behaviour models
Chap 2 behaviour models
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 

Similar a Os4

Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxImranBhatti58
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OSC.U
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptxItechAnand1
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptxSourabhRaj29
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdfHarika Pudugosula
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003Prashant odhavani
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxMadhuraK13
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptxRohitPaul71
 
Bab 4
Bab 4Bab 4
Bab 4n k
 
08 operating system support
08 operating system support08 operating system support
08 operating system supportAnwal Mirza
 

Similar a Os4 (20)

Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Memory management
Memory managementMemory management
Memory management
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
 
OSCh9
OSCh9OSCh9
OSCh9
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
 
Memory+management
Memory+managementMemory+management
Memory+management
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Main Memory
Main MemoryMain Memory
Main Memory
 
Memory management
Memory managementMemory management
Memory management
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptx
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
 
Bab 4
Bab 4Bab 4
Bab 4
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 

Más de gopal10scs185 (20)

Os5
Os5Os5
Os5
 
Os8
Os8Os8
Os8
 
Os8
Os8Os8
Os8
 
Os7
Os7Os7
Os7
 
Os6
Os6Os6
Os6
 
Os4
Os4Os4
Os4
 
Os3
Os3Os3
Os3
 
Os2
Os2Os2
Os2
 
Unit4 desiging classes
Unit4 desiging classesUnit4 desiging classes
Unit4 desiging classes
 
Unit three identifying actors
Unit three  identifying actorsUnit three  identifying actors
Unit three identifying actors
 
Unit 5 testing
Unit 5 testingUnit 5 testing
Unit 5 testing
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unit 5 usability and satisfaction test
Unit 5 usability and satisfaction testUnit 5 usability and satisfaction test
Unit 5 usability and satisfaction test
 
Unit 5 testing -software quality assurance
Unit 5  testing -software quality assuranceUnit 5  testing -software quality assurance
Unit 5 testing -software quality assurance
 
Unit 4
Unit 4Unit 4
Unit 4
 
Unit 4 designing classes
Unit 4  designing classesUnit 4  designing classes
Unit 4 designing classes
 
Unit 3 object analysis-classification
Unit 3 object analysis-classificationUnit 3 object analysis-classification
Unit 3 object analysis-classification
 
Unit 3 attributes, methods, relationships
Unit 3 attributes, methods, relationshipsUnit 3 attributes, methods, relationships
Unit 3 attributes, methods, relationships
 
Unit 3
Unit 3Unit 3
Unit 3
 
Design rule 31
Design rule 31Design rule 31
Design rule 31
 

Último

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Último (20)

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

Os4

  • 1. OPERATING SYTEMS B.TECH II YR (TERM 08-09) UNIT 4 PPT SLIDES TEXT BOOKS: Operating System Concepts- Abraham Silberchatz, Peter B. Galvin, Greg Gagne 7th Edition, John Wiley Operating systems- A Concept based Approach- D.M.Dhamdhere, 2nd Edition, TMH. No. of slides:
  • 2. INDEX UNIT 4 PPT SLIDES S.NO. TOPIC LECTURE NO. PPTSLIDES 2 Swapping L25 L25.1 to L25.6 3 contiguous memory allocation L26 L26.1 to L26.5 4 Paging L27 L27.1 to L27.6 5 structure of the page table L28 L28.1 to L28.10 6 Segmentation L29 L29.1 to L29.13 7 page replacement L30 L30.1 to L30.9 8 case studies UNIX, Linux, Windows L31 L31.1 to L31.3 9 REVISION
  • 3. Swapping • A process can be swapped temporarily out of memory to a backing store, and then brought back into memory for continued execution • Backing store – fast disk large enough to accommodate copies of all memory images for all users; must provide direct access to these memory images • Roll out, roll in – swapping variant used for priority- based scheduling algorithms; lower-priority process is swapped out so higher-priority process can be loaded and executed • Major part of swap time is transfer time; total transfer time is directly proportional to the amount of memory swapped
  • 4. Schematic View of Swapping
  • 5. Base and Limit Registers • A pair of base and limit registers define the logical address space
  • 6. Multistep Processing of a User Program
  • 7. Memory-Management Unit (MMU) • Hardware device that maps virtual to physical address • In MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memory • The user program deals with logical addresses; it never sees the real physical addresses
  • 8. Dynamic relocation using a relocation register
  • 9. Contiguous Allocation • Main memory usually into two partitions: – Resident operating system, usually held in low memory with interrupt vector • User processes then held in high memory Relocation registers used to protect user processes from each other, and from changing operating-system code and data – Base register contains value of smallest physical address – Limit register contains range of logical addresses – each logical address must be less than the limit register – MMU maps logical address dynamically
  • 10. Hardware Support for Relocation and Limit Registers
  • 11. Contiguous Allocation (Cont) • Multiple-partition allocation – Hole – block of available memory; holes of various size are scattered throughout memory – When a process arrives, it is allocated memory from a hole large enough to accommodate it – Operating system maintains information about: a) allocated partitions b) free partitions (hole) OS OS OS OS process 5 process 5 process 5 process 5 process 9 process 9 process 8 process 10 process 2 process 2 process 2 process 2
  • 12. Fragmentation • External Fragmentation – total memory space exists to satisfy a request, but it is not contiguous • Internal Fragmentation – allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used • Reduce external fragmentation by compaction – Shuffle memory contents to place all free memory together in one large block – Compaction is possible only if relocation is dynamic, and is done at execution time – I/O problem • Latch job in memory while it is involved in I/O • Do I/O only into OS buffers
  • 13. Paging • Logical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter is available • Divide physical memory into fixed-sized blocks called frames (size is power of 2, between 512 bytes and 8,192 bytes) • Divide logical memory into blocks of same size called pages • Keep track of all free frames • To run a program of size n pages, need to find n free frames and load program • Set up a page table to translate logical to physical addresses • Internal fragmentation
  • 14. 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
  • 16. Paging Model of Logical and Physical Memory
  • 17. Paging Example 32-byte memory and 4-byte pages
  • 18. Free Frames Before allocation After allocation
  • 19. Implementation of Page Table • Page table is kept in main memory • Page-table base register (PTBR) points to the page table • Page-table length register (PRLR) indicates size of the page table • In this scheme every data/instruction access requires two memory accesses. One for the page table and one for the data/instruction. • The two memory access problem can be solved by the use of a special fast-lookup hardware cache called associative memory or translation look-aside buffers (TLBs) • Some TLBs store address-space identifiers (ASIDs) in each TLB entry – uniquely identifies each process to provide address-space protection for that process
  • 21. Shared Pages • Shared code – One copy of read-only (reentrant) code shared among processes (i.e., text editors, compilers, window systems). – Shared code must appear in same location in the logical address space of all processes • Private code and data – Each process keeps a separate copy of the code and data – The pages for the private code and data can appear anywhere in the logical address space
  • 24. Two-Level Paging Example • A logical address (on 32-bit machine with 1K page size) is divided into: – a page number consisting of 22 bits – a page offset consisting of 10 bits • Since the page table is paged, the page number is further divided into: – a 12-bit page number – a 10-bit page offset • Thus, a logical address is as follows: where pi is an index into the outer page table, and p2 is the displacement within the page of the outer page table page page offset number p pi 2 d 12 10 10
  • 27. Hashed Page Tables • Common in address spaces > 32 bits The virtual page number is hashed into a page table – This page table contains a chain of elements hashing to the same location Virtual page numbers are compared in this chain searching for a match – If a match is found, the corresponding physical frame is extracted
  • 28. Inverted Page Table • One entry for each real page of memory • Entry consists of the virtual address of the page stored in that real memory location, with information about the process that owns that page • Decreases memory needed to store each page table, but increases time needed to search the table when a page reference occurs • Use hash table to limit the search to one — or at most a few — page- table entries
  • 29. Segmentation • Memory-management scheme that supports user view of memory • A program is a collection of segments – A segment is a logical unit such as: main program procedure function method object local variables, global variables common block stack symbol table arrays
  • 30. Segmentation Architecture • Logical address consists of a two tuple: <segment-number, offset>, • Segment table – maps two-dimensional physical addresses; each table entry has: – base – contains the starting physical address where the segments reside in memory – limit – specifies the length of the segment • Segment-table base register (STBR) points to the segment table’s location in memory • Segment-table length register (STLR) indicates number of segments used by a program; segment number s is legal if s < STLR
  • 32. Logical to Physical Address Translation in Pentium
  • 35. Demand Paging • Bring a page into memory only when it is needed – Less I/O needed – Less memory needed – Faster response – More users • Page is needed ⇒ reference to it – invalid reference ⇒ abort – not-in-memory ⇒ bring to memory • Lazy swapper – never swaps a page into memory unless page will be needed – Swapper that deals with pages is a pager
  • 36. Page Fault • If there is a reference to a page, first reference to that page will trap to operating system: page fault 3. Operating system looks at another table to decide: – Invalid reference ⇒ abort – Just not in memory s Get empty frame s Swap page into frame s Reset tables s Set validation bit = v s Restart the instruction that caused the page fault
  • 37. Steps in Handling a Page Fault
  • 38. Performance of Demand Paging • Page Fault Rate 0 ≤ p ≤ 1.0 – if p = 0 no page faults – if p = 1, every reference is a fault • Effective Access Time (EAT) EAT = (1 – p) x memory access + p (page fault overhead + swap page out + swap page in + restart overhead
  • 39. Copy-on-Write • Copy-on-Write (COW) allows both parent and child processes to initially share the same pages in memory If either process modifies a shared page, only then is the page copied • COW allows more efficient process creation as only modified pages are copied
  • 40. Before Process 1 Modifies Page C
  • 41. After Process 1 Modifies Page C
  • 42. Page Replacement • Prevent over-allocation of memory by modifying page-fault service routine to include page replacement • Use modify (dirty) bit to reduce overhead of page transfers – only modified pages are written to disk • Page replacement completes separation between logical memory and physical memory – large virtual memory can be provided on a smaller physical memory
  • 43. Need For Page Replacement
  • 45. Graph of Page Faults Versus The Number of Frames
  • 46. FIFO Page Replacement FIFO Illustrating Belady’s Anomaly
  • 47. Optimal Page Replacement LRU Page Replacement
  • 48. Use Of A Stack to Record The Most Recent Page References
  • 49. Second-Chance (clock) Page- Replacement Algorithm
  • 50. Counting Algorithms • Keep a counter of the number of references that have been made to each page • LFU Algorithm: replaces page with smallest count • MFU Algorithm: based on the argument that the page with the smallest count was probably just brought in and has yet to be used
  • 51. Windows XP • Uses demand paging with clustering. Clustering brings in pages surrounding the faulting page • Processes are assigned working set minimum and working set maximum • Working set minimum is the minimum number of pages the process is guaranteed to have in memory • A process may be assigned as many pages up to its working set maximum • When the amount of free memory in the system falls below a threshold, automatic working set trimming is performed to restore the amount of free memory • Working set trimming removes pages from processes that have pages in excess of their working set minimum
  • 52. Solaris • Maintains a list of free pages to assign faulting processes • Lotsfree – threshold parameter (amount of free memory) to begin paging • Desfree – threshold parameter to increasing paging • Minfree – threshold parameter to being swapping • Paging is performed by pageout process • Pageout scans pages using modified clock algorithm • Scanrate is the rate at which pages are scanned. This ranges from slowscan to fastscan • Pageout is called more frequently depending upon the amount of free memory available
  • 53. Solaris 2 Page Scanner