Confusion with paging
Posted: Sat Apr 09, 2022 11:54 pm
Hi,
I feel akward when ask you guys those questions: can anyone give me a brielf explaination about paging? How does it work on higher half? Why user proccess can use up to 4 GiB while we only have 1 GiB RAM? How does mapping process actually do in Jose's tutorial, chapter 14, section "Proccess Page Table Setup", initproc_init() implementation, line 26, code:
Why he map his kernel up to 128 MiB while his kernel only 8 MiB in size? And in every user proccess, what is kernel stack use for and how to map it? I have read a lot of wikis, articles, documents, books and forums, even examine a lot of hobby OSes's code and still not understand.
Best Regards,
I feel akward when ask you guys those questions: can anyone give me a brielf explaination about paging? How does it work on higher half? Why user proccess can use up to 4 GiB while we only have 1 GiB RAM? How does mapping process actually do in Jose's tutorial, chapter 14, section "Proccess Page Table Setup", initproc_init() implementation, line 26, code:
Code: Select all
uint32_t vaddr_btm = 0;
while (vaddr_btm < PHYS_MAX) {
pte_t *pte = paging_walk_pgdir(proc->pgdir, vaddr_btm, true);
assert(pte != NULL);
paging_map_kpage(pte, vaddr_btm);
vaddr_btm += PAGE_SIZE;
}
Best Regards,