[uClinux-dev] init_mem_alloc and PAGE_OFFSET

David McCullough davidm at snapgear.com
Tue Mar 11 06:32:35 EST 2003

Jivin Bernard Leach lays it down ...
> On Tue, 2003-03-11 at 07:57, John Williams wrote:
> > Hi folks,
> > 
> > My port is based on the v850, so Miles you might be able to help here :)
> > 
> > Basically, where should PAGE_OFFSET point in a uclinux system?
> It should point to the start of your RAM.  The memory initialisation
> should ensure that any required portions of your RAM that are in-use
> before the real memory allocator gets started are reserved.  On the ARM
> system I am using it reserves the entire kernel space during startup and
> then once the kernel has initialised it free's some of that up (the
> _init sections).
> Things may be different on your platform but I'd be surprised if the
> general principles were different.

AFAIK these principles are the same on every platform.

> As to your problem with the memory allocation stomping on the kernel
> where exactly does that occur?

It sounds like you are not reserving the kernel memory correctly at
bootmem_init time.  You need to reserve:
	* the kernel text (if in RAM), data & bss
	* the kernel allocator bitmap
	* the romfs if it is in RAM

That generally covers it all, m68k/arm are also good working examples to
look at,


David McCullough:    Ph: +61 7 3435 2815  http://www.SnapGear.com
davidm at snapgear.com  Fx: +61 7 3891 3630  Custom Embedded Solutions + Security

More information about the uClinux-dev mailing list