> A System Using Physical Addressing; 간단한 시스템에 사용
> A System Using Virtual Addressing
# MMU(Memory Management Unit); VA를 PA로 변환해주는 역할
> Address Spaces
# Linear address space {0, 1, 2, 3, 4, ...}
# Virtual address space {0, 1, 2, 3, 4, ..., N-1}; 2^n가지의 virtual address
# Physical address space {0, 1, 2, 3, 4, ..., M-1}; 2^m가지의 physical address
> VM as a Tool for Caching
# Virtual Memory; 실제 메모리 크기에 상관 없이 메모리를 이용할 수 있도록 가상의 메모리 주소를 사용하는 방법
3가지의 page로 구분된다.
# unallocated; virtual 상에는 index가 만들어져 있지만 data가 로딩된 적이 없다.
# cached; data가 로딩되서 메인메모리까지 올라갔다.
# uncached; disk 상에 mapping되어 있다.
> 가상 메모리 기법 - Paging
# Paging: 고정 크기로 분할된 페이지(page)를 통해 가상 메모리를 관리하는 기법
# Page Table(페이지 테이블); Virtual 페이지를 Physical 페이지에 매핑하는 PTEs(Page Table Entries)의 배열
# Page Hit; physical memory에 있는 VM word를 참조한다. (DRAM cache hit)
# Page Fault; 요청한 페이지가 physical memory에 있지 않은 경우
# Handling Page Fault
Page fault handler; Physical memory에서 교체될 victim을 선택
demand paging; waiting until the miss to copy the page to DRAM
요청이 들어와서 page fault가 나야만(demand가 생길 때) 실행된다.
# Allocating Pages (nonallocated가 새로 VM에 추가)
> VM as a Tool for memory Management
# key idea: 각 프로세스는 자신만의 virtual address space를 가지고 있다.
# Simplifying memory allocation
physical memory의 순서가 순차적일 필요가 없다.
# Sharing code and data among processes
중복적 mapping을 통해 physical address space를 효율적으로 사용할 수 있다.
> VM as a Tool for memory Protection
> Speeding up Translation with a TLB(Translation Lookaside Buffer)
'소프트웨어 전공 > 시스템 프로그램' 카테고리의 다른 글
[System Program] [9] Concurrent Programming (0) | 2021.05.31 |
---|---|
[System Program] [5] Exceptions and Processes (0) | 2021.05.30 |
[System Program] [4] Cache Memory (0) | 2021.05.30 |
[System Program] [3] Memory Hierarchy (0) | 2021.05.29 |
[System Program] [1] Data Presentation (0) | 2021.05.25 |