Re: how to use the function copyout()

From: Giorgos Keramidas (keramida_at_freebsd.org)
Date: 07/25/05

  • Next message: Norbert Koch: "RE: how to use the function copyout()"
    Date: Mon, 25 Jul 2005 17:27:45 +0300
    To: Felix-KM <Felix-KM@yandex.ru>
    
    

    On 2005-07-25 18:14, Felix-KM <Felix-KM@yandex.ru> wrote:
    > >I have no idea if it is possible for ioctls to have mapped more than
    > >a few 100 bytes for data exchange. You should use read and uiomove()
    > >instead.
    >
    > So if I get it right, it's impossible in FreeBSD to gain access to
    > 64KB of user's program memory with ioctl?
    >
    > My situation is this - I have a device driver for Linux. My task is
    > port it as it is (1:1) into FreeBSD.
    >
    > In the Linux driver Ioctl is realized with the macroses _put_user
    > _get_user all over it. As I understand in FreeBSD their analogues are
    > functions described in store(9), copy(9) and fetch(9).
    >
    > So the problem is that in my user program an array short unsigned int
    > Data[32768] is defined. I need to gain access to the array(to each
    > element of it) from device driver with Ioctl handler.
    >
    > Is it possible to do? If yes, then how it can be done?

    A better alternative that doesn't involve copying huge amounts of data
    from userlevel to kernel space and vice versa is probably to pass just
    the address of the area with an ioctl() and then map the appropriate
    pages from the address space of the user process to an area where the
    kernel can access the data directly?

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Norbert Koch: "RE: how to use the function copyout()"

    Relevant Pages

    • Re: Which file to request SIOCGIFMAC on?
      ... I never thought it would be this hard just to get the ethernet address from an ethernet interface in FreeBSD. ... Do you have any idea of why i'm getting this error from ioctl when i'm ... If you debug ifconfig, you'll find out that the ioctl call always ...
      (freebsd-questions)
    • Re: Which file to request SIOCGIFMAC on?
      ... I never thought it would be this hard just to get the ethernet address from an ethernet interface in FreeBSD. ... Do you have any idea of why i'm getting this error from ioctl when i'm ... If you debug ifconfig, you'll find out that the ioctl call always ...
      (freebsd-hackers)
    • Re: Which file to request SIOCGIFMAC on?
      ... The original plan is to only run it on FreeBSD 5 and higher, ... Do you have any idea of why i'm getting this error from ioctl when i'm ... The problem isn't with the socket type or options. ... request SIOCGIFMAC with ioctl on a socket of type SOCK_DGRAM. ...
      (freebsd-hackers)
    • Re: Which file to request SIOCGIFMAC on?
      ... The original plan is to only run it on FreeBSD 5 and higher, ... Do you have any idea of why i'm getting this error from ioctl when i'm ... The problem isn't with the socket type or options. ... request SIOCGIFMAC with ioctl on a socket of type SOCK_DGRAM. ...
      (freebsd-questions)
    • Re: Keylogger For FreeBSD
      ... >>all keyboard activity on my pc. ... it was 4.2) there was an ioctl that would let you spy on a tty. ... If it's not in the current source (FreeBSD source) you hopefully ... Marc Wiz ...
      (freebsd-questions)