I have tried to search this topic on google and this site but I can't find a proper answer.
I am trying to allocate a big continuous block of memory (a few MB) at a set physical address during the Linux booting process. But I am still not clear where I should place my "alloc_bootmem" function. I am running Linux on an ARM processor.
AFAIK, there is a way to create a driver which contains a call to "alloc_bootmem" and then compile that driver directly to into the kernel.
Another method is to add "alloc_bootmem" somewhere in the Linux kernel source.
The last method that I think exists is to create a settings file like boot.rc?(not sure) so that during booting Linux will reserve the memory I want allocated.
If there is a clear way or a link to an answer to this question, I really would appreciate everyone's help. The basic question is "where should I call "alloc_bootmem" so it will work during booting?"
Thanks, Shahril
Take a look at: http://lwn.net/Kernel/LDD3/ chapter 8 it explains the memory allocation for early booting stages.
Further information about booting memory allocation can be found here:
https://www.kernel.org/doc/gorman/html/understand/understand022.html
This feature is used for allocating large memory chunks during the system boot up and it uses the physical rather than virtual memory. After MMU is up and running there is no possible way of accessing the memory AFAIK
If you are looking for a large continues memory allocation you should probably use different allocator take a look at:
http://lwn.net/Articles/396702/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With