The original "lgpl vgabios" had a special case for dh==0xff in its int1013 (write string) code. There does not appear to be any VGABIOS documentation supporting this as an externally available feature. It appears this was for its own internal use when writing its strings to the screen. SeaVGABIOS doesn't use this hack; this patch removes it from the code.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- vgasrc/vgabios.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c index f07e85b..8b50192 100644 --- a/vgasrc/vgabios.c +++ b/vgasrc/vgabios.c @@ -1030,13 +1030,7 @@ handle_1012(struct bregs *regs) static void noinline handle_1013(struct bregs *regs) { - struct cursorpos cp; - if (regs->dh == 0xff) - // if row=0xff special case : use current cursor position - cp = get_cursor_pos(regs->bh); - else - cp = (struct cursorpos) {regs->dl, regs->dh, regs->bh}; - + struct cursorpos cp = {regs->dl, regs->dh, regs->bh}; u16 count = regs->cx; u8 *offset_far = (void*)(regs->bp + 0); u8 attr = regs->bl;
The original "lgpl vgabios" internally used page=0xff as a mechanism for specifying the current page. It also would allow int1013 calls to externally specify bh==0xff for the current page. However, there is no documentation supporting this as an externally available feature. SeaVGABIOS does not need the internal shortcut; this patch removes the code.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- vgasrc/vgabios.c | 14 ++++---------- vgasrc/vgafb.c | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c index 8b50192..2593e03 100644 --- a/vgasrc/vgabios.c +++ b/vgasrc/vgabios.c @@ -109,16 +109,10 @@ set_cursor_pos(struct cursorpos cp) struct cursorpos get_cursor_pos(u8 page) { - if (page == 0xff) - // special case - use current page - page = GET_BDA(video_page); - if (page > 7) { - struct cursorpos cp = { 0, 0, 0xfe }; - return cp; - } + if (page > 7) + return (struct cursorpos) { 0, 0, 0 }; u16 xy = GET_BDA(cursor_pos[page]); - struct cursorpos cp = {xy, xy>>8, page}; - return cp; + return (struct cursorpos) { xy, xy>>8, page }; }
static void @@ -555,7 +549,7 @@ handle_100e(struct bregs *regs) // Ralf Brown Interrupt list is WRONG on bh(page) // We do output only on the current page ! struct carattr ca = {regs->al, regs->bl, 0}; - struct cursorpos cp = get_cursor_pos(0xff); + struct cursorpos cp = get_cursor_pos(GET_BDA(video_page)); write_teletype(&cp, ca); set_cursor_pos(cp); } diff --git a/vgasrc/vgafb.c b/vgasrc/vgafb.c index 5d1ecc9..58c60ad 100644 --- a/vgasrc/vgafb.c +++ b/vgasrc/vgafb.c @@ -674,7 +674,7 @@ vgafb_set_swcursor(int enable) struct vgamode_s *vmode_g = get_current_mode(); if (!vmode_g) return; - struct cursorpos cp = get_cursor_pos(0xff); + struct cursorpos cp = get_cursor_pos(GET_BDA(video_page)); if (cp.x >= GET_BDA(video_cols) || cp.y > GET_BDA(video_rows) || GET_BDA(cursor_type) >= 0x2000) // Cursor not visible
Rework set_cursor_pos() to be slightly simpler.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- vgasrc/vgabios.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c index 2593e03..cfb6ba2 100644 --- a/vgasrc/vgabios.c +++ b/vgasrc/vgabios.c @@ -83,27 +83,19 @@ set_cursor_shape(u16 cursor_type) static void set_cursor_pos(struct cursorpos cp) { - u8 page = cp.page, x = cp.x, y = cp.y; - - // Should not happen... - if (page > 7) + if (cp.page > 7) + // Should not happen... return;
- vgafb_set_swcursor(0); - - // Bios cursor pos - SET_BDA(cursor_pos[page], (y << 8) | x); - - if (!CONFIG_VGA_STDVGA_PORTS) - return; - - // Set the hardware cursor - u8 current = GET_BDA(video_page); - if (cp.page != current) - return; + if (cp.page == GET_BDA(video_page)) { + // Update cursor in hardware + vgafb_set_swcursor(0); + if (CONFIG_VGA_STDVGA_PORTS) + stdvga_set_cursor_pos((int)text_address(cp)); + }
- // Calculate the memory address - stdvga_set_cursor_pos((int)text_address(cp)); + // Update BIOS cursor pos + SET_BDA(cursor_pos[cp.page], (cp.y << 8) | cp.x); }
struct cursorpos
On Mon, Jul 04, 2016 at 12:41:14PM -0400, Kevin O'Connor wrote:
The original "lgpl vgabios" had a special case for dh==0xff in its int1013 (write string) code. There does not appear to be any VGABIOS documentation supporting this as an externally available feature. It appears this was for its own internal use when writing its strings to the screen. SeaVGABIOS doesn't use this hack; this patch removes it from the code.
FYI, I committed this series.
-Kevin