Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Aug 2002 14:33:39 -0700
From:      "Balaji, Pavan" <pavan.balaji@intel.com>
To:        "'Julian Elischer'" <julian@elischer.org>, "Balaji, Pavan" <pavan.balaji@intel.com>
Cc:        "'freebsd-hackers@freebsd.org'" <freebsd-hackers@freebsd.org>
Subject:   RE: Copying from Virtual Address Space to Physical Address
Message-ID:  <3D386AED1B47D411A94300508B11F18704AD69D5@fmsmsx116.fm.intel.com>

next in thread | raw e-mail | index | archive | help

Thanx. It's nearly done. I just need to know two more small things.

physio() requires a dev_t as a parameter. What do I give in over here? I
can't give NULL, cause it does use it for some stuff in the function
definition.

Also, the only other parameters to physio() are the uio and the ioflag
(which is not used at all). So, where is the kernel virtual address mapping?
Do I have to do something this this dev_t thing to open a virtual device
which maps to the kernel virtual address. If yes, how do I do this?

Thanx.

Pavan Balaji,
Intel Corporation
Email: pavan.balaji@intel.com

    "Only the Paranoid Survive"  --  Andy Grove


> -----Original Message-----
> From: Julian Elischer [mailto:julian@elischer.org]
> Sent: Friday, August 30, 2002 3:49 PM
> To: Balaji, Pavan
> Cc: 'freebsd-hackers@freebsd.org'
> Subject: RE: Copying from Virtual Address Space to Physical Address
> 
> 
> 
> 
> On Fri, 30 Aug 2002, Balaji, Pavan wrote:
> 
> > 
> > I'm a little bit confused about this vmapbuf() thing. This 
> is what I think,
> > correct me if I'm wrong.
> > 
> > I have this User Virtual address, userbuf --> associated to physadd
> > 
> > Now, I do vmapbuf(physadd), and I get a Kernel Virtual 
> Address associated to
> > this "physadd". Now, I write to this Kernel Virtual Address 
> and it reflects
> > in userbuf? OhmyGod!!! Is that what it's supposed to do? 
> Hope it doesn't
> > oops my machine..
> > 
> > Also, if this is right, how do I get the kernel virtual address it's
> > associated to? The function returns a void.
> 
> The initial input to physio is a uio.
> A uio is a structure that points to a range of memory, (or 
> several ranges
> of memeory that are to betreated as a set of buffers) in user space
> or in kernel space.. (it has a flag to say which).
> 
> For now just talk about the userland case.
> For each range of addresses, a 'buf' is assigned that can 
> point to a range
> of memory. The pointers in the buf are set to be the same as the first
> region of the uio. Then vmapbuf() is called, that iterates 
> thtough all teh
> pages in the userland memory buffer, and one by one, finds 
> the physical
> address of those pages, and maps them into a contiguous region in 
> kernel space.  Now those pages are mapped in 2 places. 
> The user space and the kernel. if you wrote to them in the kernel,
> the data will appear in the userspace buffer.. of course
> it will also be on the PHYSICAL pages involved as well.
> 
> You want to do just the 2nd part of this..
> you want tostart with a list of physical pages, and map them into the
> kernel space somewhere. That way you can write to them. 
> WHen you are finished, you then unmap them.. 
> 
> 
> 
> > 
> > Thanx.
> > 
> > Pavan Balaji,
> > Intel Corporation
> > Email: pavan.balaji@intel.com
> > 
> >     "Only the Paranoid Survive"  --  Andy Grove
> > 
> > 
> > > -----Original Message-----
> > > From: Julian Elischer [mailto:julian@elischer.org]
> > > Sent: Friday, August 30, 2002 3:20 PM
> > > To: Balaji, Pavan
> > > Cc: 'freebsd-hackers@freebsd.org'
> > > Subject: Re: Copying from Virtual Address Space to 
> Physical Address
> > > 
> > > 
> > > 
> > > 
> > > On Fri, 30 Aug 2002, Julian Elischer wrote:
> > > 
> > > > Physio() does this.. first it finds the physical addresses 
> > > of the user
> > > > pages targetted, then it maps those pages into kernel 
> > > space, and then it
> > > > initiates IO to them. (this actually needs to change but 
> > > for now it's
> > > > true.
> > > 
> > > 
> > > to correct myself..
> > > physio() calls vmapbuf(bp) in order to do it..
> > > 
> > > 
> > 
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-hackers" in the body of the message
> > 
> 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D386AED1B47D411A94300508B11F18704AD69D5>