[SeaBIOS] [PATCH 2/2] vgabios: Limit the range of the VBE number of "pages" parameter.

Kevin O'Connor kevin at koconnor.net
Fri Sep 13 22:24:45 CEST 2013


Looking at the output of other VGA BIOS implementations, it appears
that the number of available video pages reported is always between 1
and 127.

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 vgasrc/vbe.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vgasrc/vbe.c b/vgasrc/vbe.c
index d962333..2c08736 100644
--- a/vgasrc/vbe.c
+++ b/vgasrc/vbe.c
@@ -144,6 +144,10 @@ vbe_104f01(struct bregs *regs)
             mode_attr |= VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE;
         break;
     }
+    if (pages > 128)
+        pages = 128;
+    if (pages < 2)
+        pages++;
     SET_FARVAR(seg, info->mode_attributes, mode_attr);
     SET_FARVAR(seg, info->planes, planes);
     SET_FARVAR(seg, info->pages, pages - 1);
-- 
1.8.3.1




More information about the SeaBIOS mailing list