diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-02-16 19:16:40 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-02-16 19:16:40 -0800 |
commit | 72b0648c5c2c53e84210589fa661f3296b4d0a4d (patch) | |
tree | d5a5415ee222652b5ac3fa8e40c0d56499261810 | |
parent | c35dd558caf455e47791b45adc557ad1998cd220 (diff) | |
download | syslinux-3.62-pre10.tar.gz |
VESA: work around bug in the Bochs VESA BIOSsyslinux-3.62-pre10
The Bochs VESA BIOS returns a value other than 1 for the number of
banks in unbanked modes. Ignore the number of banks if bank_size == 0
(the spec says that for unbanked modes, banks == 1 && bank_size == 0;
for banked modes banks > 1 and bank_size != 0).
-rw-r--r-- | com32/lib/sys/vesa/initvesa.c | 18 | ||||
-rw-r--r-- | com32/lib/sys/vesa/vesa.h | 2 |
2 files changed, 15 insertions, 5 deletions
diff --git a/com32/lib/sys/vesa/initvesa.c b/com32/lib/sys/vesa/initvesa.c index 0ad882b0..7032bb94 100644 --- a/com32/lib/sys/vesa/initvesa.c +++ b/com32/lib/sys/vesa/initvesa.c @@ -164,13 +164,23 @@ static int vesacon_set_mode(void) continue; /* We don't support multibank (interlaced memory) modes */ - if ( mi->banks > 1 ) + /* + * Note: The Bochs VESA BIOS (vbe.c 1.58 2006/08/19) violates the + * specification which states that banks == 1 for unbanked modes; + * fortunately it does report bank_size == 0 for those. + */ + if ( mi->banks > 1 && mi->bank_size ) { + debug("bad: banks = %d, banksize = %d, pages = %d\r\n", + mi->banks, mi->bank_size, mi->image_pages); continue; + } /* Must be either a flat-framebuffer mode, or be an acceptable paged mode */ - if ( !(mi->mode_attr & 0x0080) && !vesacon_paged_mode_ok(mi) ) + if ( !(mi->mode_attr & 0x0080) && !vesacon_paged_mode_ok(mi) ) { + debug("bad: invalid paged mode\r\n"); continue; + } /* Must either be a packed-pixel mode or a direct color mode (depending on VESA version ); must be a supported pixel format */ @@ -198,7 +208,7 @@ static int vesacon_set_mode(void) pxf = PXF_LE_RGB15_555; if (pxf < bestpxf) { - debug("Best mode so far, pxf = %d\n", pxf); + debug("Best mode so far, pxf = %d\r\n", pxf); /* Best mode so far... */ bestmode = mode; @@ -302,7 +312,7 @@ int __vesacon_init(void) init_text_display(); - debug("Mode set, now drawing at %#p\n", __vesa_info.mi.lfb_ptr); + debug("Mode set, now drawing at %#p\r\n", __vesa_info.mi.lfb_ptr); __vesacon_init_background(); diff --git a/com32/lib/sys/vesa/vesa.h b/com32/lib/sys/vesa/vesa.h index 58f9ba42..e67a3108 100644 --- a/com32/lib/sys/vesa/vesa.h +++ b/com32/lib/sys/vesa/vesa.h @@ -70,7 +70,7 @@ struct vesa_mode_info { uint8_t banks; uint8_t memory_layout; uint8_t bank_size; - uint8_t image_planes; + uint8_t image_pages; uint8_t page_function; uint8_t rmask; |