SlideShare a Scribd company logo
Storage Management

 •   Logical vs Physical address
 •   MMU, Swapping




                                   1
HOME     PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS




                                  2
Recap

In the last class, you have learnt

•       Dynamic linking
    -   advantages and disadvantages


•        Overlays
    advantages and disadvantages
    -




                                       3
Objectives

 On completion of this class, you will be able to
  know

• Logical and Physical addresses

• MMU

• Swapping



                                                    4
Logical Vs Physical address
Logical address
• Address generated by the CPU

Physical address
• Address seen by the memory unit i.e. the one
  loaded into memory- address register

Compile –time and Load time address binding
 methods generate same logical address and
 physical address

                                            4
Logical Vs Physical address

• Execution time address binding scheme results
  in different logical and physical addresses
• Address generated by CPU at execution is
  referred as Virtual address
• Logical address space is the set of all logical
  addresses generated by program is a logical
  address space
                                                    5
Memory Map Unit (MMU)


• MMU is a hardware device

• Maps virtual address to physical address at run

  time

• A simple MMU scheme consists relocation register

• A relocation register is a base register
                                                    7
Relocation Register

                      Base Register
                              BA

            Logical            Physical
   CPU      Address            Address
Instruction               +                Memory
            MA                     MA+BA
 Address




                                                    8
Memory Map Unit (MMU)

• Address generated by the CPU are added to
  relocation register as shown in previous slide
• Physical address = logical address + contents
  of relocation register
• This process is called Dynamic relocation
• The user program deals with logical addresses;
  – it never sees the real physical addresses


                                                   9
Memory Map Unit

• Example 1:
 Logical address    = 346
 Relocation register = 14,000
 Physical address   = 346+14000
                    = 14346




                                  10
Dynamic relocation ( MMU )
         Example 1




                             11
Dynamic relocation ( MMU )
                  Example 2


                  Relocation
                   register
        Logical    14000       Physical
        address                address    Memory
CPU                 +
         1800                   15800




                   MMU


                                                   12
Swapping

• A process needs to be in memory to be

  executed

• A process can be swapped temporarily out of

  memory to a backing store

• Then brought back into memory for continued

  execution as shown in next slide
                                                13
Schematic View of Swapping




                             14
Swapping


Backing store

  – Fast disk large enough to accommodate copies of all

    memory images for all users

  – Must provide direct access to these memory images




                                                      15
Swapping
• In Multiprogramming environment and round-
  robin CPU scheduling
• When time quantum expires
  – the memory manager will swap-out the process to
    backing store
  – and swap-in another process to the memory space
    occupied by the swapped-out process



                                                      16
Swapping


• This process continues until all the processes

  are executed

• The memory manager swaps the processes

  fast enough

• All ways one process is present in memory


                                                   17
18
Swapping

Priority based scheduling
   • Another variant of swapping policy

• Higher priority process is swapped-in and lower
  priority swapped-out
• Here the variant used is
– roll-in and roll-out

• Example for Priority based scheduling in next
  slides
                                                    19
Swapping


                      Disk
Monitor

          User
          Partition




                             20
Swapping (contd.)


                         Disk
Monitor

          User
          Partition
                         User 1




                                  21
Swapping (contd.)


                         Disk
Monitor

          User
          Partition
User 1                   User 1




                                  22
Swapping (contd.)


                         Disk
Monitor

          User
          Partition
                         User 1
User 1


                         User 2


                                  23
Swapping (contd.)


                         Disk
Monitor

          User
          Partition
                         User 1
User 2

                         User 2


                                  24
Swapping (contd.)


                         Disk
Monitor

          User
          Partition
                         User 1
User 2

                         User 2


                                  25
Swapping (contd.)


                         Disk
Monitor

          User
          Partition
                         User 1
User 1


                         User 2


                                  26
Swapping

• Major part of swap time is transfer time

• Total transfer time is directly proportional to the

  amount of memory swapped

• Modified versions of swapping are found on

  many systems, i.e., UNIX, Linux, and Windows


                                                        27
Summary

    In this class, you have learnt

