<div dir="ltr">Hi!<div><br></div><div>Goal, when the user do :</div><div># head -1 /dev/miscdrv</div><div><br></div><div>The driver prints: Hello World!</div><div><br></div><div>Steps:</div><div># Make </div><div># insmod misc.ko</div>
<div># head -1 /dev/miscdrv<br></div><div><br></div><div>Why my driver doesn't work ?</div><div><br></div><div>What is worg with my read operation?</div><div><br></div><div><div>static ssize_t</div><div>misc_drv_read(struct file *filp, char __user * buf, size_t count, loff_t * offp){</div>
<div> int nbytes;</div><div><span class="" style="white-space:pre">        </span>char * string = "hello World";</div><div><span class="" style="white-space:pre">        </span>nbytes = copy_to_user(buf, string, 12);</div>
<div><span class="" style="white-space:pre">        </span>return nbytes;</div><div>}</div></div><div><br></div><div><br clear="all"><div><div dir="ltr"><div>--</div>Lucas Tanure <br></div></div><div>Brazil</div>
</div></div>