I need some memory allocated during boot time. and I need its physical address, not the virtual one. Also, I don’t want it from DMA region, that’s not my purpose.
I tried alloc_bootmem(), alloc_bootmem_pages() but they return virtual address.
I also looked at alloc_low_page()… didn’t quite work as expected.
Thing is, I need some sort of reserved area in RAM.. that doesn’t have to be mapped by kernel.. I’ll be trying to manage that area myself. I need physical area to be same on every boot.
I also tried allocating some memory in init/main.c : start_kernel() but that too did not work.
Kind of stuck now as where/what to look for.
I’d prefer answer as a pointer to right direction rather than telling do_it_here_in_this_way .
Thanks 🙂
AFAIK the memory returned buy the bootmem allocator is contigious is physical memory so you can just call alloc_bootmem() and use virt_to_phys to get the physical address.
There is no guarantee to get the same address on every boot, but so long as you wont change the kernel the allocation will always happen in the same order (and size) so that what is you are expected to get.