Results 1 to 2 of 2
Hi All,
I am new to Linux and currently working on Embedded Linux with Atmel AT91sam9261ek. I added a new char device driver to read credit card information from a ...
- 12-19-2008 #1Just Joined!
- Join Date
- Dec 2008
- Posts
- 2
how to send an event from kernel device driver to user application
Hi All,
I am new to Linux and currently working on Embedded Linux with Atmel AT91sam9261ek. I added a new char device driver to read credit card information from a credit card reader. The driver was added and tested successfully with hardware. After I swiped the card, the information was stored in a buffer inside the driver. When user application called read function (of course it will open it first), the card information was passed to the user buffer correctly.
Now, what I want to do is add handshaking. User application should wait for an event from the device driver before calling file read function. And device driver will signal the user application when it finishes processing data. Therefore the user application will know exactly when to read data from driver.
I checked semaphore used in kernel side. It seems it usually uses sema_init, up, and down functions defined in /asm/semaphore.h.
However, in user side, semget, semctl, and semop are defined in /usr/include/sys/sem.h. Right now we don't want to use POSIX semaphore.
If I use semaphore to synchronize kernel driver and user application, how can I make sure that they are using the same semaphore?
I am just wondering which communication mechanism I should use. I talked to two guys. One suggested me use semaphore and the other suggested me use tcpip.
Could anyone please point me to the best way to approach this issue?
Thanks in advance,
youyisi
- 12-20-2008 #2
have you considered dbus?
Linux and me it's a love story


Reply With Quote