Index: /trunk/src/VBox/Devices/PC/BIOS/orgs.asm
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/orgs.asm	(revision 75228)
+++ /trunk/src/VBox/Devices/PC/BIOS/orgs.asm	(revision 75229)
@@ -125,5 +125,4 @@
 extrn           _int15_function:near
 extrn           _int15_function_mouse:near
-extrn           _int15_function32:near
 extrn           _int16_function:near
 extrn           _int17_function:near
@@ -149,4 +148,5 @@
 endif
 if VBOX_BIOS_CPU ge 80386
+extrn           _int15_function32:near
 extrn           _apic_setup:near
 endif
@@ -1723,10 +1723,12 @@
                 push    es
                 C_SETUP
-                cmp     ah, 86h
-                je      int15_handler32
+if VBOX_BIOS_CPU ge 80386
+                ;; int15_function32 exists in 386+ BIOS only, but INT 15h is
+                ;; not 386-specific
                 cmp     ah, 0E8h
                 je      int15_handler32
                 cmp     ah, 0d0h
                 je      int15_handler32
+endif
                 DO_pusha
                 cmp     ah, 53h         ; APM function?
@@ -1738,5 +1740,7 @@
 int15_handler_popa_ret:
                 DO_popa
+if VBOX_BIOS_CPU ge 80386
 int15_handler32_ret:
+endif
                 pop     es
                 pop     ds
@@ -1752,6 +1756,6 @@
                 jmp     int15_handler_popa_ret
 
+if VBOX_BIOS_CPU ge 80386
 int15_handler32:
-if VBOX_BIOS_CPU ge 80386
                 ;; need to save/restore 32-bit registers
                 .386
@@ -1760,10 +1764,6 @@
                 popad
                 .286
-else
-                DO_pusha
-                call    _int15_function32
-                DO_popa
-endif
                 jmp     int15_handler32_ret
+endif
 
 ;;
Index: /trunk/src/VBox/Devices/PC/BIOS/system.c
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/system.c	(revision 75228)
+++ /trunk/src/VBox/Devices/PC/BIOS/system.c	(revision 75229)
@@ -71,6 +71,4 @@
 #define ACPI_DATA_SIZE    0x00010000L   /** @todo configurable? put elsewhere? */
 
-#define BX_CPU                  3
-
 extern  int pmode_IDT;
 extern  int rmode_IDT;
@@ -324,27 +322,4 @@
 
     return((oldval & 0x02) != 0);
-}
-
-typedef struct {
-    uint32_t    start;
-    uint32_t    xstart;
-    uint32_t    len;
-    uint32_t    xlen;
-    uint32_t    type;
-} mem_range_t;
-
-void set_e820_range(uint16_t ES, uint16_t DI, uint32_t start, uint32_t end,
-                    uint8_t extra_start, uint8_t extra_end, uint16_t type)
-{
-    mem_range_t __far   *range;
-
-    range = ES :> (mem_range_t *)DI;
-    range->start  = start;
-    range->xstart = extra_start;
-    end -= start;
-    extra_end -= extra_start;
-    range->len    = end;
-    range->xlen   = extra_end;
-    range->type   = type;
 }
 
@@ -428,8 +403,8 @@
     case 0x4f:
         /* keyboard intercept */
-#if BX_CPU < 2
+#if VBOX_BIOS_CPU >= 80286
+        // nop
+#else
         SET_AH(UNSUPPORTED_FUNCTION);
-#else
-        // nop
 #endif
         SET_CF();
@@ -478,10 +453,14 @@
         }
 
+    case 0x86:
+        // Wait for CX:DX microseconds. currently using the
+        // refresh request port 0x61 bit4, toggling every 15usec
+        int_enable();
+        timer_wait(((uint32_t)CX << 16) | DX);
+        break;
+
     case 0x88:
         // Get the amount of extended memory (above 1M)
-#if BX_CPU < 2
-        SET_AH(UNSUPPORTED_FUNCTION);
-        SET_CF();
-#else
+#if VBOX_BIOS_CPU >= 80286
         AX = (inb_cmos(0x31) << 8) | inb_cmos(0x30);
 
@@ -492,4 +471,7 @@
 
         CLEAR_CF();
+#else
+        SET_AH(UNSUPPORTED_FUNCTION);
+        SET_CF();
 #endif
         break;
@@ -588,4 +570,29 @@
 }
 
+#if VBOX_BIOS_CPU >= 80386
+
+typedef struct {
+    uint32_t    start;
+    uint32_t    xstart;
+    uint32_t    len;
+    uint32_t    xlen;
+    uint32_t    type;
+} mem_range_t;
+
+void set_e820_range(uint16_t reg_ES, uint16_t reg_DI, uint32_t start, uint32_t end,
+                    uint8_t extra_start, uint8_t extra_end, uint16_t type)
+{
+    mem_range_t __far   *range;
+
+    range = reg_ES :> (mem_range_t *)reg_DI;
+    range->start  = start;
+    range->xstart = extra_start;
+    end -= start;
+    extra_end -= extra_start;
+    range->len    = end;
+    range->xlen   = extra_end;
+    range->type   = type;
+}
+
 void BIOSCALL int15_function32(sys32_regs_t r)
 {
@@ -598,11 +605,4 @@
 
     switch (GET_AH()) {
-    case 0x86:
-        // Wait for CX:DX microseconds. currently using the
-        // refresh request port 0x61 bit4, toggling every 15usec
-        int_enable();
-        timer_wait(((uint32_t)CX << 16) | DX);
-        break;
-
     case 0xd0:
         if (GET_AL() != 0x4f)
@@ -840,4 +840,5 @@
     }
 }
+#endif  /* VBOX_BIOS_CPU >= 80386 */
 
 #if VBOX_BIOS_CPU >= 80286
@@ -930,3 +931,3 @@
     CLEAR_CF();
 }
-#endif
+#endif  /* VBOX_BIOS_CPU >= 80286 */
