[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Allocating Large buffers at Boot-time
Hi,
I need to allocate a large buffer for DMA transfers in a driver I'm
working on. I understand that the kernel normally will not allocate
coherent buffers larger than 128KB, the suggested solution (from
O'Reilly's ldd3) seems to be to compile the driver into the kernel and
allocate a buffer at boot using alloc_bootmem_low(). When I tried this I
get a kernel panic:
========================================================================
=========
BUG: unable to handle kernel NULL pointer dereference at virtual address
000002f0
printing eip:
c021ca95
*pde = 00000000
Oops: 0000 [#1]
SMP
Modules linked in:
CPU: 0
EIP: 0060:[<c021ca95>] Not tainted VLI
EFLAGS: 00010202 (2.6.17.9 #23)
EIP is at find_next_zero_bit+0x35/0xb0
eax: 000000bc ebx: c0522c20 ecx: 00000013 edx: ffffffff
esi: 00000000 edi: 000002f0 ebp: 00038000 esp: c17ffef8
ds: 007b es: 007b ss: 0068
Process swapper (pid: 1, threadinfo=c17fe000 task=dfbdfa10)
Stack: 00000000 c0522c20 00000000 01000000 00038000 c04e2894 00000000
00038000
00001793 00000000 ffffffff 00000000 ffffff80 00000246 00000013
00000001
00001793 00000000 00000001 c0522c20 01000000 00000080 00001000
c04e2c84
Call Trace:
<c04e2894> __alloc_bootmem_core+0xe4/0x3a0 <c04e2c84>
__alloc_bootmem_nopanic+0x64/0x80
<c04e2cc0> __alloc_bootmem+0x20/0x50 <c04eb5cb>
universeII_init+0x2b/0x40
<c0100423> init+0x123/0x330 <c0102eea> ret_from_fork+0x6/0x14
<c0100300> init+0x0/0x330 <c0100300> init+0x0/0x330
<c0100e35> kernel_thread_helper+0x5/0x10
Code: 20 89 74 24 08 8b 74 24 18 89 7c 24 0c c1 f8 05 83 e1 1f 89 6c 24
10 8d 3c 86 8b 6c 24 1c 89 5c 24 04 c7 04 24 00 00 00 00 74 22 <8b> 07
c7 04 24 20 00 00 00 29 0c 24 d3 e8 f7 d0 0f bc c0 75 05
EIP: [<c021ca95>] find_next_zero_bit+0x35/0xb0 SS:ESP 0068:c17ffef8
========================================================================
=========
The offending code:
========================================================================
=========
static int __init universeII_init(void)
{
void* buffer;
printk(KERN_INFO "Loading driver.\n");
buffer = alloc_bootmem(PAGE_SIZE);
return 0;
}
========================================================================
=========
I am using:
kernel version 2.6.17.9
gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
Thank you for any help in advance,
Martyn
----
Martyn Welch
Principal Software Engineer
Radstone Digital Processing
Part of GE Fanuc Embedded Systems
Phone: +44 (0) 1327 322748
email: martyn.welch@xxxxxxxxxxxxxx
web: www.radstone.com
________________________________________________________________________
This e-mail has been scanned for all viruses by Star.The service is powered by MessageLabs.
________________________________________________________________________
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/