From owner-freebsd-hackers Tue Mar 2 16:40:25 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (Postfix) with ESMTP id AC83214D90 for ; Tue, 2 Mar 1999 16:40:23 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id QAA59228; Tue, 2 Mar 1999 16:40:03 -0800 (PST) (envelope-from dillon) Date: Tue, 2 Mar 1999 16:40:03 -0800 (PST) From: Matthew Dillon Message-Id: <199903030040.QAA59228@apollo.backplane.com> To: "AARON MARKS" Cc: hackers@FreeBSD.ORG Subject: Re: getpages() for a memory-based fs References: <36DC669B.707C33C7@sarnoff.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :I'm working on the getpages() routine for a memory-based fs and I don't :quite understand how to map my page(s) to kernel vm via the vm_page :struct. What's the formal method of copying data to a vm page? : :Thanks, :-A. : :-- :Aaron J. Marks Communications and Computing Systems Lab :Assoc. Member Tech Staff Advanced Networks and Computation Group :amarks@sarnoff.com Sarnoff Corporation A vm_page_t is not mapped. Typically you map it by allocating a physical buffer with getpbuf() and mapping up to MAXBSIZE bytes worth of pages into it's reserved KVM space using pmap_qenter(). You must, of course, undo the mappings when finished with them. For an eample if how to do this, look at swap_pager_getpages() in vm/swap_pager.c from FreeBSD-current ( i.e. the -4.x tree, not the -3.x tree. The -3.x version of the function is not very readable ). There are kernel support routines to zero pages, copy pages ( see uiomove, uiomoveco ), and so forth but I think you will be happier using a pbuf. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message