From 44a53c72626bacee426f7ba51085893d0123ff94 Mon Sep 17 00:00:00 2001 From: hecatia-elegua <108802164+hecatia-elegua@users.noreply.github.com> Date: Mon, 8 May 2023 12:01:16 +0200 Subject: [PATCH] hack: remove specific frame --- kernel/frame_allocator/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/frame_allocator/src/lib.rs b/kernel/frame_allocator/src/lib.rs index 1ddfb52475..cd992b4084 100644 --- a/kernel/frame_allocator/src/lib.rs +++ b/kernel/frame_allocator/src/lib.rs @@ -161,6 +161,19 @@ pub fn init( } } + // needed for Acer Aspire 7745G: + // removes the single free chunk at 0x9F7FF000, which allows + // `add_reserved_region` to merge it in + let mut hacky_free_list: [Option; 32] = Default::default(); + for (idx, chunk) in free_list.iter().enumerate() { + if let Some(chunky) = chunk { + if chunky.start_address().value() != 0x9F7FF000 { + hacky_free_list[idx] = chunk.clone(); + } + } + } + let free_list = hacky_free_list; + *FREE_GENERAL_FRAMES_LIST.lock() = StaticArrayRBTree::new(free_list.clone()); *FREE_RESERVED_FRAMES_LIST.lock() = StaticArrayRBTree::new(reserved_list.clone()); *GENERAL_REGIONS.lock() = StaticArrayRBTree::new(free_list);