Skip to contentSkip to conversation

How to write a device driver in such a fashion .????

DISCUSSION Misbah khan 3 participants 4 messages Jan 7, 2008 – Jan 8, 2008

lore
Share & tools
lore
#0 lore raw

Hi all ....

I need your suggession to write a driver with such requirements :-

On Initiation by the application of which key is pressed driver should perform the task accordingly. There are 7 keys so seven different task the driver will perform.

1 . I do not want to use any entry point such as read/write/ioctl. In such a case how to access the driver.
2. We dont want to implement this as a chracrter driver.
3. The driver shall look pretty much like an application where in asscssing the H/W memory map .

Hence no entry point and no registeration but an application could be able to communicate ....

I need your suggession in this regard .....

-----Misbah

Signature · 2 lines
View this message in context: http://www.nabble.com/How-to-write-a-device-driver-in-such-a-fashion-.-----tp14660018p14660018.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.
#1 lore raw

=20

Quoted 3 lines

On Initiation by the application of which key is pressed driver should perform the task accordingly. There are 7 keys so seven different task the driver will perform.=20

This is not clear to me.

Quoted 8 lines

1 . I do not want to use any entry point such as read/write/ioctl. In such a case how to access the driver.
2. We dont want to implement this as a chracrter driver.
3. The driver shall look pretty much like an application where in asscssing the H/W memory map .

Hence no entry point and no registeration but an application could be able to communicate ....

I think you want the application to directly access memory-mapped hardware. For this you will need to open /dev/mem and use the mmap() system call to get a virtual address of your h/w.

Clive

#2 lore raw
In reply to Misbah khan

using mmap() in application to access the h/w is only possible if the device memory is mapped in the kernel virtual memory how come we directly map to the physical memory to virtual from user space ???

----Misbah

Quoted 22 lines · Misbah khan

Hi all ....

I need your suggession to write a driver with such requirements :-

On Initiation by the application of which key is pressed driver should perform the task accordingly. There are 7 keys so seven different task the driver will perform.

1 . I do not want to use any entry point such as read/write/ioctl. In such a case how to access the driver.
2. We dont want to implement this as a chracrter driver.
3. The driver shall look pretty much like an application where in asscssing the H/W memory map .

Hence no entry point and no registeration but an application could be able to communicate ....

I need your suggession in this regard .....

-----Misbah

Signature · 2 lines
View this message in context: http://www.nabble.com/How-to-write-a-device-driver-in-such-a-fashion-.-----tp14660018p14682271.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.
#3 lore raw
Quoted 4 lines · Misbah khan

using mmap() in application to access the h/w is only possible if the device memory is mapped in the kernel virtual memory how come we directly map to the physical memory to virtual from user space ???

No, /dev/mem takes physical addresses, not kernel virtual.

-Scott