Re: Placing a kernel module at a known fixed address

From: linux-os (Dick Johnson)
Date: Fri Sep 23 2005 - 14:06:05 EST



On Fri, 23 Sep 2005, Sreeni wrote:

> Hi,
>
> I have a kernel module on Montavista Linux (ARM-MontavistaLinux-XIP).
> My application demands me placing/running this kernel module at a known
> fixed virtual/physical address. I can make this module a static one.
> For this I need the following -

Your application is therefore totally and completely broken by
definition.

When you need to access certain physical offsets or bus addresses
from user-space, we use mmap().

>
> ***** Placing text,data, heap, stack at a known fixed address *****
>

You can place your code and your data at some fixed (offset) by
using different sections (i.e., .section .foo), then having
the linker do the fixups. You CANNOT move the .text section or
the .bss or the .data sections and have anything work. You also
can't put the stack at some physical location because there are
different stacks in use when your module is accessed (each
caller has its own "kernel" stack).

> May I know the possible ways of achieving this. I have tried playing
> around arch/arm/vmlinux.lds linker script file. But when i try to force
> the linker to place my module at a particular address, the System.map
> shows me the correct address but the kernel image size is getting very
> large (when add 10 words of my module, kernel image size is getting
> increased by 800KB).
>
> Any help in this is highly appreciated.
>
> Thanks
> Sreeni
>
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13 on an i686 machine (5589.55 BogoMips).
Warning : 98.36% of all statistics are fiction.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@xxxxxxxxxxxx - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/