Memory and Address Space
Memory Virtualization
초기의 OS
메모리에 하나의 프로세스만 로드
시대가 변하고 Multiprogramming and Time sharing로 바뀜

Address Space (가상화된)
os는 물리적인 메모리의 가상화된 공간을 생성

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


왜 0x400000부터 시작일까? 0x000000~400000전까지 kernel space가 차지하고 있다.

Memory API
malloc()
heap부분에 있는 메모리 공간에 할당된다.

Sizeof()
경우에 따라 결과가 2가지로 나타난다.


free()


pi는 남아있다. → **동적할당된 공간 (그림에서 allocated 라고 쓰여져있는 공간)만 확보함**
주의 할점!!!!!!!!!!!!!






calloc()

Double free
realloc()
System calls for allocation
malloc 라이브러리 호출은 “brk” 시스템콜을 사용할 수 있다.

System calls for memory mapping

효율성과 통제를 위한 메모리 가상화
Address translation 주소 변환
A single relocated process 혼자 재배치된 프로세스
Base and Bounds Register
메모리 가상화에 있어 OS의 이슈