Re: Strange memory problem with Linux booted from U-Boot

From: Ara Avanesyan
Date: Tue Mar 29 2005 - 02:28:31 EST


----- Original Message -----
From: "Jan Engelhardt" <jengelh@xxxxxxxxxxxxxxx>
To: "Ara Avanesyan" <araav@xxxxxxxxx>
Cc: <linux-kernel@xxxxxxxxxxxxxxx>; <avila@xxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, March 28, 2005 8:06 PM
Subject: Re: Strange memory problem with Linux booted from U-Boot


> >Hi,
> >
> >I need some help on solving this strange problem.
> >Here is what I have,
> >I have a loadable module (linux.2.4.20) which contains a 2 mb static
gloabal
> >array.
> >
> >Additional information:
> >The same error occurs if I just run depmod -a.
>
> I'd be more interested in the kernel space code...
>
>
>
> Jan Engelhardt
> --
> No TOFU for me, please.
>

Oh, the code for kernel space is exactly the same code translated to C:
That is:

___________
#include <linux/vmalloc.h>

void mtestit(char val)
{
char *buf;
int i, j;
int size = 64;
int pass = 2 * 1024 * 1024;
printk("starting val == %x\n", val);
buf = vmalloc(size);
printk("allocated memory of %d bytes. buf == %x\n", size, (int)buf);

for (j = 0; j < pass; j++)
{
printk("passing %d", j);
for (i = 0; i < size; i++)
{
buf[i] = val;
}
printk("passed\n");
}

printk("freeing\n");
vfree(buf);
printk("finished!\n");
}
___________

I call this in a module's entry point and insmod that module.
now, mtestit(0xff) works, but mtestit(0x00) crashes:(
Works fine with RedBoot. Very strange to me:)
Moreover, works fine if I do the very same thing from
within U-Boot (mw.b 100000 0 100000).

I'm interested in ideas of what could potentially be the
cause of this strange behaviour.

__
Thanks,
Ara

-
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/