From owner-freebsd-hackers Thu Feb 27 15:26:06 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA23929 for hackers-outgoing; Thu, 27 Feb 1997 15:26:06 -0800 (PST) Received: from noc.msc.edu (noc.msc.edu [137.66.12.254]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id PAA23922 for ; Thu, 27 Feb 1997 15:26:03 -0800 (PST) Received: from ww.msc.edu by noc.msc.edu (5.65/MSC/v3.0.1(920324)) id AA08194; Thu, 27 Feb 97 17:25:58 -0600 From: jpt@msc.edu (Joseph Thomas) Received: (jpt@localhost) by ww.msc.edu (8.7.1/8.6.6) id RAA01886 for hackers@freebsd.org; Thu, 27 Feb 1997 17:26:00 -0600 (CST) Message-Id: <199702272326.RAA01886@ww.msc.edu> Subject: Assumptions about kmem_malloc()... To: hackers@freebsd.org Date: Thu, 27 Feb 1997 17:25:59 -0600 (CST) X-Mailer: ELM [version 2.4 PL25] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk We are working on an ATM device driver and have the requirment of needing to allocate somewhat large memory chunks (more then one page in length) which are used for DMA. We've discovered the hard way (okay - maybe I should looked better) that adjacent virtual pages are not necessarily adjacent physically. Questions: o When using kmem_malloc(), do virtual and physical boundaries always align to a page start? Real experience seems to say that new allocs always align to a virtual and physical page boundaries but I may just be "getting lucky". o Other then contigmalloc(), is there a way to malloc contiguous physical memory greater then one page? The driver waits to malloc memory until microcode is downloaded to the NIC (Fore PCA200E). Since the download is user initiated, and because we'd like to move toward loadable modules, the prospect of having large amounts of contiguous memory is greatly dimished by the time we ask for it. o What other hidden gotchas are there in working with DMA and device drivers? Except for when I was asking for more then one page of memory (that is, I reduce structure sizes to be small enough to fit in one page) everything seems to be working great. However, there's a vast wealth of experience out there which I'd like to tap if I've missed something more suttle... Thanks. -- Joseph Thomas E/Mail: jpt@msc.edu Minnesota Supercomputer Center, Inc. jpt@magic.net 1200 Washington Ave So. Tel: +1 612 337 3558 Minneapolis, MN 55415-1227 FAX: +1 612 337 3400 An elephant is a mouse with an operating system.