Skip to content

Reserve multiboot physical memory#344

Merged
wipawel merged 1 commit into
KernelTestFramework:mainlinefrom
sparchatus:reserve_multiboot
Dec 4, 2024
Merged

Reserve multiboot physical memory#344
wipawel merged 1 commit into
KernelTestFramework:mainlinefrom
sparchatus:reserve_multiboot

Conversation

@sparchatus
Copy link
Copy Markdown
Contributor

Fixes #342 by passing the multiboot memory range to the physical memory manager. The physical memory manager then skips any memory overlapping with the multiboot memory range.

@sparchatus sparchatus requested a review from a team as a code owner December 2, 2024 09:07
@sparchatus
Copy link
Copy Markdown
Contributor Author

Just realized there might be an issue when there is no multiboot image since the range would then be the empty range at 0 and block the first physical memory page.

Comment thread arch/x86/boot/multiboot.c Outdated
Comment thread common/setup.c Outdated
Comment thread mm/pmm.c Outdated
Comment thread mm/pmm.c Outdated
Comment thread arch/x86/boot/multiboot.c Outdated
Comment thread arch/x86/boot/multiboot.c Outdated
Comment thread include/mm/regions.h Outdated
Comment thread include/multiboot.h
Comment thread mm/regions.c Outdated
Comment thread mm/regions.c Outdated
Comment thread mm/regions.c Outdated
@sparchatus sparchatus mentioned this pull request Dec 3, 2024
@wipawel wipawel added the bugfix This fixes a bug label Dec 3, 2024
@wipawel
Copy link
Copy Markdown
Contributor

wipawel commented Dec 3, 2024

In the future, we probably should add another flag reserved to the frame_t and handle it properly in the PMM. Then, maybe instead of skipping the frames, we could create them and reserve (consume) them immediately. Same should apply to all the memory regions reported as reserved by multiboot, ACPI and others.

@sparchatus sparchatus force-pushed the reserve_multiboot branch 2 times, most recently from 1363707 to b9deb8f Compare December 3, 2024 12:38
Comment thread mm/regions.c Outdated
@wipawel wipawel enabled auto-merge (rebase) December 4, 2024 08:52
Add a reserved regions feature to regions.c. Reserved memory
regions are prohibited from being used as frames by pmm.

Currently, the only reserved region is the multiboot memory.

Signed-off-by: Sandro Rüegge <rueegges@ethz.ch>
@wipawel wipawel merged commit e52279e into KernelTestFramework:mainline Dec 4, 2024
@sparchatus sparchatus deleted the reserve_multiboot branch January 27, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] VMM/PMM State Corruption

2 participants