io port programming 9 bsvigxk3fihvml32v2o7jjc3dbmfwabakehdgda bsvigxk3fihvml32v2o7jjc3dbmfwabakehdgda BSVIGXK3FIHVML32V2O7JJC3DBMFWABAKEHDGDA

Linux I/O port programming mini-HOWTO: Example code 9. Example codeHere's a piece of simple example code for I/O port access: /* * example.c: very simple example of port I/O * * This code does nothing useful, just a port write, a pause, * and a port read. Compile with `gcc -O2 -o example example.c', * and run as root with `./example'. */ #include <stdio.h> #include <unistd.h> #include <asm/io.h> #define BASEPORT 0x378 /* lp1 */ int main() { /* Get access to the ports */ if (ioperm(BASEPORT, 3, 1)) {perror("ioperm"); exit(1);} /* Set the data signals (D0-7) of the port to all low (0) */ outb(0, BASEPORT); /* Sleep for a while (100 ms) */ usleep(100000); /* Read from the status port (BASE+1) and display the result */ printf("status: %d\n", inb(BASEPORT + 1)); /* We don't need the ports anymore */ if (ioperm(BASEPORT, 3, 0)) {perror("ioperm"); exit(1);} exit(0); } /* end of example.c */ .
Wyszukiwarka

Podobne podstrony:
io port programming 3ogqzy3bscrrpgv753q3uywjfexgwwoiiffd46a 3ogqzy3bscrrpgv753q3uywjfexgwwoiiffd46a
io port programming 3 qy2fcczvezn6os2r4msukcj6sj3wb2c66g52tqa qy2fcczvezn6os2r4msukcj6sj3wb2c66g52tq
io port programming 4 g663ndzpyars5zgt4bwhjhckiymx7v2jb25jzty g663ndzpyars5zgt4bwhjhckiymx7v2jb25jzt
io port programming 2 aob45svpsjh4idgeh6zm2erfyrgapt5u3bvnrry aob45svpsjh4idgeh6zm2erfyrgapt5u3bvnrr
io port programming 5 eudg6ob6aa23wgf3psn55ug2wapp6nwmdmz2liq eudg6ob6aa23wgf3psn55ug2wapp6nwmdmz2li
io port programming 8 kfkr3yd2ttnqzyo6fab47vs6kqduy2bk6adhpoa kfkr3yd2ttnqzyo6fab47vs6kqduy2bk6adhpo
io port programming 8 kfkr3yd2ttnqzyo6fab47vs6kqduy2bk6adhpoa kfkr3yd2ttnqzyo6fab47vs6kqduy2bk6adhpo
io port programming 1 wkqbqwnae5anupch4hacfas7n2bjo7fkiedj4ga wkqbqwnae5anupch4hacfas7n2bjo7fkiedj4g
io port programming 7 vt6et7vbhj5d2moglnxb7rbnttgey5fviyfjajy vt6et7vbhj5d2moglnxb7rbnttgey5fviyfjaj
IO Port Programming
io port programming 6 fottyb2eobrw7za26dggcajjim4gtl6p2ubx7yy fottyb2eobrw7za26dggcajjim4gtl6p2ubx7y
io programming pl 11
io programming pl 1
io programming pl 2
IO Programming pl (3)
IO Programming pl (2)
io programming pl 10

więcej podobnych podstron