•   Logical and physical addresses

•   MMU

•   Swapping




                                     28
Frequently Asked Questions
•   Write the differences between logical and
    physical address space

•   Define logical, virtual and physical addresses

•   Draw and explain the basic dynamic
    relocation unit (MMU)

•   Explain the concept of swapping
                                                     29
Quiz

1. Address seen by the memory unit
  a) Logical
  b) Physical
  c) Virtual
  d) None




                                     30
Quiz

2. Address generated by the CPU at compile
  and load time
  a) Logical
  b) Physical
  c) Virtual
  d) None



                                             31
Quiz

3. Address generated by the CPU at execution time
  a) Logical
  b) Physical
  c) Virtual
  d) None




                                               32
Quiz

4. A relocation register is a ______register
  a) Base
  b) Limit
  c) Offset
  d) None




                                               33
Quiz

5. For ___________scheduling when time quantum
  expires the memory manager will swap-out the
  process to backing store
  a) Round robin
  b) Priority
  c) FIFO
  d) None


                                             34
Other subject materials

•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home
Quiz

6. Another variant of swapping policy-

  a) Priority

  b) Round robin

  c) FIFO

  d) None



                                         36
Quiz


7. Total transfer time is directly proportional to the

  amount of memory swapped

  a) True

  b) False




                                                         37

More Related Content

What's hot

process management
 process management process management
process management
Ashish Kumar
 
Process scheduling linux
Process scheduling linuxProcess scheduling linux
Process scheduling linux
Dr. C.V. Suresh Babu
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals
哲豪 康哲豪
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
Geonyzl Alviola
 
3 process management
3 process management3 process management
3 process management
Dr. Loganathan R
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switch
Daniel Ben-Zvi
 
Linux Kernel Memory Model
Linux Kernel Memory ModelLinux Kernel Memory Model
Linux Kernel Memory Model
SeongJae Park
 
Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how
Chirag Jog
 
MicroC/OS-II
MicroC/OS-IIMicroC/OS-II
Lect06
Lect06Lect06
Lect06
Vin Voro
 
Kcd226 Sistem Operasi Lecture04
Kcd226 Sistem Operasi Lecture04Kcd226 Sistem Operasi Lecture04
Kcd226 Sistem Operasi Lecture04
Cahyo Darujati
 
Chronon - A Back-In-Time-Debugger for Java
Chronon - A Back-In-Time-Debugger for JavaChronon - A Back-In-Time-Debugger for Java
Chronon - A Back-In-Time-Debugger for Java
tsauerwein
 
RTOS MICRO CONTROLLER OPERATING SYSTEM-2
RTOS MICRO CONTROLLER OPERATING SYSTEM-2RTOS MICRO CONTROLLER OPERATING SYSTEM-2
RTOS MICRO CONTROLLER OPERATING SYSTEM-2
JOLLUSUDARSHANREDDY
 
MapReduce basics
MapReduce basicsMapReduce basics
MapReduce basics
Harisankar H
 
Q2.12: Scheduler Inputs
Q2.12: Scheduler InputsQ2.12: Scheduler Inputs
Q2.12: Scheduler Inputs
Linaro
 
水晶礦脈
水晶礦脈水晶礦脈
水晶礦脈
guest2571e4
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and output
Sanidhya Chugh
 
HKG15-100: What is Linaro working on - core development lightning talks
HKG15-100:  What is Linaro working on - core development lightning talksHKG15-100:  What is Linaro working on - core development lightning talks
HKG15-100: What is Linaro working on - core development lightning talks
Linaro
 

What's hot (18)

process management
 process management process management
process management
 
Process scheduling linux
Process scheduling linuxProcess scheduling linux
Process scheduling linux
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
3 process management
3 process management3 process management
3 process management
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switch
 
Linux Kernel Memory Model
Linux Kernel Memory ModelLinux Kernel Memory Model
Linux Kernel Memory Model
 
Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how
 
MicroC/OS-II
MicroC/OS-IIMicroC/OS-II
MicroC/OS-II
 
Lect06
Lect06Lect06
Lect06
 
