1 May 2007 20:10
page mapping
Giovanni Visciano <giovanni_visciano <at> yahoo.it>
2007-05-01 18:10:38 GMT
2007-05-01 18:10:38 GMT
PC config. Introduction: ************* - mmu_init() [sys/arch/i386/i386/mmu.c]: 1) We get the number of pages that the installed RAM can contain: nr_page = boot_info->main_mem.size / PAGE_SIZE; 2) and the number of Page Table (2^ level paging) needed to address "nr_page" pages: nr_pte = (nr_page + 1023) / 1024; 3) Then the Page Directory (1^ level paging) index, this is the entry for the virtual address 2G. pgd_index = PAGE_DIR(PAGE_OFFSET) (=512) Question/problem: ***************** - Build kernel page tables for WHOLE physical pages: If the installed RAM size is >2GB, how can we cover all the physical pages? A) Number of Page Directory Entries problem. For example, with 3GB of RAM we have: nr_page=786432, nr_pte=768. Starting from kernel_pgd[512] and going up to kernel_pgd[1023] there is only space for 512 Page Directory Entries, thereby for 2GB of RAM covered by 4KB pages. B) 4GB RAM problem.(Continue reading)
RSS Feed