From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 19412 invoked from network); 1 May 2000 08:53:04 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 1 May 2000 08:53:04 -0000 Received: from sdns.nudt.edu.cn (sdns.nudt.edu.cn [202.197.0.181]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id EAA24144 for ; Mon, 1 May 2000 04:52:43 -0400 Received: from 6052 ([172.26.5.11]) by sdns.nudt.edu.cn (Netscape Messaging Server 3.6) with SMTP id AAA1F47 for ; Mon, 1 May 2000 17:52:25 +0900 Message-ID: <000701bfb34a$873f7d20$0b051aac@6052.nudt.edu.cn> From: "ysz" To: "axp-list" Subject: Help me with Big physical mem alloc in linux! Date: Mon, 1 May 2000 16:52:04 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0004_01BFB38D.93D90FE0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 This is a multi-part message in MIME format. ------=_NextPart_000_0004_01BFB38D.93D90FE0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable 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 ------=_NextPart_000_0004_01BFB38D.93D90FE0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
My driver need a big physical memory (larger than = one page)=20 for DMA,
but i found nothing API to do that when I search = kernel=20 source.
Could somebody give me a hint about it? I have heard = before=20 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=20 this mail list to ask for help.
          &nbs= p;    =20 pubb
------=_NextPart_000_0004_01BFB38D.93D90FE0-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 15895 invoked from network); 1 May 2000 15:15:33 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 1 May 2000 15:15:33 -0000 Received: from paralleldata.com (smtp.paralleldata.com [38.153.145.2]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id LAA05750 for ; Mon, 1 May 2000 11:15:31 -0400 Received: by paralleldata.com from localhost (router,SLMail V2.5); Mon, 01 May 2000 10:22:00 -0500 Received: by paralleldata.com from paralleldata.com (24.15.240.182::mail daemon; unverified,SLMail V2.5); Mon, 01 May 2000 10:21:58 -0500 Sender: "Wsb" Message-ID: <390DA73F.9D0C29F5@paralleldata.com> Date: Mon, 01 May 2000 10:48:15 -0500 From: "W Bauske" Organization: PDS Inc. X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.5-15 i686) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Help me with Big physical mem alloc in linux! References: <000701bfb34a$873f7d20$0b051aac@6052.nudt.edu.cn> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > 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 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