0

Linux Device Driver 3 の例で short.c を試しています

私の PC にはパラレル ポートがあり、Ubuntu の起動後、次のように表示されます。

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.

次に、これらのコマンドを実行してモジュールを削除します

rmmod lp
rmmod parport_pc
cat /proc/ioports
(There is no module on 0378-037f any more.)

これをもう一度実行しますが、今度は LED がオンになりません。

outp 0x378 1

次に、short.ko をインストールすると、request_region() が成功します。

cat /proc/ioports
0378-037f : short

cat /proc/devices
249 short

outp 0x378 1
the LED is not ON this time either.

これらも試してみましたが、同じ結果です(LEDが点灯しません)

mknod /dev/short0 c 249 0
echo -n "a" > /dev/short0

「a」は 0x61 なので、最後のビットは 1 です。

I/O 領域を持っているのに、データを書き出せないのはなぜですか?

ご回答有難うございます。

4

1 に答える 1