k***r 发帖数: 4260 | 1 如果我有多个device driver需要穿很多数据给一个user space application,并且有
一些数据要传回
device drivers,一般用什么机制通讯呢?driver的东西没做过。谢谢 |
a****l 发帖数: 8211 | 2 driver is not something special, it is basicaly just an application that
runs at different level.
【在 k***r 的大作中提到】 : 如果我有多个device driver需要穿很多数据给一个user space application,并且有 : 一些数据要传回 : device drivers,一般用什么机制通讯呢?driver的东西没做过。谢谢
|
k***r 发帖数: 4260 | 3 I remember drivers do have some restrictions, or something that makes
it more difficult to do certain things.
Is it practical/easy to use a client socket or a named pipe to send
data to user space apps? Thanks.
【在 a****l 的大作中提到】 : driver is not something special, it is basicaly just an application that : runs at different level.
|
a****l 发帖数: 8211 | 4 it's almost always possible to communicate in any way, the only question is
that whether this certain method fits your application need.
【在 k***r 的大作中提到】 : I remember drivers do have some restrictions, or something that makes : it more difficult to do certain things. : Is it practical/easy to use a client socket or a named pipe to send : data to user space apps? Thanks.
|
k***r 发帖数: 4260 | 5 Both sockets and named pipes should work for my needs. Is there
any preferences between the two, in terms of ease of development
in the context of device drivers?
I remember DeviceIoControl and related function is the way to
communicate between apps and drivers. No?
is
【在 a****l 的大作中提到】 : it's almost always possible to communicate in any way, the only question is : that whether this certain method fits your application need.
|
m*****e 发帖数: 4193 | 6 If bulky data, use shared memory.
【在 k***r 的大作中提到】 : 如果我有多个device driver需要穿很多数据给一个user space application,并且有 : 一些数据要传回 : device drivers,一般用什么机制通讯呢?driver的东西没做过。谢谢
|
y*****a 发帖数: 171 | 7 device drivers are implemented as "files" in both windows and linux. if your
communication can be implemented as standard file I/O operation, then use "
read/write" after you "open" the device drive in linux (windows must have
the corresponding functions). otherwise, you have to implement a special
device I/O control function, and then call this function in your user
application.
device drivers can also directly write to use application, however, it is a
little bit complicated because device dri |
k***r 发帖数: 4260 | 8 Shared memory isn't a stream and i think it is sometimes awkward to use.
For example, after writing new data to shared memory, you'll need to
use another mechanism to signal the reader... I prefer a stream interface
such as a socket or a pipe because of this. Or am I missing anything?
【在 m*****e 的大作中提到】 : If bulky data, use shared memory.
|
s******e 发帖数: 431 | 9 For simple app->driver communication, use IOCTL. For bulky driver->app
communication, use shared memory. There is an article about sharing memory
between driver and app from osronline.
http://www.osronline.com/article.cfm?id=39
【在 k***r 的大作中提到】 : 如果我有多个device driver需要穿很多数据给一个user space application,并且有 : 一些数据要传回 : device drivers,一般用什么机制通讯呢?driver的东西没做过。谢谢
|