Newbie questions - Linux

This is a discussion on Newbie questions - Linux ; Hi all, I've been asked to modify 2 character device drivers, and I've come across some issues #1. Currently, the major and minor numbers are hardcoded. They state: "Major numbers should be assigned dynamically". Is there a call to do ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Newbie questions

  1. Newbie questions

    Hi all,

    I've been asked to modify 2 character device drivers, and I've come
    across some issues

    #1. Currently, the major and minor numbers are hardcoded. They state:
    "Major numbers should be assigned dynamically". Is there a call to do
    this? Both drivers should have the same MAJOR number, but different
    MINOR numbers.

    #2. Within my "write" function, it is currently writing the data, but
    if there is an issue (latency etc), the write function waits until the
    block is clear. I need to change this so that the write function does
    not block, but does a queuing type of process...being a newbie at
    this, is there a way to have a process that run within the driver that
    just handles requests (write in this case) as a
    daemon/thread/interrupt etc?

    In other words, I need to change the write function to "issue" the
    command, and let another(?) function do the actual writing, so the
    caller of the driver does not get blocked etc...

    any any any any any advice, suggestions would be super greatly
    appriciated!

    Thanks!

    ~Kam (^8*

  2. Re: Newbie questions

    On Thu, 29 Mar 2007 17:22:14 GMT, kamputty@sbcglobal.net wrote:

    BTW, 2.6 kernel

    ~Kam (^8*

    >Hi all,
    >
    >I've been asked to modify 2 character device drivers, and I've come
    >across some issues
    >
    >#1. Currently, the major and minor numbers are hardcoded. They state:
    >"Major numbers should be assigned dynamically". Is there a call to do
    >this? Both drivers should have the same MAJOR number, but different
    >MINOR numbers.
    >
    >#2. Within my "write" function, it is currently writing the data, but
    >if there is an issue (latency etc), the write function waits until the
    >block is clear. I need to change this so that the write function does
    >not block, but does a queuing type of process...being a newbie at
    >this, is there a way to have a process that run within the driver that
    >just handles requests (write in this case) as a
    >daemon/thread/interrupt etc?
    >
    >In other words, I need to change the write function to "issue" the
    >command, and let another(?) function do the actual writing, so the
    >caller of the driver does not get blocked etc...
    >
    >any any any any any advice, suggestions would be super greatly
    >appriciated!
    >
    >Thanks!
    >
    >~Kam (^8*



+ Reply to Thread