4 unsigned int counter = 0;
7 unsigned char thestr[512];
8 unsigned char logents[4][41] = {0};
10 unsigned char vgaread(unsigned char idx)
16 void strblit(char *src, int r, int c)
18 char *destp = (char*)(0xB8000UL | (((unsigned int)vgaread(0xC)) << 9) | (((unsigned int)vgaread(0xD)) << 1)) + r*80*2 + c*2;
21 smramc = pci_read8(0, 0, 0, 0x70);
22 pci_write8(0, 0, 0, 0x70, (smramc & 0xF3) | 0x08);
25 *(destp++) = *(src++);
28 pci_write8(0, 0, 0, 0x70, smramc);
35 unsigned char *basep = (char*)(0xB8000UL | (((unsigned int)vgaread(0xC)) << 9) | (((unsigned int)vgaread(0xD)) << 1));
37 smramc = pci_read8(0, 0, 0, 0x70);
38 pci_write8(0, 0, 0, 0x70, (smramc & 0xF3) | 0x08);
39 for (y = 0; y < 4; y++)
40 for (x = 40; x < 80; x++)
42 basep[y*80*2+x*2] = ' ';
43 basep[y*80*2+x*2+1] = 0x1F;
45 pci_write8(0, 0, 0, 0x70, smramc);
47 for (y = 0; y < 4; y++)
48 strblit(logents[y], y, 40);
54 memmove(logents[0], logents[1], sizeof(logents[0])*3);
55 strcpy(logents[3], s);
69 dolog("NetWatch running...");
73 outb(0x80, (counter & 0xFF));
75 strcpy(thestr, "15-412! xxxxxxxx xxxxxxxx");
76 tohex(thestr + 8, inl(0x0834));
77 tohex(thestr + 17, counter);
78 strblit(thestr, 0, 0);
80 if (inl(0x834) & 0x20)
81 dolog("Warning: unhandled APM access");
82 if (inl(0x834) & 0x4000)
83 dolog("Long periodic timer");
84 if (inl(0x834) & ~(0x4160))
87 strcpy(s, "Unknown: xxxxxxxx");
88 tohex(s + 9, inl(0x834) & ~(0x140));
97 outl(0x834, /*0x40*/0xFFFF); // ack the periodic IRQ
98 outb(0x830, (inb(0x830) | 0x2) & ~0x40);
99 outb(0x830, inb(0x830) | 0x40);