-
Notifications
You must be signed in to change notification settings - Fork 214
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
Support for global allocator #352
Comments
I have attempted using the following code to setup default global allocator. Any concrete example on how this could work with bootloader? use alloc::alloc::*; /// The global allocator type. unsafe impl GlobalAlloc for Allocator { /// If there is an out of memory error, just panic. /// The static global allocator. |
The bootloader does no longer exist after transferring control to your kernel. So you have to implement the memory management yourself. This includes page table table allocation and creating your own allocator. See the "Memory Management" section on https://os.phil-opp.com/ for details. If you don't want to manage memory, you could create an UEFI application directly. See https://github.com/rust-osdev/uefi-rs/tree/main/template for an example. By using the Hope this help! |
Thank you for the feedback. I am following your "Memory Management" section on https://os.phil-opp.com/ but the flow seem not to be compatible with bootloader_api 0.11.x. For example, the newer bootinfo has no memory_map member anymore which is expected by memory::BootInfoFrameAllocator. Instead, there is memory_regions which is available for use. Can you post a quick example update of memory allocation that works with bootloader_api 0.11.x? |
I am still stuck with the fact that for |
I'm pretty sure its been replaced with |
How do you initialize any Allocator of choice with addresses indicated in memory_regions? Any working example? |
From what I can see in your posted snippets, it is obvious that my codes are not up to date. Can you point me to the updated repository content url? |
Is there any support for global allocator. Concatenating string slices is not feasible without heap allocator.
The text was updated successfully, but these errors were encountered: