Re: file/device i/o in the kernel

From: Sharad Joshi (sharad.joshi@wipro.com)
Date: Fri Jun 16 2000 - 06:57:49 EST


Hi,

>> using inb/outb, i want to make use of the serial driver. So is it
possible
>> to open the device ttyS0 with sys_open() and do sys_read/write? Or is
there
>> any other way in which a kernel module can read/write to a device.
>
>It completely depends in what context runs your driver. If your driver
>runs on behalf of a task context (ie as a result of ioctl(), read()
>write() into your driver), then I would presume it to be legal (are
>deadlock possible?). Now, if this is e.g. from interrupt, this is not
>right.

Thanks for the quick reply Mark. Ok, i forgot to mention in my previous
post, yeah, it is interrupt context. And i understand now that it is not
the best of ways to do it.

I am relying on the serial driver. I wanted my module to be driver
independent. Is it possible, not to have any user process, but to use the
driver (w/o modifying it) for i/o. Seems to be too many restrictions, no?
:) Well, am i asking for a solution to some NP hard problem, but this has
driven me crazy. :)

>A way to implement it which will always be correct is to have a user-level

>process in an endless loop of ioctl() in your driver, your driver passing
>it the data to write to the serial port through the ioctl().

Sharad.

-
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/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:11 EST