Although the VBE3 spec says there is 189 bytes of pad at the end of the vbe_info struct, the spec also says the total struct size should be 256 bytes. The VBE2 spec uses sufficient pad to get to 256 bytes. So, assume the spec was off by one and make the pad 190 bytes.
Also, use u32 for capabilities and 'struct segoff_s' for win_func_ptr.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/vbe.h | 6 +++--- vgasrc/vga.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/vbe.h b/src/vbe.h index bfcd6b4..386613c 100644 --- a/src/vbe.h +++ b/src/vbe.h @@ -11,7 +11,7 @@ struct vbe_info { u32 signature; u16 version; struct segoff_s oem_string; - u8 capabilities[4]; + u32 capabilities; struct segoff_s video_mode; u16 total_memory; u16 oem_revision; @@ -30,7 +30,7 @@ struct vbe_mode_info { u16 win_size; u16 winA_seg; u16 winB_seg; - u32 win_func_ptr; + struct segoff_s win_func_ptr; u16 bytes_per_scanline; /* VBE 1.2 */ u16 xres; @@ -71,7 +71,7 @@ struct vbe_mode_info { u8 linear_alpha_size; u8 linear_alpha_pos; u32 pixclock_max; - u8 reserved[189]; + u8 reserved[190]; } PACKED;
struct vbe_crtc_info { diff --git a/vgasrc/vga.c b/vgasrc/vga.c index 37f227c..539cd7a 100644 --- a/vgasrc/vga.c +++ b/vgasrc/vga.c @@ -1226,7 +1226,7 @@ handle_104f00(struct bregs *regs)
SET_FARVAR(seg, info->oem_string, SEGOFF(get_global_seg(), (u32)VBE_OEM_STRING)); - SET_FARVAR(seg, info->capabilities[0], 0x1); /* 8BIT DAC */ + SET_FARVAR(seg, info->capabilities, 0x1); /* 8BIT DAC */
/* We generate our mode list in the reserved field of the info block */ SET_FARVAR(seg, info->video_mode, SEGOFF(seg, regs->di + 34)); @@ -1284,7 +1284,7 @@ handle_104f01(struct bregs *regs) SET_FARVAR(seg, info->win_size, 64); /* Bank size 64K */ SET_FARVAR(seg, info->winA_seg, 0xA000); SET_FARVAR(seg, info->winB_seg, 0x0); - SET_FARVAR(seg, info->win_func_ptr, 0x0); + SET_FARVAR(seg, info->win_func_ptr.segoff, 0x0); SET_FARVAR(seg, info->bytes_per_scanline, modeinfo.linesize); SET_FARVAR(seg, info->xres, modeinfo.width); SET_FARVAR(seg, info->yres, modeinfo.height);