Skip to content

Implement sorting of the memory map produced by exit_boot_services #661

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

Closed
JarlEvanson opened this issue Feb 17, 2023 · 3 comments · Fixed by #662
Closed

Implement sorting of the memory map produced by exit_boot_services #661

JarlEvanson opened this issue Feb 17, 2023 · 3 comments · Fixed by #662

Comments

@JarlEvanson
Copy link
Contributor

JarlEvanson commented Feb 17, 2023

To facilitate construction of memory managers, would it be possible to implement a method to obtain a sorted memory map upon a call to 'exit_boot_services'? Since iterators can't be sorted, one first has to allocate memory to event begin to be able to sort the map, which complicates design. Implementing such a capability here would be much easier, as we have access to the slice, rather than the iterator.

@JarlEvanson JarlEvanson changed the title Implement sorting of memory map Implement sorting of the memory map produced by 'exit_boot_services' Feb 17, 2023
@JarlEvanson JarlEvanson changed the title Implement sorting of the memory map produced by 'exit_boot_services' Implement sorting of the memory map produced by exit_boot_services Feb 17, 2023
@phip1611
Copy link
Member

Hi. Generally speaking, we are open for high-level interfaces and API simplifications. Do you have a specific implementation in mind? If so, feel free to submit a PR so we can discuss further.

@JarlEvanson
Copy link
Contributor Author

Should we keep a way to obtain an unsorted memory map, or should the memory map just always be sorted for convenience? I don't see any uses that could be better done with an unsorted memory map, so the only cost would be the time needed to sort.

@phip1611
Copy link
Member

phip1611 commented Feb 18, 2023

I thought a little about this and came to the conclusion that instead of a new heap-structure, which will be tricky to implement, I'd prefer a stateful-iterator that always searches for the next bigger element in the memory map (according to the begin address). Given the fact that the map will not be iterated that often and that hundreds or thousands of entries are unlikely, this should be feasible.

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 a pull request may close this issue.

2 participants