Skip to content

Commit 0c3e379

Browse files
Runnable buddy PR
runnable, with many logs, tests not checked yet runnable platform: 1.qemu_virt64_aarch64 --- fix bugs: 1.multiple DRAM_BASE : kernel/src/boards/qemu_virt64_aarch64/mod.rs 2.multiple instances of BUDDY_ALLOC : kernel/src/allocator/mod.rs 3.use PHYS_DRAM_SIZE when link.x links all symbols with linearmap offset 4.buddy init code ignore kernel image part in memory layout 5.metadata_end's calculation should sub linearmap_offset first 6.buddy init code set zero [mem_start, page_array_size] directly, ignore kernel image part --- modified: kernel/src/allocator/Kconfig kernel/src/allocator/buddy/heap.rs kernel/src/allocator/buddy/mod.rs kernel/src/allocator/buddy/page.rs kernel/src/allocator/buddy/tests.rs kernel/src/allocator/mod.rs kernel/src/boards/qemu_virt64_aarch64/config.rs : define DRAM_SIZE kernel/src/boards/qemu_virt64_aarch64/link.x : LENGTH = 125.5M, increase linearmap region size from 32M to 125.5M kernel/src/boards/qemu_virt64_aarch64/mod.rs : pub use DRAM_SIZE
1 parent 204bf7a commit 0c3e379

9 files changed

Lines changed: 1270 additions & 6 deletions

File tree

kernel/src/allocator/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ config SLAB_DYNAMIC_MAX_TOTAL_PAGES
3535
int "Max total pages in page pool"
3636
default 32
3737
depends on ALLOCATOR_SLAB_DYNAMIC
38+
39+
config BUDDY_ALLOCATOR
40+
bool "Enable buddy allocator as physical page manager"
41+
default y
42+
help
43+
Enable the buddy allocator to manage all physical memory pages.
44+
When enabled, slab allocator operates on top of buddy-allocated
45+
page pools; >= PAGE_SIZE allocations go directly to buddy;
46+
tlsf/llff keep their original __heap_start~__heap_end path.
47+
When disabled, the kernel falls back to direct heap management.

0 commit comments

Comments
 (0)