Kcd226 Sistem Operasi Lecture04
Kcd226 Sistem Operasi Lecture04Kcd226 Sistem Operasi Lecture04
Kcd226 Sistem Operasi Lecture04
 
Chronon - A Back-In-Time-Debugger for Java
Chronon - A Back-In-Time-Debugger for JavaChronon - A Back-In-Time-Debugger for Java
Chronon - A Back-In-Time-Debugger for Java
 
RTOS MICRO CONTROLLER OPERATING SYSTEM-2
RTOS MICRO CONTROLLER OPERATING SYSTEM-2RTOS MICRO CONTROLLER OPERATING SYSTEM-2
RTOS MICRO CONTROLLER OPERATING SYSTEM-2
 
MapReduce basics
MapReduce basicsMapReduce basics
MapReduce basics
 
Q2.12: Scheduler Inputs
Q2.12: Scheduler InputsQ2.12: Scheduler Inputs
Q2.12: Scheduler Inputs
 
水晶礦脈
水晶礦脈水晶礦脈
水晶礦脈
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and output
 
HKG15-100: What is Linaro working on - core development lightning talks
HKG15-100:  What is Linaro working on - core development lightning talksHKG15-100:  What is Linaro working on - core development lightning talks
HKG15-100: What is Linaro working on - core development lightning talks
 

Viewers also liked

Address Binding Scheme
Address Binding SchemeAddress Binding Scheme
Address Binding Scheme
Rajesh Piryani
 
34 single partition allocation
34 single partition allocation34 single partition allocation
34 single partition allocation
myrajendra
 
Os7
Os7Os7
Os7
issbp
 
Cn v-sem
Cn v-semCn v-sem
Cn v-sem
Boobaalan
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process management
Aisyah Rafiuddin
 
Deleting structure.56
Deleting structure.56Deleting structure.56
Deleting structure.56
myrajendra
 
Set model and page fault.44
Set model and page fault.44Set model and page fault.44
Set model and page fault.44
myrajendra
 
File directory definition 54(2)
File directory definition 54(2)File directory definition 54(2)
File directory definition 54(2)
myrajendra
 
Files concepts.53
Files concepts.53Files concepts.53
Files concepts.53
myrajendra
 
Disk scheduling.49
Disk scheduling.49Disk scheduling.49
Disk scheduling.49
myrajendra
 
