On Thu, 09 Jan 2003 Robert Love wrote :
On Thu, 2003-01-09 at 13:05, Rajaram Suresh Gaunker wrote:ptr = (unsigned long**)kmalloc(4*256*sizeof(unsigned
> why we can't have static memory (arrays) in kernel function ,
> kernel crashes if i use, i fixed it by dynamically allocating the
> memory
The kernel stack is only two pages (8KB on x86). This is shared not
just be your function but by the entire call chain before it and all
interrupts that occur.
Limit your on-the-stack allocations appropriately. Your example was
_way_ too big.
For stuff that big, or even half as big, use kmalloc() and do not forget
to kfree()!
long),GFP_KERNEL);
will i get 2d array , but it still gives segmentation fault but doent hangs
bye
Rajaram
R@j@r@m
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/