3 unsigned int counter = 0;
6 unsigned char thestr[512];
7 unsigned char logents[4][41] = {0};
9 unsigned char vgaread(unsigned char idx)
15 void strblit(char *src, int r, int c)
17 char *destp = (char*)(0xB8000UL | (((unsigned int)vgaread(0xC)) << 9) | (((unsigned int)vgaread(0xD)) << 1)) + r*80*2 + c*2;
20 smramc = pci_read8(0, 0, 0, 0x70);
21 pci_write8(0, 0, 0, 0x70, (smramc & 0xF3) | 0x08);
24 *(destp++) = *(src++);
27 pci_write8(0, 0, 0, 0x70, smramc);
34 unsigned char *basep = (char*)(0xB8000UL | (((unsigned int)vgaread(0xC)) << 9) | (((unsigned int)vgaread(0xD)) << 1));
36 smramc = pci_read8(0, 0, 0, 0x70);
37 pci_write8(0, 0, 0, 0x70, (smramc & 0xF3) | 0x08);
38 for (y = 0; y < 4; y++)
39 for (x = 40; x < 80; x++)
41 basep[y*80*2+x*2] = ' ';
42 basep[y*80*2+x*2+1] = 0x1F;
44 pci_write8(0, 0, 0, 0x70, smramc);
46 for (y = 0; y < 4; y++)
47 strblit(logents[y], y, 40);
53 memmove(logents[0], logents[1], sizeof(logents[0])*3);
54 strcpy(logents[3], s);
68 dolog("NetWatch running...");
72 outb(0x80, (counter & 0xFF));
74 strcpy(thestr, "15-412! xxxxxxxx xxxxxxxx");
75 tohex(thestr + 8, inl(0x0834));
76 tohex(thestr + 17, counter);
77 strblit(thestr, 0, 0);
79 if (inl(0x834) & 0x20)
80 dolog("Warning: unhandled APM access");
81 if (inl(0x834) & 0x4000)
82 dolog("Long periodic timer");
83 if (inl(0x834) & ~(0x4160))
86 strcpy(s, "Unknown: xxxxxxxx");
87 tohex(s + 9, inl(0x834) & ~(0x140));
96 outl(0x834, /*0x40*/0xFFFF); // ack the periodic IRQ
97 outb(0x830, (inb(0x830) | 0x2) & ~0x40);
98 outb(0x830, inb(0x830) | 0x40);