Re: file/device i/o in the kernel

From: Sharad Joshi (
Date: Fri Jun 16 2000 - 06:57:49 EST


>> using inb/outb, i want to make use of the serial driver. So is it
>> to open the device ttyS0 with sys_open() and do sys_read/write? Or is
>> 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

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().


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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