<aside> 💡 따라서 Page Fault 와 Resource Management를 수원하게 진행 할 수 있도록 Supplemental Page Table를 구현

</aside>

Supplemental Page Table

Supplemental Page Table 역할

Supplemental_Page_Table 구현

struct page 수정

struct page {
	const struct page_operations *operations;//페이지 관련 연산종류
	void *va;              /* Address in terms of user space */
	struct frame *frame;   //물리 메모리 프레임 주소

	/* Your implementation */
	struct hash_elem hash_elem;

...
}

hash 관련 보조함수 구현

static unsigned page_hash(const struct hash_elem *e, void *aux UNUSED)

// hash_elem를 넣으면 해당 페이지의 va에서 해시값을 추출 
unsigned 
page_hash (const struct hash_elem *e, void *aux){
	const struct page *p = hash_entry (e, struct page, hash_elem);
	
	return hash_bytes(&p->va, sizeof(p->va));
}