#include #include void dump_regs(int base) { int i; for(i=0; i<16; i++) { printf("[%x]=%02x", i, inb(base+i)); if(i % 4 == 3) printf("\n"); else printf(" "); } } int main(int argc, char **argv) { int base = 0xc000; int offset = 0xc0; int count = 256; system("sync"); iopl(3); dump_regs(base); outb(0x21, base); // PIB reset high, 15 cycle operation outb(0x20, base); // PIB reset low, 15 cycle operation outb(0x10, base+3); // relay off (active-high), cs low outb(0x11, base+2); // relay, CS# as outputs outb(0x00, base+offset+3*4); dump_regs(base); printf("Doing %d reads at 0x%4x\n", count, base+offset); for(;;count--) { int v = inb(base+offset); if(count % (2<<8-1) == 0 || v != 0) { printf("%02x %02x\n", v, count); fflush(stdout); } for(v=0; v<20; v++) outb(0x80, 0x80); } dump_regs(base); return 0; }