14.MemoryManagement - MemoryManagementBasics 1 Basic Memory...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Memory Management Basics
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Program P Basic Memory Management Concepts Address spaces Physical address space — The address space supported by the hardware Starting at address 0, going to address MAX sys Logical/virtual address space — A process’s view of its own memory Starting at address 0, going to address MAX prog 0 MAX sys 0 MAX prog MOV r0, @0xfffa620e But where do addresses come from?
Background image of page 2
3 Which is bigger, physical or virtual address space? A. Physical address space B. Virtual address space C. It depends on the system.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Basic Concepts Address generation The compilation pipeline prog P : : foo() : : end P prog P : : foo() : : end P P : : push ... inc SP, x jmp _foo : foo: ... P : : push ... inc SP, x jmp _foo : foo: ... : push ... inc SP, 4 jmp 75 : ... : push ... inc SP, 4 jmp 75 : ... 0 75 1100 1175 Library Routines 1000 175 Library Routines Library Routines 0 100 Compilation Assembly Linking Loading : : : jmp 1175 : ... : : : jmp 175 : ... : : : jmp 175 : ...
Background image of page 4
5 Program Relocation Program issues virtual addresses Machine has physical addresses. If virtual == physical, then how can we have multiple programs resident concurrently? Instead, relocate virtual addresses to physical at run time. While we are relocating, also bounds check addresses for safety. I can relocate that program (safely) in two registers…
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Basic Concepts (Cont’d.) Address Translation 0 MAX sys Program Program P’s logical address space Program P’s logical address space 0 MAX prog 1000 1500 CPU + 1000 1000 Base Register Logical Addresses 500 500 Limit Register MEMORY EXCEPTION Physical Addresses yes no Instructions P’s physical address space
Background image of page 6
7 With base and bounds registers, the OS needs a hole in physical memory at least as big as the process.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 03/09/2012.

Page1 / 22

14.MemoryManagement - MemoryManagementBasics 1 Basic Memory...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online