-
[Project 3_Virtual Memory]_IntroOS/Pintos P.J_3 2022. 1. 11. 20:16
프로젝트 1,2를 통해 muliple thread의 실행과 synchronization, 그리고 여러 프로그램을 한 번에 로드할 수 있게 되었다.
그러나 실행할 수있는 프로그램의 수와 해당 메모리는 각 가상 머신의 메인 메모리 사이즈까지로 제한적이었다.
project 3에서 환상 속의 무한의 메모리를 만듦으로써 이 제한을 없애볼 것이다.
백그라운드
소스파일
vm 폴더에서 작업할것이다.
아래 템플릿 파일들을 수정하게 된다.
- include/vm/vm.h, vm/vm.c
헤더 파일에서는 가상 메모리의 일반적 인터페이스를 제공한다. VM_UNINIT, VM_ANON, VM_FILE, VM_PAGE_CACHE 등은 우리가 구현할 가상 메모리 시스템을 support 하는 vm_type들이며 설명이 적혀있다(vm_page_change는 프로젝트 4와 관련 있으니 무시해라) - include/vm/uninit.h, vm/uninit.c
초기화 되지 않은 페이지들의 운영을 제공한다(vm_type = VM_UNINIT) . 현재 디자인에서 모든 페이지는 초기에 초기화되지 않은 페이지로 설정된 다음 익명 페이지 또는 파일 지원 페이지로 변환된다. - include/vm/anon.h, vm/anon.c
- include/vm/file.h, vm/file.c
- include/vm/inspect.h, vm/inspect.c
- include/devices/block.h, devices/block.c
대부분의 코드 작업을 vm폴터 안에서 할 거다. 대부분은 이전 프로젝트에서 소개된 파일들이지만 include/devices/block.h, devices/block.c 같은 몇몇 파일은 처음 마주치게 된다.
위 파일은 블럭 device에 대한 섹터 기반의 읽기와 쓰기 액세스를 제공하며, 이 인터페이스를 사용해 스왑 파티션에 블록 device로 액세스 한다.
(읽으면서도 무슨 말인지 모르겠다)
이후 내용은 page, frames, page tables 등 메모리 관련 전문용어들에 관한 설명이다.
더 자세한 프로젝트를 진행해가면서 틈틈이 필요한 내용을 살펴보자
Introduction · GitBook
Locate the page that faulted in the supplemental page table. If the memory reference is valid, use the supplemental page table entry to locate the data that goes in the page, which might be in the file system, or in a swap slot, or it might simply be an al
casys-kaist.github.io
'OS > Pintos P.J_3' 카테고리의 다른 글
Pintos project3_Swap In/Out (0) 2022.01.25 Pintos project3_Memory Mapped Files (0) 2022.01.22 Pintos project3_Stack Growth (0) 2022.01.21 Pintos project3_Anonymous Page (0) 2022.01.21 Pintos project3_Memory management (0) 2022.01.19 - include/vm/vm.h, vm/vm.c