0

I read following link Linux Device Driver Program, where the program starts?

as per this all system calls operate independent to each other.

1> Then how to share common memory between different system call & interrupt handler. but there should be some way to allocate memory ... so that they have common access to a block of memory.

2> Also which pointer to allocate the memory? so that it is accessiable by all ?

Is there some example which uses driver private data ?

Community
  • 1
  • 1
user1870619
  • 177
  • 1
  • 6
  • 12
  • *"system calls operate independent to each other"* - That is not true; you misconstrue what was written. The user app needs to call *open()* first, which sets up an internal structure to coordinate user access with system calls. The *file descriptor* that is returned is actually a tag to retrieve this structure on subsequent sys calls, i.e. you have to provide this *file descriptor* for *read()*, *write()* and *ioctl()* operations. The *close()* deallocates this structure and further accesses. The device driver also maintains state info for each device it handles. All OSes use this scheme. – sawdust Dec 05 '12 at 10:16
  • @user1870619 I think you might be better off starting with some background reading. I think that the answers would drop into place if you read [Linux Device Drivers 3rd Edition](http://lwn.net/Kernel/LDD3/). – marko Dec 06 '12 at 09:38

0 Answers0