From c0cda3c772530d0b8c275fb382b2fe9d0efd5536 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 13 Feb 2008 22:17:03 -0800 Subject: [PATCH] Set the window size to 2 GB for linear framebuffer Set the window size to 2 GB for linear framebuffer, lest the calculation: l = min(bytes, win_size-win_off); ... incorrectly returns zero when win_off == 0. --- com32/lib/sys/vesa/screencpy.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/com32/lib/sys/vesa/screencpy.c b/com32/lib/sys/vesa/screencpy.c index ac9b24e..779fe5d 100644 --- a/com32/lib/sys/vesa/screencpy.c +++ b/com32/lib/sys/vesa/screencpy.c @@ -56,8 +56,9 @@ void __vesacon_init_copy_to_screen(void) /* Linear frame buffer */ wi.win_base = (char *)mi->lfb_ptr; - wi.win_size = 0; /* 4 GB, i.e. one huge window */ + wi.win_size = 1 << 31; /* 2 GB, i.e. one huge window */ wi.win_pos = 0; /* Already positioned (only one position...) */ + wi.win_num = -1; /* Not a window */ } else { /* Paged frame buffer */ @@ -79,6 +80,9 @@ static void set_window_pos(size_t win_pos) { static com32sys_t ireg; + if (wi.win_num < 0) + return; + ireg.eax.w[0] = 0x4F05; ireg.ebx.b[0] = wi.win_num; ireg.edx.w[0] = win_pos >> wi.win_gshift; -- 2.7.4