RE: alloc_bootmem - Kernel panic

From: Martyn Welch
Date: Wed Feb 07 2007 - 11:47:42 EST


Hi Asgard,

Thank you for your reply.

> I don't sure, that linux performs to allocate bootmem after kernel already booted.
> As I know, bootmem allocator "destroyed" when kernel initializes buddy allocator.
> Indeed you can look at arch/i385/mm/init.c, mem_init routine.
> kernel passes all bootmem pages to buddy system, so bootmem allocator can't be used after it.

That explains why I can't use alloc_bootmem. It'd assumed that do_initcalls and hence functions labelled with module_init() were called early enough, mainly because LDD3 suggests using alloc_bootmem. It seems the vt driver uses console_init() instead, which is called much earlier.

Which leads me to the question: what is the best method to reserve a large (~4MB) coherent buffer for DMA transfers?

Is there any way of using alloc_bootmem from a driver (compiled into the kernel) without delving further into kernel code?

Martyn

________________________________________________________________________
This e-mail has been scanned for all viruses by Star.The service is powered by MessageLabs.
________________________________________________________________________
-
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/