Re: Reserving physical memory at boot time

Richard B. Johnson (root@chaos.analogic.com)
Tue, 3 Dec 2002 16:11:48 -0500 (EST)


On Tue, 3 Dec 2002, Duncan Sands wrote:

> I would like to reserve a particular page of physical memory when
> the kernel boots. By reserving I mean that no one else gets to read
> from it or write to it: it is mine. Any suggestions for the best way
> to go about this with a 2.5 kernel?
>
> Thanks,
>
> Duncan.

If you need a certain page reserved at boot-time you are out-of-luck.
You can tell the kernel (using mem=xxx on the boot command line) that
you have somewhat less memory than you do and then you can write a
module that accesses the other memory that the kernel doesn't use.

If you just want to make sure that your module owns a particular
page that nobody else uses, just use ioremap() in your module to
allocate a particular address. Those page(s) are now owned by
your module and will never be paged. You can access those pages
from user-space by providing some connectivity in your module
(like read()/write()/ioctl()).

Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
Bush : The Fourth Reich of America

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