I’m trying to get IO port region, modify and read that I wrote.
I use x86 machine, Fedora distrib, 6.7.0-rc7 kernel that rebuilded with all I seek debug CONFIG symbols.
The first via request_region(…):
Im checking /proc/ioport, trying to get 0x378 (he is not used by any module, all ok). After request_region(0x378, 3) I see my driver name in the /proc/ioport. Then I try:
outb_p(0x33, 0x378);
wmb();
pr_info("%Xn", 0x378);
rmb();
That’s all. In the ‘dmesg’ I’m waiting for 0x33, but I see 0xFF. I think there is contacts/wires needed to be attached on real hardware of this interface (parallel port), may be this is the reason there is always 0xFF, becouse via dd if=/dev/zero of=/dev/port bs=1 skip=888 count=1
there is no changes in the output of hexdump -C /dev/port
.
The second way try to modify (any) port is via request_mem_region(…):
I’m trying to get 0xD0000000 to 0xD000000F (becouse above almost all used, from 0 to 0xC*******). And there is all is okay, my driver in the /proc/iomem. Next:
addr = ioremap(0xD0000000, 0x10);
iowrite8(0x33, addr);
pr_info("%Xn", ioread8(addr));
Aaaand, the same story! Nothing is going on, always 0xFF I see…
Im reading ldd3 book, and there is no words about that I cant use any free address and see my modifications of these addresses, so, I dont understand what I’m doing wrong with addresses of IO system of Linux.
Any help, please ?:)
I did try other functions of write/read with different sizes of reading/writing.
nx4n is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.