memory virtualization (메모리 가상화)

메모리 역사

Multi-User, Multiprogramming에서 메모리의 문제

메모리 가상화는 어떻게 이루어지는가?


Address Space (가상 주소를 대표)

image.png

실행중인 프로그램의 모든 주소는 가상이다

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

int main(int argc, char *argv[]){
	printf("location of code : %p\n", (void *) main);
	printf("location of code : %p\n", (void *) malloc(1));
	int x = 3;
	printf("location of code : %p\n", (void *) &x);
	
	return x;
}

result
location of code : 0x40057d
location of heap : 0xcf2010
location of stack : 0x7fff9ca45fcc

커널/사용자 영역