??????????????????????????IOport?????漰??????????д??
????????????????? /usr/include/asm/io.h
????ioperm()
?????? unistd.h ????????
????????????IOport??????????????????????????root ?????????????0x00??0x3ff ???????ε?IOport??
????ioperm( from?? num?? turn_on)
?????????
????#include<asm/io.h>
????#include<unistd.h>
????ioperm( 0x300?? 5?? 1);
?????????0x300 ??????????5??IO????????????????
????iopl()
???????????????0x3ff????????Ρ??????iopl() ??????
????iopl(3) ???????????IOport?????????
????IO ??д????
????inb(port);
????inw(port);
????outb(value?? port);
????outw(value?? port);
??????IO??????д??????1us???????????outb ?????? turbo C ?е? outportb ???????????????????????????
????inb_p(port);
????inw_p(port);
????outb_p(value?? port);
????outw_p(value?? port);
??????????????????????????????????????????????????IOport?????????1us??????????
???????趨????REALLY_SLOW_IO???????????4us??
????#define REALLY_SLOW_IO 1
????#include<asm/io.h>
????inb_p(port);
????/dev/port
????????????IO??????????????/dev/port ?豸?????????
????????????????????root ???????????ж?/dev/port??????????ɡ?
????????????????????????????? ?? lseek()?? ???read()?? write() ??????
?????????????? select() ?????? poll() ??????????IOport???????Щ?????
???????? ?ж?
????iopl(3) ????????????????????????????????ж??
????asm(“cli”); //???ж?
????asm(“sti”); //???ж?