From owner-freebsd-hackers Thu May 30 13:15:38 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from pc1.cs.ucdavis.edu (pc1.cs.ucdavis.edu [169.237.5.225]) by hub.freebsd.org (Postfix) with ESMTP id 112B537B40D for ; Thu, 30 May 2002 13:15:34 -0700 (PDT) Received: from localhost (tangj@localhost) by pc1.cs.ucdavis.edu (8.11.2/8.11.2) with ESMTP id g4UKFHj06978; Thu, 30 May 2002 13:15:17 -0700 X-Authentication-Warning: pc1.cs.ucdavis.edu: tangj owned process doing -bs Date: Thu, 30 May 2002 13:15:17 -0700 (PDT) From: Tom Tang To: Doug White Cc: Subject: Re: KLD mmap question In-Reply-To: <20020530121826.D71308-100000@resnet.uoregon.edu> Message-ID: 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 Doug, Thanks for the reply, I'll check it out. However if you'll notice in my prev mail, I stated that I was trying to contigmalloc 4K... Hard to believe that the system doesnt have 4K lying around. - Tom On Thu, 30 May 2002, Doug White wrote: > 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 > > -- Tom Tang tangj@cs.ucdavis.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message