Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, im new on writing device driver in kernelspace. So i started with writung a small scull driver. The problem is, that a write call blocks sthe system. I do ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    3

    read call blocks


    Hi,
    im new on writing device driver in kernelspace.
    So i started with writung a small scull driver.

    The problem is, that a write call blocks sthe system.
    I do not know why.

    Here the function.

    ssize_t FS_write(struct file * filp, const char * buf, size_t count, loff_t * f_pos)
    {
    if(down_interruptible(&dev->sem))
    {
    return -1;
    }

    // Tha array is big enough
    copy_from_user(data_array,buf,count);

    *f_pos+=count;

    up(&dev->sem)

    return count;

    }

    I dont know what why the driver hangs
    I call
    "Hallo" > /dev/mydriver

    i then i can see that the init is done well.
    After it, the kernel hangs.

    Tank you for help.
    Last edited by user20000; 01-18-2012 at 07:14 PM.

  2. #2
    Just Joined!
    Join Date
    Jan 2012
    Posts
    3
    Okay, sorry i have it now
    The Read call was is well done.

    It hangs on a secial call of the open of my driver.
    I have implemented some personalities and there had beeen a buck while
    chanching the file operations structure.

    Thanks

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,397
    Sometimes the best help is none... Glad you sorted it out.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    Just Joined!
    Join Date
    Dec 2011
    Posts
    35
    Welldone......

Posting Permissions

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