Results 1 to 3 of 3

Thread: Kernel function

  1. #1
    Join Date
    Feb 2009
    Beans
    23

    Unhappy Kernel function

    Can any one tell me how copy-to-user and copy-from-user what does in detail with some examples?????

  2. #2
    Join Date
    Jun 2007
    Beans
    538

    Re: Kernel function

    The example is in the kernel source file. look in /linux-2.6.28/drivers/usb/usb-skeleton.c
    In general, the functions are memory-to-memory copy instructions, from kernel memory space to module memory space.

    Gerald

  3. #3
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Kernel function

    copy_from_user copies data from a buffer in user space to a kernel buffer and copy_to_user copies data from a kernel buffer to a buffer in user space.

    These are usually used to implement system calls. For example, a user process would call the read system call to read data from a file into a buffer in the process's address space. The system call however, runs in the kernel's address space so it first reads the data into a buffer in kernel space and then copies the data to the buffer in the calling process's address space using copy_to_user.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •