Lecture11.pdf - CS 5323 \u2013 OS II Lecture 11 \u2013 Main Memory Management \u00a9 Sathyanarayanan Aakur Adapted from Operating Systems Concepts-10th Edition 1

Lecture11.pdf - CS 5323 u2013 OS II Lecture 11 u2013 Main...

This preview shows page 1 - 9 out of 53 pages.

CS 5323 – OS II Lecture 11 – Main Memory Management 1 © Sathyanarayanan Aakur, Adapted from Operating Systems Concepts -10th Edition
Image of page 1
Logistics Assignment 3 due 03/15/2020 at 9:00 am Quiz 7 will be posted. © Sathyanarayanan Aakur, Adapted from Operating Systems Concepts -10th Edition 2
Image of page 2
Background Program must be brought (from disk) into memory and placed within a process for it to be run Fetch -> Decode -> Execute Fetch next instruction from memory Decode the new instruction – If necessary: fetch operands (data) from memory Execute the instruction – If necessary: save results (new data) to memory Main memory and registers are only storage CPU can access directly There are no machine instructions taking disk addresses as arguments Memory unit only sees a stream of: addresses + read requests, or address + data and write requests Register access is done in one CPU clock (or less); very fast memories Main memory can take many cycles, causing a stall Cache sits between main memory and CPU registers; solution to stall issue Protection of memory required to ensure correct operation; hardware-level soln.
Image of page 3
Protection Need to censure that a process can access only access those addresses in it address space. We can provide this protection by using a pair of base and limit registers define the logical address space of a process Smallest legal physical memory address Range of valid memory addresses
Image of page 4
Hardware Address Protection CPU must check every memory access generated in user mode to be sure it is between base and limit for that user the instructions to loading the base and limit registers are privileged
Image of page 5
Address Binding Programs on disk, ready to be brought into memory to execute form an input queue Without support, must be loaded into address 0000 Inconvenient to have first user process physical address always at 0000 How can it not be? Addresses represented in different ways at different stages of a program ʼ s life Source code addresses usually symbolic Compiled code addresses bind to relocatable addresses i.e. 14 bytes from beginning of this module Linker or loader will bind relocatable addresses to absolute addresses i.e. 74014 Each binding maps one address space to another
Image of page 6
Binding of Instructions and Data to Memory Address binding of instructions and data to memory addresses can happen at three different stages Compile time : If memory location known a priori, absolute code can be generated; must recompile code if starting location changes Load time : Must generate relocatable code if memory location is not known at compile time Execution time : Binding delayed until run time if the process can be moved during its execution from one memory segment to another Need hardware support for address maps (e.g., base and limit registers)
Image of page 7
Logical vs. Physical Address Space The concept of a logical address space that is bound to a separate physical address space is central to proper memory management Logical address – generated by the CPU; also referred to as
Image of page 8
Image of page 9

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture