/**
* 2-level page table abstraction
*/
struct pte {
bool valid;
bool writable;
unsigned int pfn;
unsigned int private; /* May used to backup something ... */
};
struct pte_directory {
struct pte ptes[NR_PTES_PER_PAGE];
};
struct pagetable {
struct pte_directory *outer_ptes[NR_PTES_PER_PAGE];
};
/**
* Simplified PCB
*/
struct process {
unsigned int pid;
struct pagetable pagetable;
struct list_head list; /* List head to chain processes on the system */
};
------------------------------------------------------------------------------------------------구조체
/**
* Initial process
*/
static struct process init = {
.pid = 0,
.list = LIST_HEAD_INIT(init.list),
.pagetable = {
.outer_ptes = { NULL },
},
};
------------------------------------------------------------------------------------------------초기화
current->pagetable.outer_ptes[0]->ptes[0].pfn=10;
이렇게 쓰려고하는데 segmentation fault 나오는데 어떻게 입력해야되나요ㅠㅠ
오류 떠서 다시 썼는데 등록됬었네 ㅈㅅㅈㅅ