char driver error

Daniel Baluta daniel.baluta at gmail.com
Mon May 9 08:08:34 EDT 2011


OK. See how write and read works.

> $strace echo -n "abcd" > /dev/memory(/home/aravind/me
> write(1, "abcd", 4)                     = 1
> write(1, "bcd", 3)                      = 1
> write(1, "cd", 2)                       = 1
> write(1, "d", 1)                        = 1

>$ strace cat /dev/memory(/home/aravind/memory)

> read(3, "d", 32768)                     = 1
> write(1, "d", 1d)                        = 1

Please allocate space for more than 1 char, and also
correct memory_write

  tmp=buf+count-1; -> tmp=buf+*f_ps-1;

thanks,
Daniel.



More information about the Kernelnewbies mailing list