|
Size: 1589
Comment:
|
Size: 1699
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 7: | Line 7: |
| Line 10: | Line 9: |
| Line 12: | Line 10: |
| Line 19: | Line 16: |
| swapper_pg_dir is defined in head_32.S as | |
| Line 20: | Line 18: |
| swapper_pg_dir is defined in head_32.S as | |
| Line 23: | Line 20: |
| .align PAGE_SIZE_asm | .align PAGE_SIZE_asm |
| Line 25: | Line 22: |
| .fill 1024,4,0 | .fill 1024,4,0 |
| Line 27: | Line 24: |
| that creates an array of 1024 entries each of 4 bytes length (Page Directory entries in terms of Intel manual). A such definition allows ld program to place swapper_pg_dir at special predefined memory address while linking a kernel. It points to 0x1000 above the 'root' of kernel memory. Kernel memory is defined to start at PAGE_OFFSET, which is 0XC0000000 for x86, or 3 gigabytes. (This is where the 3G/1G split is defined.) Every virtual address above PAGE_OFFSET is the kernel, any address below PAGE_OFFSET is a user space. Further is available on [http://linux-mm.org/VirtualMemory] |
that creates an array of 1024 entries each of 4 bytes length (Page Directory entries in terms of Intel manual). A such definition allows ld program to place swapper_pg_dir at special predefined memory address while linking a kernel. It points to 0x1000 above the 'root' of kernel memory. Kernel memory is defined to start at PAGE_OFFSET, which is 0XC0000000 for x86, or 3 gigabytes. (This is where the 3G/1G split is defined.) Every virtual address above PAGE_OFFSET is the kernel, any address below PAGE_OFFSET is a user space. Further is available on http://linux-mm.org/VirtualMemory |
| Line 31: | Line 27: |
| Have to investigate | To be continued... Probably ;) == TODO == * Clean-up assembler files to use more #define from headers (long term) |
| Line 33: | Line 34: |
| CategoryHomepage | . CategoryHomepage |
Cyrill Gorcunov
Email: MailTo(gorcunov AT SPAMFREE gmail DOT com)
Interesting links
Virtual Memory: Issues Of Implementation http://www.eng.umd.edu/~blj/papers/computer31-6.pdf
Memory Subsystem (lecture) http://www.ece.gatech.edu/academic/courses/summer2007/ece3055/Lectures/VirtualMemory/VirtualMemory-lee.pdf
My notes on Linux kernel internals
x86-32 memory initialization
Paging is initialized in arch/x86/mm/init_32.c. The function 'paging_init()' is called once by setup_arch during kernel initialization. It immediately calls pagetable_init(). pagetable_init() starts by defining the base of the page table directory:
*pgd_base = swapper_pg_dir;
swapper_pg_dir is defined in head_32.S as
.section ".bss.page_aligned","wa"
.align PAGE_SIZE_asm
ENTRY(swapper_pg_dir)
.fill 1024,4,0that creates an array of 1024 entries each of 4 bytes length (Page Directory entries in terms of Intel manual). A such definition allows ld program to place swapper_pg_dir at special predefined memory address while linking a kernel. It points to 0x1000 above the 'root' of kernel memory. Kernel memory is defined to start at PAGE_OFFSET, which is 0XC0000000 for x86, or 3 gigabytes. (This is where the 3G/1G split is defined.) Every virtual address above PAGE_OFFSET is the kernel, any address below PAGE_OFFSET is a user space. Further is available on http://linux-mm.org/VirtualMemory
x86-32 memory initialization (SMP)
To be continued... Probably
TODO
- Clean-up assembler files to use more #define from headers (long term)
