Re: Scull Driver - Read

2015-03-21 Thread Pranay Srivastava
Hi Sahil On Fri, Mar 20, 2015 at 6:12 PM, sahil aggarwal sahil.ag...@gmail.com wrote: Hi Pranay, Can you help me with this too.? In case of _IOC_READ why VERIFY_WRITE and in case of _IOC_WRITE why VERIFY_READ.? . Book says its kernel oriented so concept of read and write is reversed.

Re: Scull Driver - Read

2015-03-21 Thread Pranay Srivastava
Hi Sahil On Fri, Mar 20, 2015 at 6:14 PM, sahil aggarwal sahil.ag...@gmail.com wrote: Does it mean that in kernel space the direction bitfields are reversed.? No it doesn't mean that. On 20 March 2015 at 18:12, sahil aggarwal sahil.ag...@gmail.com wrote: Hi Pranay, Can you help me with

Re: Scull Driver - Read

2015-03-21 Thread sahil aggarwal
Hi Pranay Thanks a lot. That cleared it all. On 21 March 2015 at 13:45, Pranay Srivastava pran...@gmail.com wrote: Hi Sahil On Fri, Mar 20, 2015 at 6:14 PM, sahil aggarwal sahil.ag...@gmail.com wrote: Does it mean that in kernel space the direction bitfields are reversed.? No it doesn't

Re: Scull Driver - Read

2015-03-20 Thread Pranay Srivastava
Hi Sahil On Sun, Mar 15, 2015 at 10:17 AM, sahil aggarwal sahil.ag...@gmail.com wrote: hi all, Going through scull driver code, i see read function reads only till end of 1 quantum, so do kernel call read multiple times if count from q_pos exceeds quantum size limit.? Ref: ldd3.

Re: Scull Driver - Read

2015-03-20 Thread sahil aggarwal
Hi Pranay Well explained. Thank you. On 20 March 2015 at 11:46, Pranay Srivastava pran...@gmail.com wrote: Hi Sahil On Sun, Mar 15, 2015 at 10:17 AM, sahil aggarwal sahil.ag...@gmail.com wrote: hi all, Going through scull driver code, i see read function reads only till end of 1

Re: Scull Driver - Read

2015-03-20 Thread sahil aggarwal
Hi Pranay, Can you help me with this too.? In case of _IOC_READ why VERIFY_WRITE and in case of _IOC_WRITE why VERIFY_READ.? . Book says its kernel oriented so concept of read and write is reversed. if(_IOC_DIR(cmd) _IOC_READ) err = !access_ok(VERIFY_WRITE, (void __user*)arg,

Re: Scull Driver - Read

2015-03-20 Thread sahil aggarwal
Does it mean that in kernel space the direction bitfields are reversed.? On 20 March 2015 at 18:12, sahil aggarwal sahil.ag...@gmail.com wrote: Hi Pranay, Can you help me with this too.? In case of _IOC_READ why VERIFY_WRITE and in case of _IOC_WRITE why VERIFY_READ.? . Book says its kernel

Scull Driver - Read

2015-03-14 Thread sahil aggarwal
hi all, Going through scull driver code, i see read function reads only till end of 1 quantum, so do kernel call read multiple times if count from q_pos exceeds quantum size limit.? Ref: ldd3. if(count quantum - q_pos) count = quantum - q_pos; if(copy_to_user(buf, dptr-data[s_pos] +