The number and size of programs that can run is limited by the machine's main memory size. In this assignment, you will remove that limitation by building an illusion of infinite memory.
- Each process has an independent set of user (virtual) pages, which are those pages below the virtual address KERN_BASE (0x8004000000). The set of kernel (virtual) pages, on the other hand, is global, and thus remain in the same position regardless of what thread or process is running. The kernel may access both user and kernel pages, but a user process may access only its own user pages.
-> 가상 메모리도 user부분과 kernel 부분이 나뉘어져 있다.
-> kernel 부분은 global 하기 때문에 virtual address 랑 physical address의 kernel부분은 동일하다.
- A segment here refers to a consecutive group of pages.
- In project 3, a page fault might only indicate that the page must be brought in from a file or swap slot.
해야 할 일
- 지금은 실행 전에 load(), load_segment()라는 함수에서 실행에 필요한 모든 데이터를 물리메모리에 올려버리고 있다. 이 방식은 매우 비효율적이므로, 모든 데이터를 다 올리는 대신에 실행 중에 해당 데이터가 필요하게 되면 그 때 물리메모리에 올리는 방식으로 변경하자.(Lazy Load)

- 현재 스택은 한개의 Page만 할당되어 있고, 한 Page 이상의 데이터를 저장하는 경우는 고려되지 않았다. 한 Page를 넘는 데이터를 저장하더라도 유동적으로 늘릴 수 있도록 변경하라.(Stack Growth)
- 프로그램을 많이 실행하거나, 많은 데이터를 저장하다보면 물리메모리가 가득 차서 무언가를 빼내야 하는 상황이 발생한다. 이를 고려하여 임시로 저장하는 공간인 Swap Disk를 만들고 빼낸 데이터는 잠시 이 곳에 넣어두기로 한다. Swap Disk는 갈 곳이 없는 것들만 넣어두는 것이고, File에서 불러온 데이터는 다시 File에 쓰면 된다.
The chain lists do not use dynamic allocation. Instead, each structure that can potentially be in a hash must embed a struct hash_elem member. All of the hash functions operate on these `struct hash_elem's.
I. Memory Management