Storage Management •   Logical vs Physical address •   MMU, Swapping                                   1
HOME     PREVIOUS TOPIC NEXTPREVIOUS QUESTION PAPERS FOR OSCPP TUTORIALS                                  2
RecapIn the last class, you have learnt•       Dynamic linking    -   advantages and disadvantages•        Overlays    adv...
Objectives On completion of this class, you will be able to  know• Logical and Physical addresses• MMU• Swapping          ...
Logical Vs Physical addressLogical address• Address generated by the CPUPhysical address• Address seen by the memory unit ...
Logical Vs Physical address• Execution time address binding scheme results  in different logical and physical addresses• A...
Memory Map Unit (MMU)• MMU is a hardware device• Maps virtual address to physical address at run  time• A simple MMU schem...
Relocation Register                      Base Register                              BA            Logical            Physi...
Memory Map Unit (MMU)• Address generated by the CPU are added to  relocation register as shown in previous slide• Physical...
Memory Map Unit• Example 1: Logical address    = 346 Relocation register = 14,000 Physical address   = 346+14000          ...
Dynamic relocation ( MMU )         Example 1                             11
Dynamic relocation ( MMU )                  Example 2                  Relocation                   register        Logica...
Swapping• A process needs to be in memory to be  executed• A process can be swapped temporarily out of  memory to a backin...
Schematic View of Swapping                             14
SwappingBacking store  – Fast disk large enough to accommodate copies of all    memory images for all users  – Must provid...
Swapping• In Multiprogramming environment and round-  robin CPU scheduling• When time quantum expires  – the memory manage...
Swapping• This process continues until all the processes  are executed• The memory manager swaps the processes  fast enoug...
18
SwappingPriority based scheduling   • Another variant of swapping policy• Higher priority process is swapped-in and lower ...
Swapping                      DiskMonitor          User          Partition                             20
Swapping (contd.)                         DiskMonitor          User          Partition                         User 1     ...
Swapping (contd.)                         DiskMonitor          User          PartitionUser 1                   User 1     ...
Swapping (contd.)                         DiskMonitor          User          Partition                         User 1User ...
Swapping (contd.)                         DiskMonitor          User          Partition                         User 1User ...
Swapping (contd.)                         DiskMonitor          User          Partition                         User 1User ...
Swapping (contd.)                         DiskMonitor          User          Partition                         User 1User ...
Swapping• Major part of swap time is transfer time• Total transfer time is directly proportional to the  amount of memory ...
Summary    In this class, you have learnt•   Logical and physical addresses•   MMU•   Swapping                            ...
Frequently Asked Questions•   Write the differences between logical and    physical address space•   Define logical, virtu...
Quiz1. Address seen by the memory unit  a) Logical  b) Physical  c) Virtual  d) None                                     30
Quiz2. Address generated by the CPU at compile  and load time  a) Logical  b) Physical  c) Virtual  d) None               ...
Quiz3. Address generated by the CPU at execution time  a) Logical  b) Physical  c) Virtual  d) None                       ...
Quiz4. A relocation register is a ______register  a) Base  b) Limit  c) Offset  d) None                                   ...
Quiz5. For ___________scheduling when time quantum  expires the memory manager will swap-out the  process to backing store...
Other subject materials•   Web designing•   Micro processors•   C++ tutorials•   javahome
Quiz6. Another variant of swapping policy-  a) Priority  b) Round robin  c) FIFO  d) None                                 ...
Quiz7. Total transfer time is directly proportional to the  amount of memory swapped  a) True  b) False                   ...
Upcoming SlideShare
Loading in …5
×

33

378 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
378
On SlideShare
0
From Embeds
0
Number of Embeds
35
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

33

  1. 1. Storage Management • Logical vs Physical address • MMU, Swapping 1
  2. 2. HOME PREVIOUS TOPIC NEXTPREVIOUS QUESTION PAPERS FOR OSCPP TUTORIALS 2
  3. 3. RecapIn the last class, you have learnt• Dynamic linking - advantages and disadvantages• Overlays advantages and disadvantages - 3
  4. 4. Objectives On completion of this class, you will be able to know• Logical and Physical addresses• MMU• Swapping 4
  5. 5. Logical Vs Physical addressLogical address• Address generated by the CPUPhysical address• Address seen by the memory unit i.e. the one loaded into memory- address registerCompile –time and Load time address binding methods generate same logical address and physical address 4
  6. 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. 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. 8. Relocation Register Base Register BA Logical Physical CPU Address AddressInstruction + Memory MA MA+BA Address 8
  9. 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. 10. Memory Map Unit• Example 1: Logical address = 346 Relocation register = 14,000 Physical address = 346+14000 = 14346 10
  11. 11. Dynamic relocation ( MMU ) Example 1 11
  12. 12. Dynamic relocation ( MMU ) Example 2 Relocation register Logical 14000 Physical address address MemoryCPU + 1800 15800 MMU 12
  13. 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. 14. Schematic View of Swapping 14
  15. 15. SwappingBacking 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. 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. 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. 18
  19. 19. SwappingPriority 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. 20. Swapping DiskMonitor User Partition 20
  21. 21. Swapping (contd.) DiskMonitor User Partition User 1 21
  22. 22. Swapping (contd.) DiskMonitor User PartitionUser 1 User 1 22
  23. 23. Swapping (contd.) DiskMonitor User Partition User 1User 1 User 2 23
  24. 24. Swapping (contd.) DiskMonitor User Partition User 1User 2 User 2 24
  25. 25. Swapping (contd.) DiskMonitor User Partition User 1User 2 User 2 25
  26. 26. Swapping (contd.) DiskMonitor User Partition User 1User 1 User 2 26
  27. 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. 28. Summary In this class, you have learnt• Logical and physical addresses• MMU• Swapping 28
  29. 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. 30. Quiz1. Address seen by the memory unit a) Logical b) Physical c) Virtual d) None 30
  31. 31. Quiz2. Address generated by the CPU at compile and load time a) Logical b) Physical c) Virtual d) None 31
  32. 32. Quiz3. Address generated by the CPU at execution time a) Logical b) Physical c) Virtual d) None 32
  33. 33. Quiz4. A relocation register is a ______register a) Base b) Limit c) Offset d) None 33
  34. 34. Quiz5. 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. 35. Other subject materials• Web designing• Micro processors• C++ tutorials• javahome
  36. 36. Quiz6. Another variant of swapping policy- a) Priority b) Round robin c) FIFO d) None 36
  37. 37. Quiz7. Total transfer time is directly proportional to the amount of memory swapped a) True b) False 37

×