diff options
author | Paulo Alcantara <pcacjr@zytor.com> | 2012-05-04 04:43:34 -0300 |
---|---|---|
committer | Paulo Alcantara <pcacjr@zytor.com> | 2012-05-12 00:56:22 -0300 |
commit | 124902bbde301d54bc4d4f89040222c75366c639 (patch) | |
tree | 9ad8bdd25d6cb6b5d06904e32cee34101c57043e | |
parent | 9a9334b4260328bce705c610e3a0bc92c71bdd60 (diff) | |
download | syslinux-124902bbde301d54bc4d4f89040222c75366c639.tar.gz syslinux-124902bbde301d54bc4d4f89040222c75366c639.tar.xz syslinux-124902bbde301d54bc4d4f89040222c75366c639.zip |
graphics: report video mode change from protected-mode code
Syslinux used to call __intcall() for calling routines of the old
COMBOOT API to report video mode change (INT 22h, AX=0x0017) that seemed
pointless, since INT 22h, AX=0x0017 does call the protected-mode
function pm_using_vga() already when calling INT 22h, AX=0x0017. So for
reporting video mode changes (VGA in this case) we must call
graphics_using_vga() instead for now.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
-rw-r--r-- | com32/mboot/initvesa.c | 19 | ||||
-rw-r--r-- | core/comboot.inc | 2 | ||||
-rw-r--r-- | core/extern.inc | 4 | ||||
-rw-r--r-- | core/graphics.c | 17 | ||||
-rw-r--r-- | core/include/graphics.h | 39 |
5 files changed, 61 insertions, 20 deletions
diff --git a/com32/mboot/initvesa.c b/com32/mboot/initvesa.c index cf2707df..bb3a8467 100644 --- a/com32/mboot/initvesa.c +++ b/com32/mboot/initvesa.c @@ -38,6 +38,7 @@ #include <stdlib.h> #include <string.h> #include <limits.h> +#include <graphics.h> #include "vesa.h" #include "mboot.h" @@ -211,16 +212,12 @@ void set_graphics_mode(const struct multiboot_header *mbh, mbi->vbe_interface_len = rm.ecx.w[0]; } - /* Tell syslinux we changed video mode */ - rm.eax.w[0] = 0x0017; /* Report video mode change */ /* In theory this should be: - - rm.ebx.w[0] = (mi->mode_attr & 4) ? 0x0007 : 0x000f; - - However, that would assume all systems that claim to handle text - output in VESA modes actually do that... */ - rm.ebx.w[0] = 0x000f; - rm.ecx.w[0] = vesa_info.mi.h_res; - rm.edx.w[0] = vesa_info.mi.v_res; - __intcall(0x22, &rm, NULL); + * + * UsingVga = (mi->mode_attr & 4) ? 0x0007 : 0x000f; + * + * However, that would assume all systems that claim to handle text + * output in VESA modes actually do that... + */ + graphics_using_vga(0x0F, vesa_info.mi.h_res, vesa_info.mi.v_res); } diff --git a/core/comboot.inc b/core/comboot.inc index 35cc91cf..83f0c030 100644 --- a/core/comboot.inc +++ b/core/comboot.inc @@ -654,7 +654,7 @@ comapi_usingvga: ja .error mov cx,P_CX mov dx,P_DX - pm_call pm_usingvga + pm_call pm_using_vga clc ret .error: diff --git a/core/extern.inc b/core/extern.inc index da3d894b..f6ec0aec 100644 --- a/core/extern.inc +++ b/core/extern.inc @@ -64,13 +64,13 @@ extern pm_writehex2, pm_writehex4, pm_writehex8 ; graphics.c - extern vgaclearmode, vgashowcursor, vgahidecursor + extern vgaclearmode, vgashowcursor, vgahidecursor, pm_using_vga ; conio.c extern pm_pollchar, pm_write_serial, pm_serialcfg ; font.c - extern pm_getchar, pm_adjust_screen, pm_usingvga, pm_userfont + extern pm_getchar, pm_adjust_screen, pm_userfont ; localboot.c extern pm_local_boot diff --git a/core/graphics.c b/core/graphics.c index 42ff6ec9..080efa11 100644 --- a/core/graphics.c +++ b/core/graphics.c @@ -354,12 +354,17 @@ void vgashowcursor(void) vgacursorcommon('_'); } -void pm_usingvga(com32sys_t *regs) +void using_vga(uint8_t vga, uint16_t pix_cols, uint16_t pix_rows) { - UsingVGA = regs->eax.b[0]; - GXPixCols = regs->ecx.w[0]; - GXPixRows = regs->edx.w[0]; + UsingVGA = vga; + GXPixCols = pix_cols; + GXPixRows = pix_rows; - if (!(UsingVGA & 0x08)) - adjust_screen(); + if (!(UsingVGA & 0x08)) + adjust_screen(); +} + +void pm_using_vga(com32sys_t *regs) +{ + using_vga(regs->eax.b[0], regs->ecx.w[0], regs->edx.w[0]); } diff --git a/core/include/graphics.h b/core/include/graphics.h new file mode 100644 index 00000000..0e4e005d --- /dev/null +++ b/core/include/graphics.h @@ -0,0 +1,39 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2012 Paulo Alcantara <pcacjr@zytor.com> + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall + * be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * ----------------------------------------------------------------------- */ + +#ifndef GRAPHICS_H_ +#define GRAPHICS_H_ + +extern void using_vga(uint8_t vga, uint16_t pix_cols, uint16_t pix_rows); + +static inline void graphics_using_vga(uint8_t vga, uint16_t pix_cols, + uint16_t pix_rows) +{ + using_vga(vga, pix_cols, pix_rows); +} + +#endif /* GRAPHICS_H_ */ |