Add experimental feature to run vga optionrom in parallel with init.
authorKevin O'Connor <kevin@koconnor.net>
Thu, 10 Dec 2009 01:18:31 +0000 (20:18 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 10 Dec 2009 01:18:31 +0000 (20:18 -0500)
Add option (default disabled) that allows the vga rom to run while
    hardware init is still in progress.

src/config.h
src/post.c

index 05f39421843fda9983ebb74a98d3275f4a6e7c7f..9c7c504e013be4b8d6fd0c99652b60f4796c323a 100644 (file)
@@ -24,6 +24,8 @@
 
 // Support running hardware initialization in parallel
 #define CONFIG_THREADS 1
+// Allow hardware init to run in parallel with optionrom execution
+#define CONFIG_THREAD_OPTIONROMS 0
 // Support int13 disk/floppy drive functions
 #define CONFIG_DRIVES 1
 // Support floppy drive access
 #define DEBUG_ISR_hwpic2 5
 #define DEBUG_HDL_pnp 1
 #define DEBUG_HDL_pmm 1
-#define DEBUG_thread 1
+#define DEBUG_thread 2
 
 #endif // config.h
index 085fb91d81df772150e67a0fab50df26596c6aa6..fd60236c8f214308089f556001d7814e5e34edc1 100644 (file)
@@ -182,10 +182,14 @@ post()
     pci_setup();
     smm_init();
 
-    // Run vga option rom.
+    // Setup interfaces that option roms may need
     pmm_setup();
     pnp_setup();
-    vga_setup();
+    init_bios_tables();
+
+    // Run vga option rom (if running synchronously)
+    if (!CONFIG_THREADS || !CONFIG_THREAD_OPTIONROMS)
+        vga_setup();
 
     // Initialize hardware devices
     usb_setup();
@@ -201,8 +205,10 @@ post()
     ata_setup();
     ramdisk_setup();
 
-    // Run option roms (non vga)
-    init_bios_tables();
+    // Run option roms
+    if (CONFIG_THREADS && CONFIG_THREAD_OPTIONROMS)
+        // Run vga option rom (if running asynchronously)
+        vga_setup();
     wait_threads();
     optionrom_setup();