Operating systems

Introduction to memory virtualization

Prashanth L.A.


Lecture 13 starts here

So far


In the next few lectures

First steps

OS in the good old days

Sharing memory in a caring OS

A real view

Address space abstraction

A virtual view

Every address you see is virtual

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
    printf("location of code : %p\n", main);
    printf("location of heap : %p\n", malloc(100e6));
    int x = 3;
    printf("location of stack: %p\n", &x);
    return 0;

Address translation

A simple example

void func()
    int x;
x = x + 3; // this is the line of code we are interested in

If you dissemble