Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserve multiboot physical memory #344

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

sparchatus
Copy link
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
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.

arch/x86/boot/multiboot.c Outdated Show resolved Hide resolved
common/setup.c Outdated Show resolved Hide resolved
mm/pmm.c Outdated Show resolved Hide resolved
mm/pmm.c Outdated Show resolved Hide resolved
arch/x86/boot/multiboot.c Outdated Show resolved Hide resolved
arch/x86/boot/multiboot.c Outdated Show resolved Hide resolved
include/mm/regions.h Outdated Show resolved Hide resolved
include/multiboot.h Show resolved Hide resolved
mm/regions.c Outdated Show resolved Hide resolved
mm/regions.c Outdated Show resolved Hide resolved
mm/regions.c Outdated Show resolved Hide resolved
@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
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
mm/regions.c Outdated Show resolved Hide resolved
@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 <[email protected]>
@wipawel wipawel merged commit e52279e into KernelTestFramework:mainline Dec 4, 2024
4 checks passed
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