--- np2/debugsub386.c 2004/03/08 12:45:57 1.2 +++ np2/debugsub386.c 2004/03/19 00:30:00 1.5 @@ -149,19 +149,19 @@ const char *p; SPRINTF(work, str_picstat, pic.pi[0].imr, pic.pi[0].irr, pic.pi[0].isr, pic.pi[1].imr, pic.pi[1].irr, pic.pi[1].isr, - mouseif.portc, sysport.c); + mouseif.upd8255.portc, sysport.c); file_write(fh, work, strlen(work)); file_close(fh); } SPRINTF(work, file_i386cs, filenum); - debugwriteseg(work, &CPU_STAT_SREG(CPU_CS_INDEX), 0, 0x10000); + debugwriteseg(work, &CPU_STAT_SREG(CPU_CS_INDEX), CPU_EIP & 0xffff0000, 0x10000); SPRINTF(work, file_i386ds, filenum); debugwriteseg(work, &CPU_STAT_SREG(CPU_DS_INDEX), 0, 0x10000); SPRINTF(work, file_i386es, filenum); debugwriteseg(work, &CPU_STAT_SREG(CPU_ES_INDEX), 0, 0x10000); SPRINTF(work, file_i386ss, filenum); - debugwriteseg(work, &CPU_STAT_SREG(CPU_SS_INDEX), 0, 0x10000); + debugwriteseg(work, &CPU_STAT_SREG(CPU_SS_INDEX), CPU_ESP & 0xffff0000, 0x10000); filenum++; } @@ -181,3 +181,36 @@ void debugsub_memorydump(void) { } } + +#if 1 // ²¶ÍѥǥХ° + +void debugpageptr(UINT32 addr) { + + FILEH fh; + char buf[256]; + UINT32 pde; + UINT32 pte; + UINT i; + UINT32 a; + + fh = file_create("page.txt"); + SPRINTF(buf, "CR3=%.8x\r\n", CPU_CR3); + file_write(fh, buf, strlen(buf)); + for (i=0; i<1024; i++) { + a = CPU_STAT_PDE_BASE + (i * 4); + pde = cpu_memoryread_d(a); + SPRINTF(buf, "%.8x=>%.8x [%.8x]\r\n", (i << 22), pde, a); + file_write(fh, buf, strlen(buf)); + } + addr >>= 22; + pde = cpu_memoryread_d(CPU_STAT_PDE_BASE + (addr * 4)); + for (i=0; i<1024; i++) { + a = (pde & CPU_PDE_BASEADDR_MASK) + (i * 4); + pte = cpu_memoryread_d(a); + SPRINTF(buf, "%.8x=>%.8x [%.8x]\r\n", (addr << 22) + (i << 12), pte, a); + file_write(fh, buf, strlen(buf)); + } + file_close(fh); +} + +#endif