Re: Question about linux drivers

Svein Erling Seldal (sveinse@invalid.ed.ntnu.no)
Mon, 16 Nov 1998 11:22:53 +0100


Alessandro Rubini wrote:
>
>> 1. Is there any centralized "organ" to coordinate and assign
official
>> major numbers?
>
>Yes. Look at "Documentation/devices.txt".
>
>However, I *strongly* suggest to use dinamic assignments of a major
number.
>There's plenty of documentation about this feature, but I can send
you
>the material if you need it.

If I have a driver with dynamic major number, it won't know it's major
number until after it's loaded into the kernel. Is there any
standarized ways of retrieving it's major number, so the special file
in the /dev directory can be updated? /proc? (If you do have some
automated scripts to do this, can you please send it to me.)

>> 3. Since only one process runs while executing in the kernel, all
>> other processes "hangs". How long is it reccomended/acceptable to
>> "hold" the kernel before schedule() is/must be called? 1*HZ?
>
>Definitely less. A few milliseconds at most. Use kernel timers for
>anything longer than 10ms.

I'm doing some special downloading using the parport that takes
totally approx. 1-2 seconds. Of course I can't lock the whole kernel
throughout this download. To remedy this, I've made a counter, which
calls interruptable_sleep_on() after approx. 1 ms in this loop. Is
there any ways to automate this? I.e. I call a function before I enter
this loop that sais: "It's OK to switch process/context when
appropriate", so I don't have to worry about locking the whole kernel.

Regards,
Svein E. Seldal

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/