Be sure to disable bootsplash on all BIOS boot cases.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 27 Jul 2010 03:47:26 +0000 (23:47 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 27 Jul 2010 03:47:26 +0000 (23:47 -0400)
Disable the bootsplash on cbfs payload exec, and if something hooks
int19.

Also, be sure to only disable the bootsplash (revert to text mode)
once.

src/biosvar.h
src/boot.c
src/bootsplash.c
src/post.c

index dce35af24aecfb6eeb1da9ef1f464fa5a9450162..df0df0eba47939723f4be69e480ed4408ff6cd27 100644 (file)
@@ -1,6 +1,6 @@
 // Variable layouts of bios.
 //
-// Copyright (C) 2008,2009  Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2008-2010  Kevin O'Connor <kevin@koconnor.net>
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 #ifndef __BIOSVAR_H
@@ -216,6 +216,7 @@ struct extended_bios_data_area_s {
     u8 other2[0xC4];
 
     // 0x121 - Begin custom storage.
+    u8 bootsplash_active;
     u8 ps2ctr;
     struct usbkeyinfo usbkey_last;
 
index 814dee128b8d6e5c069a33371a4d7777d4ee24f6..44964a7070e0c972becabe58b1a9dba1c75c1094 100644 (file)
@@ -1,6 +1,6 @@
 // Code to load disk image and start system boot.
 //
-// Copyright (C) 2008  Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2008-2010  Kevin O'Connor <kevin@koconnor.net>
 // Copyright (C) 2002  MandrakeSoft S.A.
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
@@ -343,11 +343,10 @@ boot_prep(void)
 static void
 call_boot_entry(u16 bootseg, u16 bootip, u8 bootdrv)
 {
-    dprintf(1, "Booting from %04x:%04x\n", bootseg, bootip);
-
     /* Go back to text, the OS might expect it... (Can't do this any later) */
     disable_bootsplash();
 
+    dprintf(1, "Booting from %04x:%04x\n", bootseg, bootip);
     struct bregs br;
     memset(&br, 0, sizeof(br));
     br.flags = F_IF;
@@ -431,6 +430,7 @@ boot_cbfs(struct ipl_entry_s *ie)
             return;
         if (count--)
             continue;
+        disable_bootsplash();
         cbfs_run_payload(file);
     }
 }
@@ -462,7 +462,7 @@ do_boot(u16 seq_nr)
     printf("Booting from %s...\n"
            , strtcpy(desc, ie->description, ARRAY_SIZE(desc)));
 
-    switch(ie->type) {
+    switch (ie->type) {
     case IPL_TYPE_FLOPPY:
         boot_disk(0x00, IPL.checkfloppysig);
         break;
index b96e0666df86bcf50274ba8dff48ecf479525c65..9ff81b376e463a02d33c6daab6f8a64429b0e0df 100644 (file)
@@ -10,6 +10,7 @@
 #include "config.h" // CONFIG_*
 #include "util.h" // dprintf
 #include "jpeg.h" // splash
+#include "biosvar.h" // SET_EBDA
 
 
 /****************************************************************
@@ -99,7 +100,7 @@ static void enable_vga_text_console(void)
     call16_int10(&br);
 
     // Write to screen.
-    printf("Starting SeaBIOS (version %s)\n\n", VERSION);
+    printf("SeaBIOS (version %s)\n\n", VERSION);
 }
 
 void enable_vga_console(void)
@@ -181,7 +182,7 @@ void enable_vga_console(void)
     dprintf(8, "bytes per scanline: %d\n", mode_info->bytes_per_scanline);
     dprintf(8, "bits per pixel: %d\n", mode_info->bits_per_pixel);
 
-    /* Look for bootsplash.jpg in CBFS and decompress it... */
+    /* Decompress jpeg */
     dprintf(8, "Copying boot splash screen...\n");
     cbfs_copyfile(file, jpeg, filesize);
     dprintf(8, "Decompressing boot splash screen...\n");
@@ -194,6 +195,7 @@ void enable_vga_console(void)
 
     /* Show the picture */
     iomemcpy(framebuffer, picture, imagesize);
+    SET_EBDA(bootsplash_active, 1);
 
 cleanup:
     free(jpeg);
@@ -210,7 +212,8 @@ gotext:
 void
 disable_bootsplash(void)
 {
-    if (! CONFIG_BOOTSPLASH)
+    if (! CONFIG_BOOTSPLASH || !GET_EBDA(bootsplash_active))
         return;
+    SET_EBDA(bootsplash_active, 0);
     enable_vga_text_console();
 }
index fc7acc585c1814a231e0a672d2957d44441980d2..0cb9e575877aedb455b5f52607b2f738a8d0ba4f 100644 (file)
@@ -1,6 +1,6 @@
 // 32bit code to Power On Self Test (POST) a machine.
 //
-// Copyright (C) 2008,2009  Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2008-2010  Kevin O'Connor <kevin@koconnor.net>
 // Copyright (C) 2002  MandrakeSoft S.A.
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
@@ -276,6 +276,12 @@ _start(void)
     // Write protect bios memory.
     make_bios_readonly();
 
+    // Disable bootsplash if something has hooked int19.
+    extern void entry_19_official(void);
+    if (GET_IVT(0x19).segoff
+        != SEGOFF(SEG_BIOS, (u32)entry_19_official - BUILD_BIOS_ADDR).segoff)
+        disable_bootsplash();
+
     // Invoke int 19 to start boot process.
     dprintf(3, "Jump to int19\n");
     struct bregs br;