<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:12.666666984558105px">I am trying to load/unload a basic driver skeleton. </span><div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br>
</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">I did an insmod ./mydriver.ko </div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">, then a </div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">
mknod /dev/mydriver0 c <major #> 0 </div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">, then a</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">ln -sf mydriver0 /dev/mydriver</div>
<div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">All is well. Now to unload</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">
<br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">rmmod mydriver</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">rm -f /dev/mydriver</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">
rm -f /dev/mydriver0<br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">But rmmod reports Module mydriver is not currently loaded. </div>
<div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">But it is in /proc/devices:</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">
248 mydriver</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">Trying to reload it gives:</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">
insmod ./mydriver.ko</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">Could not insert module mydriver.ko: File exists. </div>
<div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">I could reboot .... again ... but what is wrong?</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">
<br></div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px">I have source for the driver, as I am developing it.</div><div style="font-family:arial,sans-serif;font-size:12.666666984558105px"><br></div>
<div style="font-family:arial,sans-serif;font-size:12.666666984558105px">WS</div><div class="" style="font-family:arial,sans-serif;font-size:12.666666984558105px"><div id=":148" class="" tabindex="0"><img class="" src="https://mail.google.com/mail/u/0/images/cleardot.gif"></div>
</div><div><br></div><div dir="ltr"><br></div>
</div>