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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message ----- 
From: "Jan Engelhardt" <[email protected]>
To: "Ara Avanesyan" <[email protected]>
Cc: <[email protected]>; <[email protected]>
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux