On Wed, 2009-10-07 at 14:06 +0800, vichy wrote:
> Dear all:
> I try to pass the content of file,1G, to kernel driver for operation
How? With which sys-calls?
> and then return the result back to application.
> My questions are:
> 1. The only way I can use is copy_from_user? If so, does it have the
> size limitation?
Not really. Even if, you can call it several times (for different parts
of the data) anyways.

> 2. I don't want my application pending on the I/O and is there any
> smart way to let the application know when driver finishes its job?
> appreciate your help,
Depends on the sys-calls:
- you could use read(2) and write(2): Which has the feature that
  the user-space app could write chunks of it and the kernel driver
  can process that immediately (e.g. for compressing the data or
  similar).
  The user-space app would block on the read(2) for the result.

- you could use an ioctl() which blocks and returns after the driver is
  done (and you can/should use the same buffer for passing data and
  receiving it).

- you could use two ioctl()s - one for passing data to the kernel,
  another for blocking and getting it back.

Additionally (and indepently) you can send SIGIO (or some other signal?)
to the process^Wfile-descriptor to inform the process(es)that the driver
is done.

        Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to