From owner-freebsd-hackers Thu May 30 12:19:22 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.122.47]) by hub.freebsd.org (Postfix) with ESMTP id 1117B37B401 for ; Thu, 30 May 2002 12:19:18 -0700 (PDT) Received: from localhost (dwhite@localhost) by resnet.uoregon.edu (8.11.3/8.10.1) with ESMTP id g4UJJGB73568; Thu, 30 May 2002 12:19:16 -0700 (PDT) Date: Thu, 30 May 2002 12:19:15 -0700 (PDT) From: Doug White To: Tom Tang Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: KLD mmap question In-Reply-To: Message-ID: <20020530121826.D71308-100000@resnet.uoregon.edu> X-All-Your-Base: are belong to us MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 30 May 2002, Tom Tang wrote: > I have a question about implementing mmap functions in > device drivers. Thinking it would be simple, I contigmalloc'd > a buffer of PAGE_SIZE and returned it using atop like other > mmap device implementations. However when my userland program > mmaps the device with offset 0, when I try accessing the returned > pointer, it returns me invalid memory address. Any help would > be appreciated... Generally, after the machine is started, memory gets too fragmented to use contigmalloc. If you preload the module and do the contigmalloc at attach time it should succeed. Doug White | FreeBSD: The Power to Serve dwhite@resnet.uoregon.edu | www.FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message