Index: /trunk/src/VBox/Devices/PC/BIOS/ata.c
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/ata.c	(revision 78051)
+++ /trunk/src/VBox/Devices/PC/BIOS/ata.c	(revision 78052)
@@ -60,4 +60,6 @@
 #include "ebda.h"
 #include "ata.h"
+#include "pciutil.h"
+
 
 #if DEBUG_ATA
@@ -378,4 +380,20 @@
     uint8_t         buffer[0x0200];
     bio_dsk_t __far *bios_dsk;
+
+    /* If we have PCI support, look for an IDE controller (it has to be a PCI device)
+     * so that we can skip silly probing. If there's no PCI, assume IDE is present.
+     *
+     * Needs an internal PCI function because the Programming Interface byte can be
+     * almost anything, and we conly care about the base-class and sub-class code.
+     */
+#if VBOX_BIOS_CPU >= 80386
+    uint16_t        busdevfn;
+
+    busdevfn = pci_find_class_noif(0x0101);
+    if (busdevfn == 0xffff) {
+        BX_INFO("No PCI IDE controller, not probing IDE\n");
+        return;
+    }
+#endif
 
     bios_dsk = ebda_seg :> &EbdaData->bdisk;
Index: /trunk/src/VBox/Devices/PC/BIOS/biosint.h
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/biosint.h	(revision 78051)
+++ /trunk/src/VBox/Devices/PC/BIOS/biosint.h	(revision 78052)
@@ -291,4 +291,6 @@
 #define BX_PANIC(...)   bios_printf(BIOS_PRINTF_DEBHALT, __VA_ARGS__)
 
+uint16_t pci16_find_device(uint32_t search_item, uint16_t index, int search_class, int ignore_if);
+
 /* Because we don't tell the recompiler when guest physical memory
  * is written, it can incorrectly cache guest code overwritten by
Index: /trunk/src/VBox/Devices/PC/BIOS/pcibios.c
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/pcibios.c	(revision 78051)
+++ /trunk/src/VBox/Devices/PC/BIOS/pcibios.c	(revision 78052)
@@ -212,5 +212,7 @@
 
 /* Find a specified PCI device, either by vendor+device ID or class.
- * If index is non-zero, the n-th device will be located.
+ * If index is non-zero, the n-th device will be located. When searching
+ * by class, the ignore_if flag only compares the base and sub-class code,
+ * ignoring the programming interface code.
  *
  * Note: This function is somewhat performance critical; since it may
@@ -219,5 +221,5 @@
  * non-present devices.
  */
-uint16_t PCIxx(find_device)(uint32_t search_item, uint16_t index, int search_class)
+uint16_t PCIxx(find_device)(uint32_t search_item, uint16_t index, int search_class, int ignore_if)
 {
     uint32_t    data;
@@ -281,7 +283,10 @@
         found = 0;
 
-        /* Only 3 bytes are compared for class searches. */
+        /* Only 3 or even just 2 bytes are compared for class searches. */
         if (search_class)
-            data >>= 8;
+            if (ignore_if)
+                data >>= 16;
+            else
+                data >>= 8;
 
 #if 0
@@ -335,5 +340,5 @@
             SET_CF();
         } else {
-            device = PCIxx(find_device)(DX | (uint32_t)CX << 16, SI, 0);
+            device = PCIxx(find_device)(DX | (uint32_t)CX << 16, SI, 0, 0);
             if (device == BUSDEVFN_NOT_FOUND) {
                 SET_AH(DEVICE_NOT_FOUND);
@@ -345,5 +350,5 @@
         break;
     case FIND_PCI_CLASS_CODE:
-        device = PCIxx(find_device)(ECX, SI, 1);
+        device = PCIxx(find_device)(ECX, SI, 1, 0);
         if (device == BUSDEVFN_NOT_FOUND) {
             SET_AH(DEVICE_NOT_FOUND);
Index: /trunk/src/VBox/Devices/PC/BIOS/pciutil.c
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/pciutil.c	(revision 78051)
+++ /trunk/src/VBox/Devices/PC/BIOS/pciutil.c	(revision 78052)
@@ -135,4 +135,25 @@
 /**
  * Returns the bus/device/function of a PCI device with
+ * the given base and sub-class code, ignoring the programming interface
+ * code.
+ *
+ * @returns bus/device/fn in a 16-bit integer where
+ *          where the upper byte contains the bus number
+ *          and lower one the device and function number.
+ *          0xffff if no device was found.
+ * @param   dev_class   The PCI class code to search for.
+ */
+uint16_t pci_find_class_noif(uint16_t dev_class)
+{
+#if VBOX_BIOS_CPU >= 80386
+    /* Internal call, not an interrupt service! */
+    return pci16_find_device(dev_class, 0 /*index*/, 1 /*search class*/, 1 /*ignore prog if*/);
+#else
+    return UINT16_C(0xffff);
+#endif
+}
+
+/**
+ * Returns the bus/device/function of a PCI device with
  * the given vendor and device id.
  *
Index: /trunk/src/VBox/Devices/PC/BIOS/pciutil.h
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/pciutil.h	(revision 78051)
+++ /trunk/src/VBox/Devices/PC/BIOS/pciutil.h	(revision 78052)
@@ -33,4 +33,5 @@
 /* Warning: pci_write_config_dword destroys the high bits of ECX. */
 extern  void        pci_write_config_dword(uint8_t bus, uint8_t dev_fn, uint8_t reg, uint32_t val);
+extern  uint16_t    pci_find_class_noif(uint16_t dev_class);
 
 #endif /* !VBOX_INCLUDED_SRC_PC_BIOS_pciutil_h */
