--- src/config.h | 1 - src/misc.c | 9 --------- src/sercon.c | 49 ++++++++++++++++++------------------------------- src/romlayout.S | 5 +++-- 4 files changed, 21 insertions(+), 43 deletions(-)
diff --git a/src/config.h b/src/config.h index baca029f0e..93c8dbc2d5 100644 --- a/src/config.h +++ b/src/config.h @@ -76,7 +76,6 @@ #define DEBUG_ISR_08 20 #define DEBUG_ISR_09 9 #define DEBUG_ISR_0e 9 -#define DEBUG_HDL_10 20 #define DEBUG_HDL_11 2 #define DEBUG_HDL_12 2 #define DEBUG_HDL_13 10 diff --git a/src/misc.c b/src/misc.c index f4b656dd35..387a3482c9 100644 --- a/src/misc.c +++ b/src/misc.c @@ -52,15 +52,6 @@ handle_05(struct bregs *regs) debug_enter(regs, DEBUG_HDL_05); }
-// INT 10h Video Support Service Entry Point -void VISIBLE16 -handle_10(struct bregs *regs) -{ - debug_enter(regs, DEBUG_HDL_10); - // don't do anything, since the VGA BIOS handles int10h requests - sercon_10(regs); -} - // NMI handler void VISIBLE16 handle_02(void) diff --git a/src/sercon.c b/src/sercon.c index 5699905f32..9c49a2fc4c 100644 --- a/src/sercon.c +++ b/src/sercon.c @@ -325,10 +325,10 @@ static void sercon_1000(struct bregs *regs) SET_BDA(video_rows, rows-1); SET_BDA(cursor_type, 0x0007); } else { - SET_LOW(sercon_enable, (mode == 0x03)); /* let vgabios handle mode init */ }
+ SET_LOW(sercon_enable, (mode == 0x03)); SET_LOW(sercon_col_last, 0); SET_LOW(sercon_row_last, 0); SET_LOW(sercon_attr_last, 0); @@ -470,40 +470,26 @@ sercon_10(struct bregs *regs) return;
switch (regs->ah) { - case 0x00: sercon_1000(regs); break; - case 0x01: sercon_1001(regs); break; - case 0x02: sercon_1002(regs); break; - case 0x03: sercon_1003(regs); break; - case 0x06: sercon_1006(regs); break; - case 0x08: sercon_1008(regs); break; - case 0x09: sercon_1009(regs); break; - case 0x0e: sercon_100e(regs); break; - case 0x0f: sercon_100f(regs); break; - case 0x4f: sercon_104f(regs); break; - default: sercon_10XX(regs); break; - } -} - -void VISIBLE16 -sercon_10_splitmode(struct bregs *regs) -{ - if (!CONFIG_SERCON) - return; - if (!GET_LOW(sercon_port)) - return; - - switch (regs->ah) { case 0x01: case 0x02: case 0x03: case 0x08: case 0x0f: - /* nothing, vgabios did all work */ - break; + if (sercon_splitmode()) + /* nothing, vgabios handles it */ + return; + } + + switch (regs->ah) { case 0x00: sercon_1000(regs); break; + case 0x01: sercon_1001(regs); break; + case 0x02: sercon_1002(regs); break; + case 0x03: sercon_1003(regs); break; case 0x06: sercon_1006(regs); break; + case 0x08: sercon_1008(regs); break; case 0x09: sercon_1009(regs); break; case 0x0e: sercon_100e(regs); break; + case 0x0f: sercon_100f(regs); break; case 0x4f: sercon_104f(regs); break; default: sercon_10XX(regs); break; } @@ -521,15 +507,16 @@ void sercon_setup(void) seabios = FUNC16(entry_10); if (vgabios.seg != seabios.seg || vgabios.offset != seabios.offset) { - dprintf(1, "%s:%d: using splitmode (vgabios %04x:%04x, hook %04x:%04x)\n", - __func__, __LINE__, - vgabios.seg, vgabios.offset, - seabios.seg, seabios.offset); + dprintf(1, "sercon: configuring in splitmode (vgabios %04x:%04x)\n", + vgabios.seg, vgabios.offset); sercon_real_vga_handler = vgabios; - SET_IVT(0x10, FUNC16(entry_sercon)); SET_LOW(sercon_split, 1); + } else { + dprintf(1, "sercon: configuring as primary display\n"); + sercon_real_vga_handler = seabios; }
+ SET_IVT(0x10, FUNC16(entry_sercon)); SET_LOW(sercon_port, addr); outb(0x03, addr + SEROFF_LCR); // 8N1 outb(0x01, addr + 0x02); // enable fifo diff --git a/src/romlayout.S b/src/romlayout.S index 1c9d56df1b..911a416d7f 100644 --- a/src/romlayout.S +++ b/src/romlayout.S @@ -440,7 +440,7 @@ entry_sercon:
2: popl %eax popw %ds - pushl $sercon_10_splitmode + pushl $sercon_10 #if CONFIG_ENTRY_EXTRASTACK jmp irqentry_arg_extrastack #else @@ -643,7 +643,8 @@ entry_10_0x0f: iretw
ORG 0xf065 - IRQ_ENTRY_ARG 10 +entry_10: + iretw
// 0xf0a4 - VideoParams in misc.c