31436 Systems Software - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

31436 Systems Software

Description:

What do you understand by the comment 'this technique is good in a demand paged environment' ... Java applets are children' of MSIE browser window. Daniel COMARMOND ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 20
Provided by: danielco
Category:
Tags: msie | software | systems

less

Transcript and Presenter's Notes

Title: 31436 Systems Software


1
31436 Systems Software NetworksAUTUMN 2002
  • Tutorial 6
  • Memory Management

2
QUESTION 1
  • What do you understand by the comment "this
    technique is good in a demand paged environment"?
  • For the following data structure access methods,
    explain why they are "good" or "bad" in a demand
    paged environment.
  • stack operations
  • using a hashing mechanism to access data
  • sequential search
  • binary search
  • array access
  • use of pointers to access storage allocated from
    a heap

3
Paged Environment
  • RAM is partitioned into fixed frames of small and
    equal size.
  • Processes may be partitioned into pages to fit
    into frames. These pages are the same size or
    smaller than the frames in RAM.
  • Demand paging occurs where only the required
    pages of a process are loaded in RAM on demand.
  • So a good technique for demand paging is one
    which works well in an environment where the
    entire process doesnt need to be loaded into RAM

4
Good Techniques for Paging
  • What defines a technique as good in a demand
    paged environment?
  • It must be efficient the technique wont
    generate a large or unnecessary amount of page
    faults.
  • It would thus exhibit some adherence to the
    Locality Principle.

5
Paging and Data Access
  • A new process is created when a standard
    application is launched.
  • When the OS is ready, it will read the next
    sequence of job control commands.
  • Microsoft Windows applications
  • Microsoft PowerPoint 2000
  • POWERPNT.EXE
  • Sun StarOffice 5.2 for Windows
  • soffice.exe

6
Process Spawning
  • Existing process parent process creates a
    new child process.
  • Microsoft Internet Explorer
  • Java applets are children of MSIE browser
    window.

7
Operating System Services
  • A new process is created when the Operating
    System provides a service.
  • Microsoft Windows
  • Explorer.exe Windows GUI
  • spoolsv.exe Printer spooling service
  • Microsoft Windows 2000 Advanced Server
  • DNS.exe Domain Name Service Server
  • Inetinfo.exe Internet Information Server 5

8
QUESTION 2
  • What does the term "page reference string" mean?

9
Page Reference String
  • A page reference string is a string of page
    numbers.
  • When in a paging environment, this set of page
    numbers is generated by a process.
  • The set of page numbers is the order of logical
    addresses which will be accessed when the process
    is executing.

10
QUESTION 3
  • What is the page reference string for a program
    that uses in order the locations 0100, 0101,
    1100, 1CC4, 0100, 3199, 11E1, 2121, 2121, 4100,
    4199, 3F22? You can assume these are hexadecimal
    and that page size is 4096 bytes.
  • What would the page reference string be if the
    page sizes were 256 bytes?

11
Addresses from Hex to Binary
  • Hexadecimal 3F22
  • 3 F 2 2
  • 0011 1111 0010 0010
  • Binary 0011111100100010
  • These logical addresses are 16-bit addresses.

12
Offsets in Logical Addresses
  • For page size of 4096 bytes
  • 4096 212, therefore offset field is 12 bits.
  • From the original 16-bit logical address, we are
    now left with 4 bits for the page number.
  • For page size of 256 bytes
  • 256 28, therefore offset field is 8 bits.
  • From the original 16-bit logical address, we are
    now left with 8 bits for the page number.

13
Logical Addresses
  • Logical hex address 3F22 equates to 16-bit
    logical binary address 0011111100100010.
  • For page size of 4096 bytes
  • Page number is 4 left-hand bits 0011 0x3
  • Offset is remainder 111100100010 0xF22
  • For page size of 256 bytes
  • Page number is 8 left-hand bits 00111111 0x3F
  • Offset is remainder 00100010 0x22

14
Page Reference String
  • Recall that the hex locations were 0100, 0101,
    1100, 1CC4, 0100, 3199, 11E1, 2121, 2121, 4100,
    4199, 3F22.
  • For page size of 4096 bytes
  • Page number is 0011, which is 0x3.
  • Page reference string is 0, 0, 1, 1, 0, 3, 1, 2,
    2, 4, 4, 3.
  • For page size of 256 bytes
  • Page number is 00111111, which is 0x3F.
  • Page reference string is 01, 01, 11, 1C, 01, 31,
    11, 21, 21, 41, 41, 3F.

15
QUESTION 4
  • Using the page reference strings above, what are
    the number of page faults for two frames using
    LRU?

16
Least Recently Used
  • This is a replacement algorithm which selects a
    page to be paged out if it has been accessed less
    recently than any other page currently loaded in
    memory.
  • By the principle of locality, the page selected
    should also be the one least likely to be
    accessed again in the future.
  • This same rule may also be used in a cache to
    select which cache entry to flush.

17
LRU in Action
  • For page size of 4096 bytes
  • Page No. Frame 1 Frame 2 Page Fault
  • 0 - - YES
  • 0 0 - NO
  • 1 0 - YES
  • 1 0 1 NO
  • 0 0 1 NO
  • 3 0 1 YES
  • 1 0 3 YES
  • 2 1 3 YES
  • 2 1 2 NO
  • 4 1 2 YES
  • 4 4 2 NO
  • 3 4 2 YES

18
LRU in Action
  • For page size of 256 bytes
  • Page No. Frame 1 Frame 2 Page Fault
  • 01 - - YES
  • 01 01 - NO
  • 11 01 - YES
  • 1C 01 11 YES
  • 01 1C 11 YES
  • 31 1C 01 YES
  • 11 31 01 YES
  • 21 31 11 YES
  • 21 21 11 NO
  • 41 21 11 YES
  • 41 21 41 NO
  • 3F 21 41 YES

19
Need help? Ask me! )
  • Daniel COMARMOND
  • E-Mail dacomarm_at_it.uts.edu.au
  • ICQ 6606132
  • Phone 0421-036-986
  • Website http//charlie.it.uts.edu.au/dacomarm
  • THE SECRET WORD
  • Username www
  • Password rosebud
Write a Comment
User Comments (0)
About PowerShow.com