Linux I/O port programming mini-HOWTO: Troubleshooting
8. TroubleshootingQ1.I get segmentation faults when accessing ports.A1.Either your program does not have root privileges, or the
ioperm() call failed for some other reason. Check the return
value of ioperm(). Also, check that you're actually accessing the
ports that you enabled with ioperm() (see Q3). If you're using
the delaying macros (inb_p(), outb_p(), and so on), remember
to call ioperm() to get access to port 0x80 too.Q2.I can't find the in*(), out*() functions defined
anywhere, and gcc complains about undefined references.A2.You did not compile with optimisation turned on (-O),
and thus gcc could not resolve the macros in asm/io.h. Or you
did not #include <asm/io.h> at all.Q3.out*() doesn't do anything, or does something weird.A3.Check the order of the parameters; it should be
outb(value, port), not outportb(port, value) as is common in
MS-DOS.Q4.I want to control a standard RS-232 device/parallel
printer/joystick...A4.You're probably better off using existing drivers (in the
Linux kernel or an X server or somewhere else) to do it. The drivers
are usually quite versatile, so even slightly non-standard devices
usually work with them. See the information on standard ports above
for pointers to documentation for them.
n
Wyszukiwarka
Podobne podstrony:
io port programming 3ogqzy3bscrrpgv753q3uywjfexgwwoiiffd46a 3ogqzy3bscrrpgv753q3uywjfexgwwoiiffd46aio port programming 3 qy2fcczvezn6os2r4msukcj6sj3wb2c66g52tqa qy2fcczvezn6os2r4msukcj6sj3wb2c66g52tqio port programming 4 g663ndzpyars5zgt4bwhjhckiymx7v2jb25jzty g663ndzpyars5zgt4bwhjhckiymx7v2jb25jztio port programming 2 aob45svpsjh4idgeh6zm2erfyrgapt5u3bvnrry aob45svpsjh4idgeh6zm2erfyrgapt5u3bvnrrio port programming 5 eudg6ob6aa23wgf3psn55ug2wapp6nwmdmz2liq eudg6ob6aa23wgf3psn55ug2wapp6nwmdmz2liio port programming 9 bsvigxk3fihvml32v2o7jjc3dbmfwabakehdgda bsvigxk3fihvml32v2o7jjc3dbmfwabakehdgdio port programming 1 wkqbqwnae5anupch4hacfas7n2bjo7fkiedj4ga wkqbqwnae5anupch4hacfas7n2bjo7fkiedj4gio port programming 7 vt6et7vbhj5d2moglnxb7rbnttgey5fviyfjajy vt6et7vbhj5d2moglnxb7rbnttgey5fviyfjajIO Port Programmingio port programming 6 fottyb2eobrw7za26dggcajjim4gtl6p2ubx7yy fottyb2eobrw7za26dggcajjim4gtl6p2ubx7yio programming pl 11io programming pl 1io programming pl 2IO Programming pl (3)IO Programming pl (2)io programming pl 10więcej podobnych podstron