- improved debvug_dump() for pci, pic and vga / cirrus

- pci2isa: added debug_dump()
This commit is contained in:
Volker Ruppert 2012-03-11 12:17:41 +00:00
parent 3027c108a8
commit 4acef49a29
9 changed files with 87 additions and 18 deletions

View File

@ -389,18 +389,19 @@ void bx_pci_bridge_c::debug_dump()
{
int i;
dbg_printf("i440fx ConfAddr = 0x%08x\n", BX_PCI_THIS confAddr);
dbg_printf("i440fx ConfData = 0x%08x\n", BX_PCI_THIS confData);
dbg_printf("i440FX PMC/DBX\n\n");
dbg_printf("confAddr = 0x%08x\n", BX_PCI_THIS confAddr);
dbg_printf("confData = 0x%08x\n", BX_PCI_THIS confData);
#ifdef DUMP_FULL_I440FX
for (i=0; i<256; i++) {
dbg_printf("i440fx reg 0x%02x = 0x%02x\n", i, BX_PCI_THIS pci_conf[i]);
dbg_printf("PCI conf 0x%02x = 0x%02x\n", i, BX_PCI_THIS pci_conf[i]);
}
#else /* DUMP_FULL_I440FX */
for (i=0x59; i<0x60; i++) {
dbg_printf("i440fx PAM reg 0x%02x = 0x%02x\n", i, BX_PCI_THIS pci_conf[i]);
dbg_printf("PAM reg 0x%02x = 0x%02x\n", i, BX_PCI_THIS pci_conf[i]);
}
dbg_printf("i440fx SMRAM control = 0x%02x\n", BX_PCI_THIS pci_conf[0x72]);
dbg_printf("SMRAM control = 0x%02x\n", BX_PCI_THIS pci_conf[0x72]);
#endif /* DUMP_FULL_I440FX */
}
#endif

View File

@ -106,6 +106,10 @@ void bx_piix3_c::init(void)
BX_P2I_THIS pci_conf[0x61] = 0x80;
BX_P2I_THIS pci_conf[0x62] = 0x80;
BX_P2I_THIS pci_conf[0x63] = 0x80;
#if BX_DEBUGGER
// register device for the 'info device' command (calls debug_dump())
bx_dbg_register_debug_info("pci2isa", this);
#endif
}
void bx_piix3_c::reset(unsigned type)
@ -378,4 +382,18 @@ void bx_piix3_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
}
}
#if BX_DEBUGGER
void bx_piix3_c::debug_dump()
{
int i;
dbg_printf("PIIX3 ISA bridge\n\n");
for (i = 0; i < 4; i++) {
dbg_printf("PIRQ%c# = 0x%02x\n", i + 65, BX_P2I_THIS pci_conf[0x60 + i]);
}
dbg_printf("ELCR1 = 0x%02x\n", BX_P2I_THIS s.elcr1);
dbg_printf("ELCR2 = 0x%02x\n", BX_P2I_THIS s.elcr2);
}
#endif
#endif /* BX_SUPPORT_PCI */

View File

@ -42,6 +42,9 @@ public:
virtual Bit32u pci_read_handler(Bit8u address, unsigned io_len);
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
#if BX_DEBUGGER
virtual void debug_dump(void);
#endif
private:

View File

@ -867,15 +867,16 @@ Bit8u bx_pic_c::IAC(void)
}
#if BX_DEBUGGER
void bx_pic_c::debug_dump(void)
void bx_pic_c::debug_dump()
{
dbg_printf("s.master_pic.imr = %02x\n", BX_PIC_THIS s.master_pic.imr);
dbg_printf("s.master_pic.isr = %02x\n", BX_PIC_THIS s.master_pic.isr);
dbg_printf("s.master_pic.irr = %02x\n", BX_PIC_THIS s.master_pic.irr);
dbg_printf("s.master_pic.irq = %02x\n", BX_PIC_THIS s.master_pic.irq);
dbg_printf("s.slave_pic.imr = %02x\n", BX_PIC_THIS s.slave_pic.imr);
dbg_printf("s.slave_pic.isr = %02x\n", BX_PIC_THIS s.slave_pic.isr);
dbg_printf("s.slave_pic.irr = %02x\n", BX_PIC_THIS s.slave_pic.irr);
dbg_printf("s.slave_pic.irq = %02x\n", BX_PIC_THIS s.slave_pic.irq);
dbg_printf("i8259A PIC\n\n");
dbg_printf("master IMR = %02x\n", BX_PIC_THIS s.master_pic.imr);
dbg_printf("master ISR = %02x\n", BX_PIC_THIS s.master_pic.isr);
dbg_printf("master IRR = %02x\n", BX_PIC_THIS s.master_pic.irr);
dbg_printf("master IRQ = %02x\n", BX_PIC_THIS s.master_pic.irq);
dbg_printf("slave IMR = %02x\n", BX_PIC_THIS s.slave_pic.imr);
dbg_printf("slave ISR = %02x\n", BX_PIC_THIS s.slave_pic.isr);
dbg_printf("slave IRR = %02x\n", BX_PIC_THIS s.slave_pic.irr);
dbg_printf("slave IRQ = %02x\n", BX_PIC_THIS s.slave_pic.irq);
}
#endif

