Skip to content

Document physical memory mapping size #506

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

Merged
merged 2 commits into from
Jun 6, 2025
Merged

Conversation

aaronzper
Copy link
Contributor

@aaronzper aaronzper commented Jun 5, 2025

In developing an AHCI driver, I noticed that the addresses that UEFI loads the MMIO structures into were higher than the final memory region given by the memory map. Since I was using that final region to determine the size of the bootloader-provided physical memory map, I didn't know how far the map "truly" extended.

Digging into the source code (common/src/legacy_memory_region.rs:141) I noticed that the bootloader continues mapping up to 4 GiB, even if less than that is on the system (I had QEMU set to 2). Since this didn't (seem to be) documented, I added a note to the rustdoc on the physical map settings explaining this. I took some of the wording from a comment on the relevant source code. Also, fixed a typo on the same rustdoc.

Copy link
Member

@Freax13 Freax13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

Co-authored-by: Tom Dohrmann <Erbse.13@gmx.de>
Copy link
Member

@Freax13 Freax13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Freax13 Freax13 merged commit 0d4e502 into rust-osdev:main Jun 6, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants