[SeaBIOS] [PATCH 6/6] Cleanup bootsplash vesa signature detection.

Kevin O'Connor kevin at koconnor.net
Tue Jul 27 06:24:35 CEST 2010


---
 src/bootsplash.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/bootsplash.c b/src/bootsplash.c
index 9ff81b3..ed10415 100644
--- a/src/bootsplash.c
+++ b/src/bootsplash.c
@@ -19,7 +19,7 @@
 
 struct vesa_info
 {
-    u8 vesa_signature[4];
+    u32 vesa_signature;
     u16 vesa_version;
     struct segoff_s oem_string_ptr;
     u8 capabilities[4];
@@ -33,6 +33,9 @@ struct vesa_info
     u8 oem_data[256];
 } PACKED;
 
+#define VESA_SIGNATURE 0x41534556 // VESA
+#define VBE2_SIGNATURE 0x32454256 // VBE2
+
 struct vesa_mode_info
 {
     u16 mode_attributes;
@@ -132,16 +135,14 @@ void enable_vga_console(void)
 
     /* Check whether we have a VESA 2.0 compliant BIOS */
     memset(vesa_info, 0, sizeof(struct vesa_info));
-    memcpy(vesa_info, "VBE2", 4);
-
+    vesa_info->vesa_signature = VBE2_SIGNATURE;
     struct bregs br;
     memset(&br, 0, sizeof(br));
     br.ax = 0x4f00;
     br.di = FLATPTR_TO_OFFSET(vesa_info);
     br.es = FLATPTR_TO_SEG(vesa_info);
     call16_int10(&br);
-
-    if (strcmp("VESA", (char *)vesa_info) != 0) {
+    if (vesa_info->vesa_signature != VESA_SIGNATURE) {
         dprintf(1,"No VBE2 found.\n");
         goto gotext;
     }
-- 
1.7.1.1




More information about the SeaBIOS mailing list