How can I load a kernel driver at a specific memory address?

How could it be done with the following methods?

  1. commands/scripts like insmod or modprobe
  2. using C code (not sure if there may exist such an option)
  • 1
    You can't. Why do you want to do that anyway? – Gilles 'SO- stop being evil' Jan 9 '14 at 22:48
  • 1
    Not sure who put a -1 to that question. Customer wants that, there are controlled details to the project, it may be military, so we are not allowed to ask further on the criteria. – Ursa Major Jan 9 '14 at 23:22

You can't load a kernel module at a specific physical address. You can't load a kernel module at a specific virtual address. The kernel decides where it loads the module.

Inside the kernel, of course, you can do what you want. But I think arranging to load a driver at a specific address would require a lot of deep changes.

I fail to see what would require loading a driver at a specific physical or virtual address. Devices may need to be mapped at specific physical addresses (and there are mechanisms for that), but code doesn't care.

  • yes, the base kernel may be able to do something about the loading process of the loadable kernel modules (LKM), however, we are not allow to touch that. I wonder why they set the game like this. You are not going anywhere without a +1 for you, @Gilles. :) – Ursa Major Jan 10 '14 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.