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

Finalize memory_map module refactoring #1263

Merged
merged 8 commits into from
Jul 30, 2024

Conversation

phip1611
Copy link
Contributor

This is (hopefully) the final step of our recent refactorings for the new memory_map module and all its traits and implementations. I think we are now in good shape to cover a variety of use-cases. Code inconsistencies are resolved, code structure has improved, documentation is comprehensive. Anything missing? Any comments?

This closes #1247.

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

@phip1611 phip1611 self-assigned this Jul 28, 2024
@phip1611 phip1611 force-pushed the memory-map branch 7 times, most recently from 81ff83f to 0fe7e51 Compare July 28, 2024 09:05
uefi/CHANGELOG.md Outdated Show resolved Hide resolved
uefi/src/mem/memory_map/api.rs Outdated Show resolved Hide resolved
uefi/src/mem/memory_map/api.rs Outdated Show resolved Hide resolved
uefi/src/mem/memory_map/mod.rs Outdated Show resolved Hide resolved
uefi/src/mem/memory_map/impl_.rs Outdated Show resolved Hide resolved
@phip1611 phip1611 force-pushed the memory-map branch 2 times, most recently from b8d9455 to 2cf74f9 Compare July 30, 2024 06:06
@phip1611
Copy link
Contributor Author

Ready for the next review-round. I incorporated your feedback into the MR. Further, I split one commit into two for better review-ability.

@phip1611 phip1611 force-pushed the memory-map branch 2 times, most recently from 78b260d to 4db0433 Compare July 30, 2024 06:11
uefi/CHANGELOG.md Outdated Show resolved Hide resolved
uefi/src/mem/memory_map/impl_.rs Outdated Show resolved Hide resolved
There is no public constructor for MemoryMapOwned, as the construction of it is
quite complicated and therefore hidden behind BootServices::memory_map() respectively
SystemTable::exit_boot_services.

The real-world use case for the public constructors for the other types is when
parsing the UEFI memory map from kernels after a bootloader, such as GRUB or Limine,
passed the UEFI memory map via the corresponding boot information.
Simplify MemoryMapOwned::from_initialized_mem to simplify and streamline the
construction in unit tests.
Add a test that imitates how a public API user would utilize our abstractions to
parse a chunk of memory as UEFI memory map.
@nicholasbishop nicholasbishop added this pull request to the merge queue Jul 30, 2024
Merged via the queue into rust-osdev:main with commit f2ace36 Jul 30, 2024
12 checks passed
@phip1611 phip1611 deleted the memory-map branch July 30, 2024 16:15
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.

MemoryMapRef/MemoryMapRefMut constructors
2 participants