Docsity

Operating System - Memory Management - Notes, Study notes of Operating Systems

Partial preview of the text

Download Operating System - Memory Management - Notes and more Study notes Operating Systems in PDF only on Docsity!

MEMORY MANAGEMENT

OUTLINE

  • (^) Basic memory management
  • (^) Protection Hardware
  • (^) Swapping
  • (^) Memory Partition
  • (^) Paging
  • (^) Segmentation

Memory Management issues

  • (^) Basic Hardware issue.
  • (^) Binding of symbolic memory address to actual physical address.
  • (^) Difference between logical address and physical address
  • (^) Memory allocation & Deallocation

A typical instruction execution

cycle

  • (^) First instruction is fetched from memory.
  • (^) Then it is decoded and as per requirement operands are also fetched from memory.
  • (^) Operation is performed on the operands.
  • (^) Results are stored back to the memory.

Memory Management Task

  • (^) Operating system must manage sharing

of physical memory between many

processes

Basic Memory Hardware.

  • (^) Main Memory and registers are directly accessible to the processor.
  • (^) There are memory instruction that takes memory addresses as an argument, none of them take disk address.
  • (^) So every Data and instructions are required to loaded in to these direct access storage devices.

MEMORY PROTECTION

  • (^) Each Process needs separate memory space.
  • (^) The overlapping is not allowed.
  • (^) For separation we need to have
    • (^) Base Register
    • (^) Limit Register For any access to the main memory.

A base and a limit register define

a logical address space

Address Binding

  • (^) Two type of Addresses
    • (^) Symbolic Address (Generated by the program for example requirements like 5 memory blocks etc)
    • (^) Relocatable address (actual physical position of the memory block)
  • (^) Address Binding is required for any execution.

Address Binding

  • (^) Compile time :
  • (^) Load time :
  • (^) Execution time

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

How to get good performance.

  • (^) With High Degree of Multi programmability.
  • (^) More program should be there into main memory.
  • (^) So memory Swapping is required.

How to get good performance.

  • (^) Programs spend much of their time accessing memory, so performance is important!
  • (^) Programmers want unlimited fast memory, but
    • (^) Memory (hardware) has a cost
    • (^) Faster memory is more expensive
  • (^) The solution is to put a fast memory (Cache) Between Processor and main memory.