How to reserve physical address space region
Hi, Is there an API kernel exposes to use for a driver in order to reserve physical address space? I mean I want to reserve 5GB (or more if allowed) of contiguous physical address space anywhere in the address range (wherever it is available.. doesn't matter) and then I want to map that physical address range in the kernel to get a virtual address so that my driver can dereference that virtual pointer to access the mapped physical address range. Thanks in advance! Sahlot
Have you looked at the uio driver examples? Also, LDD3 may be old, but the API is at least still relevant. The explanation is too long to include here, but the book is free :D On Thu, Oct 15, 2015 at 11:53 PM, sahlot arvind <asahlot@gmail.com> wrote:
Hi,
Is there an API kernel exposes to use for a driver in order to reserve physical address space? I mean I want to reserve 5GB (or more if allowed) of contiguous physical address space anywhere in the address range (wherever it is available.. doesn't matter) and then I want to map that physical address range in the kernel to get a virtual address so that my driver can dereference that virtual pointer to access the mapped physical address range.
Thanks in advance! Sahlot
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Fri, Oct 16, 2015 at 10:53 AM, sahlot arvind <asahlot@gmail.com> wrote:
Hi,
Is there an API kernel exposes to use for a driver in order to reserve physical address space? I mean I want to reserve 5GB (or more if allowed) of contiguous physical address space anywhere in the address range (wherever it is available.. doesn't matter) and then I want to map that physical address range in the kernel to get a virtual address so that my driver can dereference that virtual pointer to access the mapped physical address range.
Thanks in advance! Sahlot
5 GB is alot. If you are sure about it, then I guess boot_memalloc() might be the only choice -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
I've tried to port ldd3 for the latest kernel source. Here's the link of my repository if anyone needs it - https://github.com/omerjerk/ldd3_scull On Mon, Oct 19, 2015 at 4:34 PM, Mulyadi Santosa <mulyadi.santosa@gmail.com> wrote:
On Fri, Oct 16, 2015 at 10:53 AM, sahlot arvind <asahlot@gmail.com> wrote:
Hi,
Is there an API kernel exposes to use for a driver in order to reserve physical address space? I mean I want to reserve 5GB (or more if allowed) of contiguous physical address space anywhere in the address range (wherever it is available.. doesn't matter) and then I want to map that physical address range in the kernel to get a virtual address so that my driver can dereference that virtual pointer to access the mapped physical address range.
Thanks in advance! Sahlot
5 GB is alot. If you are sure about it, then I guess boot_memalloc() might be the only choice
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
participants (4)
-
Kenneth Adam Miller -
Mulyadi Santosa -
sahlot arvind -
Umair Khan