How can I map kernel space to user space ??

How can I map kernel space to user space ??

Post by Kevin Sha » Wed, 08 Mar 2000 04:00:00



Is there any way to map kernel space (which is allocated in the driver)
to user space, or vice versa, so that both driver and the application
can simultaneously access to the same buffer ?

Kevin

 
 
 

How can I map kernel space to user space ??

Post by Fabrice Pei » Wed, 08 Mar 2000 04:00:00



> Is there any way to map kernel space (which is allocated in the driver)
> to user space, or vice versa, so that both driver and the application
> can simultaneously access to the same buffer ?

> Kevin

For kernel 2.2.x I think is not possible for 2.3.x i think the same
thing but i am not sure...

 
 
 

How can I map kernel space to user space ??

Post by Grant Edwar » Wed, 08 Mar 2000 04:00:00



>Is there any way to map kernel space (which is allocated in the driver)
>to user space, or vice versa, so that both driver and the application
>can simultaneously access to the same buffer ?

Yes. If you nail down a page of physical system RAM, you can
then let the user mmap() it into user space.  See Rubini's book
"Linux Device Drivers" (chapter 13, IIRC).  

Here's an example device driver that allows the user to mmap()
two blocks of PCI device memory and one page of buffer space
(it impliments three different minor devices):

  ftp://ftp.visi.com/users/grante/stuff/demomm.tar.gz

--
Grant Edwards                   grante             Yow!  One FISHWICH coming
                                  at               up!!
                               visi.com            

 
 
 

How can I map kernel space to user space ??

Post by Fabrice Pei » Thu, 09 Mar 2000 04:00:00




> > Is there any way to map kernel space (which is allocated in the driver)
> > to user space, or vice versa, so that both driver and the application
> > can simultaneously access to the same buffer ?

> > Kevin
> For kernel 2.2.x I think is not possible for 2.3.x i think the same
> thing but i am not sure...

In fact you can do that with device,and mmap or with the method read and
write of the device.
 
 
 

1. Need help in understanding the mapping of user-space send, sendto, sendmsg to kernel-space sendmsg

Hello,
I am trying to implement my own transport layer protocol in Linux for
an experiment. I am going to use socket interface and add my protocol
using sock_register. For the proto_ops i can see that the parameters
for the sendmsg and recvmsg are (struct kiocb *iocb, struct socket
*sock, struct msghdr *msg, size_t len, int flags). But there are three
types of user api's send, sendto, sendmsg. Of these three only sendmsg
contains a parameter for msghdr. I find that the other two api's are
incompatible with the parameters supplied by the kernel to my kernel-
space sendmsg function. So what happens when we use send and sendto
user-space api's? Hope i am clear..

Thanks,
Bala

2. perfbar solaris8

3. mapping user space and kernel space

4. What is "Hip-Pocket cache" ?

5. How can I map kernel space to user space..

6. AIX Connections - Proxy Configuration Help?

7. Problem mapping PCI memory space to user space

8. 24 bpp or 32 bpp on Diamond 3d 3400

9. Kernel space to user space

10. exchange data from user space to kernel space

11. kernel space access to user space functions

12. Kernel space <-> User space

13. User space to kernel space addr translation?