diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-28 21:54:42 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-28 21:54:42 +0100 |
commit | 700f4c412d42c9b9811269045c0e363a0331bba9 (patch) | |
tree | 260feed1ca657843d993c1ae73e93f25a17cede1 /kernel_stage2.ld | |
parent | 80c9af17330ac442a4c3d6d55b4041cbe923e9b4 (diff) | |
download | rpi-MMU-example-700f4c412d42c9b9811269045c0e363a0331bba9.tar.gz rpi-MMU-example-700f4c412d42c9b9811269045c0e363a0331bba9.zip |
split kernel into 2 stages; second stage gets copied to 0x0 and runs from there
Diffstat (limited to 'kernel_stage2.ld')
-rw-r--r-- | kernel_stage2.ld | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/kernel_stage2.ld b/kernel_stage2.ld new file mode 100644 index 0000000..d3a23bf --- /dev/null +++ b/kernel_stage2.ld @@ -0,0 +1,52 @@ +/* This sesond stage of the kernel is run from address 0x0 */ + +TRANSLATION_TABLE_SIZE = 4096 * 4; +MMU_SECTION_SIZE = 1 << 20; + +SECTIONS +{ + + . = 0x0; + + __start = .; + .kernel_stage2 : + { + KEEP(interrupt_vector.o) + . = ALIGN(4); + ramfs_embeddable.o + (*) + } + __end = .; + + . = ALIGN(1 << 14); + + .translation_table (NOLOAD) : + { + _translation_table_start = .; + + . = . + TRANSLATION_TABLE_SIZE; + + _translation_table_end = .; + } + + . = ALIGN(1 << 20); + . = . + MMU_SECTION_SIZE; + + .stack (NOLOAD) : + { + _stack_start = .; + + . = . + MMU_SECTION_SIZE; + + _stack_top = .; + } + + .unprivileged_memory (NOLOAD) : + { + _unprivileged_memory_start = .; + + . = . + MMU_SECTION_SIZE; + + _unprivileged_memory_end = .; + } +} |