From cd658673a35df8b0da3551e819e26d35c18b89f2 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Wed, 29 May 2024 19:53:52 +0200 Subject: mm: add stack based PMA use 8MiB reserved array to manage up to 4GiB of physical memory (4K Pages only) Signed-off-by: Tianhao Wang --- defs/x86_64-linker.ld | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'defs') diff --git a/defs/x86_64-linker.ld b/defs/x86_64-linker.ld index 39d8876..ac4a86c 100644 --- a/defs/x86_64-linker.ld +++ b/defs/x86_64-linker.ld @@ -83,6 +83,17 @@ SECTIONS *(".global_pagetable") } + . = ALIGN(4096); + /* reserve space for a premitive stack based physical frame allocator */ + /* each frame is 4KiB in size and has a 64bit (physical) address. e.g. */ + /* for every 1 GiB physical memory we need 2 MiB space reserved for the */ + /* free stack. For a easier bootstraping we are using a fix-sized stack */ + /* array. Currently using 4GiB, therefore reserve 8MiB. */ + PROVIDE (___FREE_PAGE_STACK__ = .); + .global_free_page_stack ALIGN(4096) (NOLOAD) : + { + *("..global_free_page_stack") + } . = ALIGN(4096); PROVIDE (___KERNEL_END__ = .); } -- cgit v1.2.3-70-g09d2