View File

@ -278,6 +278,10 @@ void bx_svga_cirrus_c::init_vga_extension(void)
// initialize VGA extension, read/write handlers and timer
BX_CIRRUS_THIS bx_vgacore_c::init_vga_extension();
}
#if BX_DEBUGGER
// register device for the 'info device' command (calls debug_dump())
bx_dbg_register_debug_info("cirrus", this);
#endif
}
void bx_svga_cirrus_c::svga_init_members()
@ -3449,4 +3453,26 @@ bx_cirrus_bitblt_rop_t bx_svga_cirrus_c::svga_get_bkwd_rop_handler(Bit8u rop)
return rop_handler;
}
#if BX_DEBUGGER
void bx_svga_cirrus_c::debug_dump()
{
if ((BX_CIRRUS_THIS sequencer.reg[0x07] & 0x01) == CIRRUS_SR7_BPP_SVGA) {
#if BX_SUPPORT_PCI
if (BX_CIRRUS_THIS pci_enabled)
{
dbg_printf("CL-GD5446 PCI\n\n");
}
else
#endif
{
dbg_printf("CL-GD5430 ISA\n\n");
}
dbg_printf("current mode: %u x %u x %u\n", BX_CIRRUS_THIS svga_xres,
BX_CIRRUS_THIS svga_yres, BX_CIRRUS_THIS svga_dispbpp);
} else {
bx_vgacore_c::debug_dump();
}
}
#endif
#endif // BX_SUPPORT_CLGD54XX

View File

@ -85,6 +85,9 @@ public:
virtual Bit32u pci_read_handler(Bit8u address, unsigned io_len);
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
#endif
#if BX_DEBUGGER
virtual void debug_dump(void);
#endif
private:
static Bit32u svga_read_handler(void *this_ptr, Bit32u address, unsigned io_len);

View File

@ -186,6 +186,10 @@ void bx_vga_c::init_vga_extension(void)
BX_VGA_THIS load_pci_rom(SIM->get_param_string(BXPN_VGA_ROM_PATH)->getptr());
}
#endif
#if BX_DEBUGGER
// register device for the 'info device' command (calls debug_dump())
bx_dbg_register_debug_info("vga", this);
#endif
}
void bx_vga_c::reset(unsigned type)
@ -1463,3 +1467,16 @@ void bx_vga_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len)
}
}
#endif
#if BX_DEBUGGER
void bx_vga_c::debug_dump(void)
{
if (BX_VGA_THIS vbe.enabled) {
dbg_printf("Bochs VGA/VBE adapter\n\n");
dbg_printf("current mode : %u x %u x %u\n", BX_VGA_THIS vbe.xres,
BX_VGA_THIS vbe.yres, BX_VGA_THIS vbe.bpp);
} else {
bx_vgacore_c::debug_dump();
}
}
#endif

View File

@ -118,6 +118,9 @@ public:
virtual Bit32u pci_read_handler(Bit8u address, unsigned io_len);
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
#endif
#if BX_DEBUGGER
virtual void debug_dump(void);
#endif
static Bit64s vga_param_handler(bx_param_c *param, int set, Bit64s val);

View File

@ -124,10 +124,6 @@ void bx_vgacore_c::init(void)
if (!BX_VGA_THIS pci_enabled) {
BX_MEM(0)->load_ROM(SIM->get_param_string(BXPN_VGA_ROM_PATH)->getptr(), 0xc0000, 1);
}
#if BX_DEBUGGER
// register device for the 'info device' command (calls debug_dump())
bx_dbg_register_debug_info("vga", this);
#endif
}
void bx_vgacore_c::init_standard_vga(void)
@ -2363,6 +2359,7 @@ Bit32u bx_vgacore_c::get_gfx_snapshot(Bit8u **snapshot_ptr, Bit8u **palette_ptr,
#if BX_DEBUGGER
void bx_vgacore_c::debug_dump(void)
{
dbg_printf("Standard VGA adapter\n\n");
dbg_printf("s.misc_output.color_emulation = %u\n",
(unsigned) BX_VGA_THIS s.misc_output.color_emulation);
dbg_printf("s.misc_output.enable_ram = %u\n",