Operations on a directory 54(3
Operations on a directory 54(3Operations on a directory 54(3
Operations on a directory 54(3
myrajendra
 
38 paged segmentation
38 paged segmentation38 paged segmentation
38 paged segmentation
myrajendra
 
Issues in acyclic graph directories.57 to 58
Issues in acyclic graph directories.57 to 58Issues in acyclic graph directories.57 to 58
Issues in acyclic graph directories.57 to 58
myrajendra
 
File management53(1)
File management53(1)File management53(1)
File management53(1)
myrajendra
 
41 page replacement fifo
41 page replacement fifo41 page replacement fifo
41 page replacement fifo
myrajendra
 
35. multiplepartitionallocation
35. multiplepartitionallocation35. multiplepartitionallocation
35. multiplepartitionallocation
myrajendra
 
Acyclic grapch directory 56(2)
Acyclic grapch directory 56(2)Acyclic grapch directory 56(2)
Acyclic grapch directory 56(2)
myrajendra
 
Memory Management in Windows 7
Memory Management in Windows 7Memory Management in Windows 7
Memory Management in Windows 7
Naveed Qadri
 
42 lru optimal
42 lru optimal42 lru optimal
42 lru optimal
myrajendra
 
36 fragmentaio nnd pageconcepts
36 fragmentaio nnd pageconcepts36 fragmentaio nnd pageconcepts
36 fragmentaio nnd pageconcepts
myrajendra
 

Viewers also liked (20)

Address Binding Scheme
Address Binding SchemeAddress Binding Scheme
Address Binding Scheme
 
34 single partition allocation
34 single partition allocation34 single partition allocation
34 single partition allocation
 
Os7
Os7Os7
Os7
 
Cn v-sem
Cn v-semCn v-sem
Cn v-sem
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process management
 
Deleting structure.56
Deleting structure.56Deleting structure.56
Deleting structure.56
 
Set model and page fault.44
Set model and page fault.44Set model and page fault.44
Set model and page fault.44
 
File directory definition 54(2)
File directory definition 54(2)File directory definition 54(2)
File directory definition 54(2)
 
Files concepts.53
Files concepts.53Files concepts.53
Files concepts.53
 
Disk scheduling.49
Disk scheduling.49Disk scheduling.49
Disk scheduling.49
 
Operations on a directory 54(3
Operations on a directory 54(3Operations on a directory 54(3
Operations on a directory 54(3
 
38 paged segmentation
38 paged segmentation38 paged segmentation
38 paged segmentation
 
Issues in acyclic graph directories.57 to 58
Issues in acyclic graph directories.57 to 58Issues in acyclic graph directories.57 to 58
Issues in acyclic graph directories.57 to 58
 
File management53(1)
File management53(1)File management53(1)
File management53(1)
 
41 page replacement fifo
41 page replacement fifo41 page replacement fifo
41 page replacement fifo
 
35. multiplepartitionallocation
35. multiplepartitionallocation35. multiplepartitionallocation
35. multiplepartitionallocation
 
Acyclic grapch directory 56(2)
Acyclic grapch directory 56(2)Acyclic grapch directory 56(2)
Acyclic grapch directory 56(2)
 
Memory Management in Windows 7
Memory Management in Windows 7Memory Management in Windows 7
Memory Management in Windows 7
 
42 lru optimal
42 lru optimal42 lru optimal
42 lru optimal
 
36 fragmentaio nnd pageconcepts
36 fragmentaio nnd pageconcepts36 fragmentaio nnd pageconcepts
36 fragmentaio nnd pageconcepts
 

Similar to 33

31 address binding, dynamic loading
31 address binding, dynamic loading31 address binding, dynamic loading
31 address binding, dynamic loading
myrajendra
 
Memory Management techniques -ch8_1.pptx
Memory Management techniques -ch8_1.pptxMemory Management techniques -ch8_1.pptx
Memory Management techniques -ch8_1.pptx
KongaMadhukar
 
32 dynamic linking nd overlays
32 dynamic linking nd overlays32 dynamic linking nd overlays
32 dynamic linking nd overlays
myrajendra
 
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management
Maitree Patel
 
Chapter 02 modified
Chapter 02 modifiedChapter 02 modified
Chapter 02 modified
Jugal Doshi
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
Anwal Mirza
 
Virtual circuit and Datagram network
Virtual circuit and Datagram networkVirtual circuit and Datagram network
Virtual circuit and Datagram network
Maitree Patel
 
Processes and Thread OS_Tanenbaum_3e
Processes and Thread OS_Tanenbaum_3eProcesses and Thread OS_Tanenbaum_3e
Processes and Thread OS_Tanenbaum_3e
Le Gia Hoang
 
Virtual memory 20070222-en
Virtual memory 20070222-enVirtual memory 20070222-en
Virtual memory 20070222-en
Tetsuyuki Kobayashi
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
Amanuelmergia
 
Memory Management Strategies - II.pdf
Memory Management Strategies - II.pdfMemory Management Strategies - II.pdf
Memory Management Strategies - II.pdf
Harika Pudugosula
 
Intel® hyper threading technology
Intel® hyper threading technologyIntel® hyper threading technology
Intel® hyper threading technology
Amirali Sharifian
 
Chapter07_ds.ppt
Chapter07_ds.pptChapter07_ds.ppt
Chapter07_ds.ppt
AvadhRakholiya3
 
Chapter1 Computer System Overview.ppt
Chapter1 Computer System Overview.pptChapter1 Computer System Overview.ppt
Chapter1 Computer System Overview.ppt
ShikhaManrai1
 
M20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptxM20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptx
HarikishnaKNHk
 
MODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxMODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptx
senthilkumar969017
 
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
Bitta_man
 
Ch5 process synchronization
Ch5   process synchronizationCh5   process synchronization
Ch5 process synchronization
Welly Dian Astika
 
Chapter1 Computer System Overview Part-1.ppt
Chapter1 Computer System Overview Part-1.pptChapter1 Computer System Overview Part-1.ppt
Chapter1 Computer System Overview Part-1.ppt
ShikhaManrai1
 

Similar to 33 (20)

31 address binding, dynamic loading
31 address binding, dynamic loading31 address binding, dynamic loading
31 address binding, dynamic loading
 
Memory Management techniques -ch8_1.pptx
Memory Management techniques -ch8_1.pptxMemory Management techniques -ch8_1.pptx
Memory Management techniques -ch8_1.pptx
 
32 dynamic linking nd overlays
32 dynamic linking nd overlays32 dynamic linking nd overlays
32 dynamic linking nd overlays
 
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management
 
Chapter 02 modified
Chapter 02 modifiedChapter 02 modified
Chapter 02 modified
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
Virtual circuit and Datagram network
Virtual circuit and Datagram networkVirtual circuit and Datagram network
Virtual circuit and Datagram network
 
Processes and Thread OS_Tanenbaum_3e
Processes and Thread OS_Tanenbaum_3eProcesses and Thread OS_Tanenbaum_3e
Processes and Thread OS_Tanenbaum_3e
 
Virtual memory 20070222-en
Virtual memory 20070222-enVirtual memory 20070222-en
Virtual memory 20070222-en
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
 
Memory Management Strategies - II.pdf
Memory Management Strategies - II.pdfMemory Management Strategies - II.pdf
Memory Management Strategies - II.pdf
 
Intel® hyper threading technology
Intel® hyper threading technologyIntel® hyper threading technology
Intel® hyper threading technology
 
Chapter07_ds.ppt
Chapter07_ds.pptChapter07_ds.ppt
Chapter07_ds.ppt
 
Chapter1 Computer System Overview.ppt
Chapter1 Computer System Overview.pptChapter1 Computer System Overview.ppt
Chapter1 Computer System Overview.ppt
 
M20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptxM20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptx
 
MODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxMODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.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
 
Ch5 process synchronization
Ch5   process synchronizationCh5   process synchronization
Ch5 process synchronization
 
Chapter1 Computer System Overview Part-1.ppt
Chapter1 Computer System Overview Part-1.pptChapter1 Computer System Overview Part-1.ppt
Chapter1 Computer System Overview Part-1.ppt
 

More from myrajendra

Fundamentals
FundamentalsFundamentals
Fundamentals
myrajendra
 
Data type
Data typeData type
Data type
myrajendra
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
myrajendra
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
myrajendra
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
myrajendra
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
myrajendra
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
myrajendra
 
Dao example
Dao exampleDao example
Dao example
myrajendra
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
myrajendra
 
Internal
InternalInternal
Internal
myrajendra
 
3. elements
3. elements3. elements
3. elements
myrajendra
 
2. attributes
2. attributes2. attributes
2. attributes
myrajendra
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
myrajendra
 
Headings
HeadingsHeadings
Headings
myrajendra
 
Forms
FormsForms
Forms
myrajendra
 
Css
CssCss
Views
ViewsViews
Views
myrajendra
 
Views
ViewsViews
Views
myrajendra
 
Views
ViewsViews
Views
myrajendra
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
myrajendra
 

More from myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

33

  • 1. Storage Management • Logical vs Physical address • MMU, Swapping 1
  • 2. HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS 2
  • 3. Recap In the last class, you have learnt • Dynamic linking - advantages and disadvantages • Overlays advantages and disadvantages - 3
  • 4. Objectives On completion of this class, you will be able to know • Logical and Physical addresses • MMU • Swapping 4
  • 5. Logical Vs Physical address Logical address • Address generated by the CPU Physical address • Address seen by the memory unit i.e. the one loaded into memory- address register Compile –time and Load time address binding methods generate same logical address and physical address 4
  • 6. Logical Vs Physical address • Execution time address binding scheme results in different logical and physical addresses • Address generated by CPU at execution is referred as Virtual address • Logical address space is the set of all logical addresses generated by program is a logical address space 5
  • 7. Memory Map Unit (MMU) • MMU is a hardware device • Maps virtual address to physical address at run time • A simple MMU scheme consists relocation register • A relocation register is a base register 7
  • 8. Relocation Register Base Register BA Logical Physical CPU Address Address Instruction + Memory MA MA+BA Address 8
  • 9. Memory Map Unit (MMU) • Address generated by the CPU are added to relocation register as shown in previous slide • Physical address = logical address + contents of relocation register • This process is called Dynamic relocation • The user program deals with logical addresses; – it never sees the real physical addresses 9
  • 10. Memory Map Unit • Example 1: Logical address = 346 Relocation register = 14,000 Physical address = 346+14000 = 14346 10
  • 11. Dynamic relocation ( MMU ) Example 1 11
  • 12. Dynamic relocation ( MMU ) Example 2 Relocation register Logical 14000 Physical address address Memory CPU + 1800 15800 MMU 12
  • 13. Swapping • A process needs to be in memory to be executed • A process can be swapped temporarily out of memory to a backing store • Then brought back into memory for continued execution as shown in next slide 13
  • 14. Schematic View of Swapping 14
  • 15. Swapping Backing store – Fast disk large enough to accommodate copies of all memory images for all users – Must provide direct access to these memory images 15
  • 16. Swapping • In Multiprogramming environment and round- robin CPU scheduling • When time quantum expires – the memory manager will swap-out the process to backing store – and swap-in another process to the memory space occupied by the swapped-out process 16
  • 17. Swapping • This process continues until all the processes are executed • The memory manager swaps the processes fast enough • All ways one process is present in memory 17
  • 18. 18
  • 19. Swapping Priority based scheduling • Another variant of swapping policy • Higher priority process is swapped-in and lower priority swapped-out • Here the variant used is – roll-in and roll-out • Example for Priority based scheduling in next slides 19
  • 20. Swapping Disk Monitor User Partition 20
  • 21. Swapping (contd.) Disk Monitor User Partition User 1 21
  • 22. Swapping (contd.) Disk Monitor User Partition User 1 User 1 22
  • 23. Swapping (contd.) Disk Monitor User Partition User 1 User 1 User 2 23
  • 24. Swapping (contd.) Disk Monitor User Partition User 1 User 2 User 2 24
  • 25. Swapping (contd.) Disk Monitor User Partition User 1 User 2 User 2 25
  • 26. Swapping (contd.) Disk Monitor User Partition User 1 User 1 User 2 26
  • 27. Swapping • Major part of swap time is transfer time • Total transfer time is directly proportional to the amount of memory swapped • Modified versions of swapping are found on many systems, i.e., UNIX, Linux, and Windows 27
  • 28. Summary In this class, you have learnt • Logical and physical addresses • MMU • Swapping 28
  • 29. Frequently Asked Questions • Write the differences between logical and physical address space • Define logical, virtual and physical addresses • Draw and explain the basic dynamic relocation unit (MMU) • Explain the concept of swapping 29
  • 30. Quiz 1. Address seen by the memory unit a) Logical b) Physical c) Virtual d) None 30
  • 31. Quiz 2. Address generated by the CPU at compile and load time a) Logical b) Physical c) Virtual d) None 31
  • 32. Quiz 3. Address generated by the CPU at execution time a) Logical b) Physical c) Virtual d) None 32
  • 33. Quiz 4. A relocation register is a ______register a) Base b) Limit c) Offset d) None 33
  • 34. Quiz 5. For ___________scheduling when time quantum expires the memory manager will swap-out the process to backing store a) Round robin b) Priority c) FIFO d) None 34
  • 35. Other subject materials • Web designing • Micro processors • C++ tutorials • java home
  • 36. Quiz 6. Another variant of swapping policy- a) Priority b) Round robin c) FIFO d) None 36
  • 37. Quiz 7. Total transfer time is directly proportional to the amount of memory swapped a) True b) False 37