An Example
Explore how address translation works in memory virtualization by examining a simple code example. Understand the need for translating virtual addresses to physical locations, and see how operating systems relocate processes transparently in physical memory using interposition techniques.
We'll cover the following...
To understand better what we need to do to implement address translation, and why we need such a mechanism, let’s look at a simple example. Imagine there is a process whose address space is as indicated in the figure below:
Looking at the disassembled code
What we are going to examine here is a short code sequence that loads a value from memory, increments it by three, and then stores the value back into memory. You can imagine the C-language representation of this code might look like this:
The compiler turns this line of code into assembly, which might look something like this (in x86 assembly). You may use objdump on Linux or otool on a Mac to disassemble it:
This code snippet is relatively ...