I am trying short.c in examples of Linux Device Driver 3
My PC has Parallel Port and after the Ubuntu boots up, I can see these:
cat /proc/ioports
0378-037a : parport0
037b-037f : parport0
outp 0x378 1
(outp is another example in LDD3 which write data to ports)
the LED on the port is ON.
Then I run these commands to remove modules
rmmod lp
rmmod parport_pc
cat /proc/ioports
(There is no module on 0378-037f any more.)
I run this again but the LED is not ON this time.
outp 0x378 1
Then I install short.ko and request_region() succeeds.
cat /proc/ioports
0378-037f : short
cat /proc/devices
249 short
outp 0x378 1
the LED is not ON this time either.
I tried these too, but same result (LED is not ON)
mknod /dev/short0 c 249 0
echo -n "a" > /dev/short0
"a" is 0x61 so that the last bit is 1.
Why can I not write data out though I have got the I/O region?
Thanks for your answer.