From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 32238 invoked from network); 1 May 2000 17:30:32 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 1 May 2000 17:30:32 -0000 Received: from server07.icaen.uiowa.edu (server07.icaen.uiowa.edu [128.255.17.47]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id NAA15257 for ; Mon, 1 May 2000 13:30:30 -0400 Received: from server11.icaen.uiowa.edu (root@server11.icaen.uiowa.edu [128.255.17.51]) by server07.icaen.uiowa.edu (8.9.3/8.9.3) with ESMTP id MAA23538 for sent by ; Mon, 1 May 2000 12:29:56 -0500 (CDT) Received: from cobra.eng.uiowa.edu (IDENT:bcarlson@cobra.eng.uiowa.edu [128.255.23.124]) by server11.icaen.uiowa.edu (8.9.3/SMTP-Server-1.2) with ESMTP id MAA06583 for sent by ; Mon, 1 May 2000 12:29:54 -0500 (CDT) Organization: Iowa Computer Aided Engineering Network, University of Iowa Date: Mon, 1 May 2000 12:29:52 -0500 (CDT) From: Blake Carlson Sender: bcarlson@cobra.eng.uiowa.edu To: axp-list@redhat.com Subject: Re: Help me with Big physical mem alloc in linux! In-Reply-To: <390DA73F.9D0C29F5@paralleldata.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 1 May 2000, W Bauske wrote: > > ysz wrote: > > > > My driver need a big physical memory (larger than one page) for DMA, > > but i found nothing API to do that when I search kernel source. > > Could somebody give me a hint about it? I have heard before that there's a > > kernel patch to do that,but where's it and can any kernel API do it? > > thanks,I'm a newbie in kernel programming and very excited in this mail list > > to ask for help. > > pubb > > Try looking at linux/drivers/scsi/st.c. It uses quite fancy > DMA memory allocation and I've used it for quite large data > blocks. > > > Wes > > Here's a pretty nasty hack I've used in the past (though I don't remember the exact details). In the "Linux Device Drivers" book, there's a section that describes how to tell the kernel to use less of the physical memory than is actually available. For instance, if you have 128 MB of RAM you give the boot flag MEM=126. Now you can use these upper 2MB as you please since it is not managed by the kernel. The only trick is to address the memory with it's physical address rather than a virtual address. Yes, it's kind of nasty and requires special bootflags, but it helped me avoid this DMA problem long enough to decide I didn't want to write a driver any more! :) - Blake blake-carlson@uiowa.edu College of Engineering Imaging Group University of Iowa