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) & 0x1000)
83 if (inl(0x844) & 0x1000) /* devact_sts */
87 static int curdev = 0; /* 0 if kbd, 1 if mouse */
98 strcpy(s, "READxxxxxxxxxxxxxxxx");
100 b = inb(cts & 0xFFFF);
102 if ((cts & 0xFFFF) == 0x64)
103 curdev = (b & 0x20) ? 1 : 0;
104 if ((curdev == 0) && ((cts & 0xFFFF) == 0x60) && (b == 0x01))
107 *(unsigned char*)0xAFFD0 /* EAX */ = b;
114 strcpy(s, "WRITxxxxxxxxxxxxxxxx");
115 b = *(unsigned char*)0xAFFD0 /* EAX */;
119 outb(cts & 0xFFFF, b);
123 dolog("Unhandled PCI cycle");
129 if (inl(0x834) & 0x4000)
130 dolog("Long periodic timer");
131 if (inl(0x834) & ~(0x4160))
134 strcpy(s, "Unknown: xxxxxxxx");
135 tohex(s + 9, inl(0x834) & ~(0x140));
141 outl(0xCF8, pcisave);
142 outb(0x3D4, vgasave);
145 outl(0x834, /*0x40*/0xFFFF); // ack the periodic IRQ
146 outb(0x830, (inb(0x830) | 0x2) & ~0x40);
147 outb(0x830, inb(0x830) | 0x40);