Index: /trunk/src/VBox/Devices/BiosCommonCode/biosorg_check.sed
===================================================================
--- /trunk/src/VBox/Devices/BiosCommonCode/biosorg_check.sed	(revision 60432)
+++ /trunk/src/VBox/Devices/BiosCommonCode/biosorg_check.sed	(revision 60433)
@@ -18,10 +18,172 @@
 
 
-/biosorg_check_/!b end  
+/biosorg_check_at_/b check_at
+/biosorg_check_before_or_at_/b check_before_or_at
+b end
+
+:check_at
+#p # --debug
 s/\(.*\)/\L\1/g
-s/f000:\(....\). *biosorg_check_0\(\1\)h *//
+s/....:\(....\). *biosorg_check_at_0\(\1\)h *//
 /^$/b end
+q 1
+b end
+
+# after or equal.
+:check_before_or_at
+#p # --debug
+s/\(.*\)/\L\1/g
+
+h
+s/^....:\(....\). *biosorg_check_before_or_at_0\(....\)h */\2/
+x
+s/^....:\(....\)/\1 /
+
+
+# Loop for comparing the two addresses.  The one in the pattern buffer (left) must be 
+# smaller or equal to the one in in the pattern buffer (BIOSORG address).
+:compare_loop
+/^f/b match_f_or_greater
+/^e/b match_e_or_greater
+/^d/b match_d_or_greater
+/^c/b match_c_or_greater
+/^b/b match_b_or_greater
+/^a/b match_a_or_greater
+/^9/b match_9_or_greater
+/^8/b match_8_or_greater
+/^7/b match_7_or_greater
+/^6/b match_6_or_greater
+/^5/b match_5_or_greater
+/^4/b match_4_or_greater
+/^3/b match_3_or_greater
+/^2/b match_2_or_greater
+/^1/b match_1_or_greater
+/^0/b match_0_or_greater
+:bad
+p
+x
 p
 q 1
+b end
+
+:bad_other
+x
+b bad
+
+
+:match_f_or_greater
+x
+/^f/b next_compare
+b bad_other
+
+:match_e_or_greater
+x
+/^f/b end
+/^e/b next_compare
+b bad_other
+
+:match_d_or_greater
+x
+/^[e-f]/b end
+/^d/b next_compare
+b bad_other
+
+:match_c_or_greater
+x
+/^[d-f]/b end
+/^c/b next_compare
+b bad_other
+
+:match_b_or_greater
+x
+/^[c-f]/b end
+/^b/b next_compare
+b bad_other
+
+:match_a_or_greater
+x
+/^[b-f]/b end
+/^a/b next_compare
+b bad_other
+
+:match_9_or_greater
+x
+/^[a-f]/b end
+/^9/b next_compare
+b bad_other
+
+:match_8_or_greater
+x
+/^[9a-f]/b end
+/^8/b next_compare
+b bad_other
+
+:match_7_or_greater
+x
+/^[8-9a-f]/b end
+/^7/b next_compare
+b bad_other
+
+:match_6_or_greater
+x
+/^[7-9a-f]/b end
+/^6/b next_compare
+b bad_other
+
+:match_5_or_greater
+x
+/^[6-9a-f]/b end
+/^5/b next_compare
+b bad_other
+
+:match_4_or_greater
+x
+/^[5-9a-f]/b end
+/^4/b next_compare
+b bad_other
+
+:match_3_or_greater
+x
+/^[4-9a-f]/b end
+/^3/b next_compare
+b bad_other
+
+:match_2_or_greater
+x
+/^[3-9a-f]/b end
+/^2/b next_compare
+b bad_other
+
+:match_1_or_greater
+x
+/^[2-9a-f]/b end
+/^1/b next_compare
+b bad_other
+
+:match_0_or_greater
+x
+/^[1-9a-f]/b end
+/^0/b next_compare
+b bad_other
+
+
+# Next round of the loop. 
+# 1. Drop the leading digit of the max address (BIOSORG).
+# 2. Check if we've reached end of the address. If so, check that we've reached the space in the actual address.
+# 3. Switch buffers so the actual address in the pattern space.
+# 4. Drop the leading digit of the actual address.
+# 5. Repeat.
+:next_compare
+s/^.//
+/^$/b end_of_compare
+x
+s/^.//
+b compare_loop
+
+:end_of_compare
+x
+/^. /b end
+b bad
+
 :end
 
Index: /trunk/src/VBox/Devices/BiosCommonCode/commondefs.inc
===================================================================
--- /trunk/src/VBox/Devices/BiosCommonCode/commondefs.inc	(revision 60432)
+++ /trunk/src/VBox/Devices/BiosCommonCode/commondefs.inc	(revision 60433)
@@ -119,7 +119,14 @@
 
 ;; Adds a special label that will have its address checked after linking.
-BIOSORG_CHECK macro	addr
-public		biosorg_check_&addr
-biosorg_check_&addr:
+BIOSORG_CHECK macro addr
+public biosorg_check_at_&addr
+biosorg_check_at_&addr:
 		endm
 
+;; Adds a special label that will have its address checked after linking.
+BIOSORG_CHECK_BEFORE macro addr
+public	biosorg_check_before_or_at_&addr
+biosorg_check_before_or_at_&addr:
+		endm
+
+
Index: /trunk/src/VBox/Devices/PC/BIOS/ata.c
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/ata.c	(revision 60432)
+++ /trunk/src/VBox/Devices/PC/BIOS/ata.c	(revision 60433)
@@ -475,5 +475,9 @@
 
             removable = (*(buffer+0) & 0x80) ? 1 : 0;
+#if VBOX_BIOS_CPU >= 80386
             mode      = *(buffer+96) ? ATA_MODE_PIO32 : ATA_MODE_PIO16;
+#else
+            mode      = ATA_MODE_PIO16;
+#endif
             blksize   = 512;  /* There is no sector size field any more. */
 
@@ -572,5 +576,9 @@
             type      = *(buffer+1) & 0x1f;
             removable = (*(buffer+0) & 0x80) ? 1 : 0;
+#if VBOX_BIOS_CPU >= 80386
             mode      = *(buffer+96) ? ATA_MODE_PIO32 : ATA_MODE_PIO16;
+#else
+            mode      = ATA_MODE_PIO16;
+#endif
             blksize   = 2048;
 
Index: /trunk/src/VBox/Devices/PC/BIOS/ata.h
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/ata.h	(revision 60432)
+++ /trunk/src/VBox/Devices/PC/BIOS/ata.h	(revision 60433)
@@ -50,5 +50,7 @@
 #define ATA_MODE_NONE    0x00
 #define ATA_MODE_PIO16   0x00
-#define ATA_MODE_PIO32   0x01
+#if VBOX_BIOS_CPU >= 80386
+# define ATA_MODE_PIO32  0x01
+#endif
 #define ATA_MODE_ISADMA  0x02
 #define ATA_MODE_PCIDMA  0x03
Index: /trunk/src/VBox/Devices/PC/BIOS/disk.c
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/disk.c	(revision 60432)
+++ /trunk/src/VBox/Devices/PC/BIOS/disk.c	(revision 60433)
@@ -487,5 +487,7 @@
             options  = (translation == GEO_TRANSLATION_NONE ? 0 : 1 << 3);  // chs translation
             options |= (1 << 4);    // lba translation
+#if VBOX_BIOS_CPU >= 80386
             options |= (mode == ATA_MODE_PIO32 ? 1 : 0 << 7);
+#endif
             options |= (translation == GEO_TRANSLATION_LBA ? 1 : 0 << 9);
             options |= (translation == GEO_TRANSLATION_RECHS ? 3 : 0 << 9);
Index: /trunk/src/VBox/Devices/PC/BIOS/eltorito.c
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/eltorito.c	(revision 60432)
+++ /trunk/src/VBox/Devices/PC/BIOS/eltorito.c	(revision 60433)
@@ -921,5 +921,7 @@
             options |= (1<<5); // removable device
             options |= (1<<6); // atapi device
+#if VBOX_BIOS_CPU >= 80386
             options |= (mode==ATA_MODE_PIO32?1:0<<7);
+#endif
 
             bios_dsk->dpte.iobase1  = iobase1;
Index: /trunk/src/VBox/Devices/PC/BIOS/logo.c
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/logo.c	(revision 60432)
+++ /trunk/src/VBox/Devices/PC/BIOS/logo.c	(revision 60433)
@@ -116,5 +116,6 @@
  */
 void wait_uninit(void);
-#pragma aux wait_uninit =   \
+#if VBOX_BIOS_CPU >= 80386
+# pragma aux wait_uninit =   \
     ".386"                  \
     "mov    al, 34h"        \
@@ -130,4 +131,19 @@
     "popad"                 \
     modify [ax] nomemory;
+#else
+# pragma aux wait_uninit = \
+    "mov    al, 34h" \
+    "out    43h, al" \
+    "xor    ax, ax" \
+    "out    40h, al" \
+    "out    40h, al" \
+    "push   bp" \
+    "push   ds" \
+    "mov    ds, ax" \
+    "call   rtc_post" \
+    "pop    ds" \
+    "pop    bp" \
+    modify [ax bx cx dx si di];
+#endif
 
 
@@ -331,5 +347,5 @@
 
 
-    // Set PIT to 1ms ticks
+    // Set PIT to 64hz.
     wait_init();
 
Index: /trunk/src/VBox/Devices/PC/BIOS/orgs.asm
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/orgs.asm	(revision 60432)
+++ /trunk/src/VBox/Devices/PC/BIOS/orgs.asm	(revision 60433)
@@ -74,5 +74,7 @@
 
 ;; Set a fixed BIOS location, with a marker for verification
-BIOSORG		macro	addr
+BIOSORG		macro	addr, addr_minus_two
+.errnz (addr - 2 - addr_minus_two) ;; Couldn't convince wasm to accept $ here. Would've save us a lot of bother and ugly SED.
+		BIOSORG_CHECK_BEFORE addr_minus_two
 		org	addr - BIOS_FIX_BASE - 2
 		db	'XM'
@@ -204,5 +206,5 @@
 ;; Start of fixed code - eoi_jmp_post is kept near here to allow short jumps.
 ;;
-		BIOSORG	0E030h
+		BIOSORG	0E030h, 0E02Eh
 eoi_both_pics:
 		mov	al, PIC_CMD_EOI
@@ -236,5 +238,5 @@
 ;; POST entry point
 ;; --------------------------------------------------------
-		BIOSORG	0E05Bh
+		BIOSORG	0E05Bh, 0E059h
 post:
 		cli
@@ -426,5 +428,5 @@
 
 		;; Initialize PCI devices. This can and should be done early.
-if VBOX_BIOS_CPU ge 80386
+if VBOX_BIOS_CPU ge 80386 ; (Impossible to do on 16-bit CPUs.)
 		call	pcibios_init_iomem_bases
 		call	pcibios_init_irqs
@@ -532,5 +534,5 @@
 ;; NMI handler
 ;; --------------------------------------------------------
-		BIOSORG	0E2C3h
+		BIOSORG	0E2C3h, 0E2C1h
 nmi:
 		C_SETUP
@@ -660,5 +662,5 @@
 ;; INT 13h handler - Disk services
 ;; --------------------------------------------------------
-		BIOSORG	0E3FEh
+		BIOSORG	0E3FEh, 0E3FCh
 
 int13_handler:
@@ -676,5 +678,5 @@
 ;; INT 19h handler - Boot load service
 ;; --------------------------------------------------------
-		BIOSORG	0E6F2h
+		BIOSORG	0E6F2h, 0E6F0h
 
 int19_handler:
@@ -744,5 +746,5 @@
 ;; Baud Rate Generator Table
 ;; --------------------------------------------------------
-		BIOSORG	0E729h
+		BIOSORG	0E729h, 0E727h
 
 
@@ -750,5 +752,5 @@
 ;; INT 14h handler -  Serial Communication Service
 ;; --------------------------------------------------------
-		BIOSORG	0E739h
+		BIOSORG	0E739h, 0E737h
 int14_handler:
 		push	ds
@@ -826,5 +828,5 @@
 ;; INT 16h handler - Keyboard service
 ;; --------------------------------------------------------
-		BIOSORG	0E82Eh
+		BIOSORG	0E82Eh, 0E82Ch
 int16_handler:
 		sti
@@ -898,5 +900,5 @@
 ;; INT 09h handler - Keyboard ISR (IRQ 1)
 ;; --------------------------------------------------------
-		BIOSORG	0E987h
+		BIOSORG	0E987h, 0E985h
 int09_handler:
 		cli			; TODO: why? they're off already!
@@ -976,5 +978,5 @@
 ;; INT 13h handler - Diskette service
 ;; --------------------------------------------------------
-		BIOSORG	0EC59h
+		BIOSORG	0EC59h, 0EC57h
 int13_diskette:
 		jmp	int13_noeltorito
@@ -1297,8 +1299,4 @@
                jnz	rtc_pos_hour_loop
 
-
-		mov	ax, [46Ch]
-		mov	dx, [46Ch+2]
-
 rtc_pos_shift:
 		mov	cl, ch
@@ -1365,5 +1363,5 @@
 ;; INT 0Eh handler - Diskette IRQ 6 ISR
 ;; --------------------------------------------------------
-		BIOSORG	0EF57h
+		BIOSORG	0EF57h, 0EF55h
 int0e_handler:
 		push	ax
@@ -1409,5 +1407,5 @@
 ;; Diskette Parameter Table
 ;; --------------------------------------------------------
-		BIOSORG	0EFC7h
+		BIOSORG	0EFC7h, 0EFC5h
 _diskette_param_table:
 		db	0AFh
@@ -1483,5 +1481,5 @@
 ;; INT 10h functions 0-Fh entry point
 ;; --------------------------------------------------------
-		BIOSORG 0F045h
+		BIOSORG 0F045h, 0F043h
 i10f0f_entry:
 		iret
@@ -1491,5 +1489,5 @@
 ;; INT 10h handler - MDA/CGA video
 ;; --------------------------------------------------------
-		BIOSORG 0F065h
+		BIOSORG 0F065h, 0F063h
 int10_handler:
 		;; do nothing - assumes VGA
@@ -1500,5 +1498,5 @@
 ;; MDA/CGA Video Parameter Table (INT 1Dh)
 ;; --------------------------------------------------------
-		BIOSORG 0F0A4h
+		BIOSORG 0F0A4h, 0F0A2h
 mdacga_vpt:
 
@@ -1614,5 +1612,5 @@
 ;; INT 12h handler - Memory size
 ;; --------------------------------------------------------
-		BIOSORG	0F841h
+		BIOSORG	0F841h, 0F83Fh
 int12_handler:
 		;; Don't touch - fixed size!
@@ -1765,5 +1763,5 @@
 ;; 8x8 font (first 128 characters)
 ;; --------------------------------------------------------
-		BIOSORG	0FA6Eh
+		BIOSORG	0FA6Eh, 0FA6Ch
 include font8x8.inc
 
@@ -1818,9 +1816,26 @@
 		iret
 
+if VBOX_BIOS_CPU lt 80386
+;
+; We're tight on space down below in the int08_handler, so put
+; the 16-bit rollover code here.
+;
+int08_maybe_rollover:
+               ja	int08_rollover
+		cmp	ax, 00B0h
+               jb	int08_store_ticks
+		;; there has been a midnight rollover
+int08_rollover:
+		xor	dx, dx
+		xor	ax, ax
+
+		inc	byte ptr ds:[70h]	; increment rollover flag
+		jmp	int08_store_ticks
+endif
 
 ;; --------------------------------------------------------
 ;; Timer tick - IRQ 0 handler
 ;; --------------------------------------------------------
-		BIOSORG	0FEA5h
+		BIOSORG	0FEA5h, 0FEA3h
 int08_handler:
 if VBOX_BIOS_CPU ge 80386
@@ -1831,5 +1846,4 @@
 		sti
 		push	ax
-		push	bx
 endif
 		push	ds
@@ -1843,7 +1857,9 @@
 else
 		mov	ax, ds:[6Ch]	; get ticks dword
-               mov     bx, ds:[6Ch+2]
-		add	ax, 1
-               adc	bx, 0
+               mov     dx, ds:[6Ch+2]
+               inc	ax		; inc+jz+inc saves two bytes over add+adc.
+               jnz	int08_compare
+               inc	dx
+int08_compare:
 endif
 
@@ -1851,27 +1867,21 @@
 if VBOX_BIOS_CPU ge 80386
 		cmp	eax, 1800B0h
+               jb	int08_store_ticks
 else
-		cmp	bx, 18h
-               jb	int08_store_ticks
-               ja	int08_rollover
-               cmp	ax, 00B0h
-endif
-		jb	int08_store_ticks
+		cmp	dx, 18h
+               jae	int08_maybe_rollover
+endif
+
+if VBOX_BIOS_CPU ge 80386
 		;; there has been a midnight rollover
-int08_rollover:
-if VBOX_BIOS_CPU ge 80386
 		xor	eax, eax
-else
-		xor	ax, ax
-		xor	bx, bx
-endif
 		inc	byte ptr ds:[70h]	; increment rollover flag
 
 int08_store_ticks:
-if VBOX_BIOS_CPU ge 80386
 		mov	ds:[6Ch], eax
 else
+int08_store_ticks:
 		mov	ds:[6Ch], ax
-		mov	ds:[6Ch+2], bx
+		mov	ds:[6Ch+2], dx
 endif
 
@@ -1900,5 +1910,4 @@
 		.286
 else
-		pop     bx
 		pop     ax
 endif
@@ -1909,5 +1918,5 @@
 ;; Initial interrupt vector offsets for POST
 ;; --------------------------------------------------------
-		BIOSORG	0FEF3h
+		BIOSORG	0FEF3h, 0FEF1h
 vector_table:
 
@@ -1917,5 +1926,5 @@
 ;; BIOS copyright string
 ;; --------------------------------------------------------
-		BIOSORG	0FF00h
+		BIOSORG	0FF00h, 0FEFEh
 bios_string:
 		db	BIOS_COPYRIGHT
@@ -1925,5 +1934,5 @@
 ;; IRET - default interrupt handler
 ;; --------------------------------------------------------
-		BIOSORG	0FF53h
+		BIOSORG	0FF53h, 0FF51h
 
 dummy_iret:
@@ -1944,5 +1953,5 @@
 ;; Processor reset entry point
 ;; --------------------------------------------------------
-		BIOSORG	0FFF0h
+		BIOSORG	0FFF0h, 0FFEEh
 cpu_reset:
 		;; This is where the CPU starts executing after a reset
Index: /trunk/src/VBox/Devices/PC/BIOS/pciutil.c
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/pciutil.c	(revision 60432)
+++ /trunk/src/VBox/Devices/PC/BIOS/pciutil.c	(revision 60433)
@@ -45,7 +45,8 @@
 
 
+#if VBOX_BIOS_CPU >= 80386
 /* Warning: Destroys high bits of ECX. */
 uint16_t pci_find_class(uint16_t op, uint32_t dev_class, uint16_t start_bdf);
-#pragma aux pci_find_class =    \
+# pragma aux pci_find_class =    \
     ".386"                  \
     "shl    ecx, 16"        \
@@ -57,4 +58,5 @@
     "found:"                \
     parm [ax] [cx dx] [si] value [bx];
+#endif
 
 uint16_t pci_find_dev(uint16_t op, uint16_t dev_id, uint16_t ven_id, uint16_t start_bdf);
@@ -77,7 +79,8 @@
     parm [ax] [bx] [di] value [cx];
 
+#if VBOX_BIOS_CPU >= 80386
 /* Warning: Destroys high bits of ECX. */
 uint32_t pci_read_cfgd(uint16_t op, uint16_t bus_dev_fn, uint16_t reg);
-#pragma aux pci_read_cfgd = \
+# pragma aux pci_read_cfgd = \
     ".386"                  \
     "int    0x1a"           \
@@ -85,4 +88,5 @@
     "shr    ecx, 16"        \
     parm [ax] [bx] [di] value [cx ax];
+#endif
 
 uint8_t pci_write_cfgb(uint16_t op, uint16_t bus_dev_fn, uint16_t reg, uint8_t val);
@@ -96,7 +100,8 @@
     parm [ax] [bx] [di] [cx];
 
+#if VBOX_BIOS_CPU >= 80386
 /* Warning: Destroys high bits of ECX. */
 uint8_t pci_write_cfgd(uint16_t op, uint16_t bus_dev_fn, uint16_t reg, uint32_t val);
-#pragma aux pci_write_cfgd = \
+# pragma aux pci_write_cfgd = \
     ".386"                  \
     "xchg   cx, dx"         \
@@ -105,4 +110,5 @@
     "int    0x1a"           \
     parm [ax] [bx] [di] [dx cx];
+#endif
 
 
@@ -119,5 +125,9 @@
 uint16_t pci_find_classcode(uint32_t dev_class)
 {
+#if VBOX_BIOS_CPU >= 80386
     return pci_find_class((PCIBIOS_ID << 8) | PCIBIOS_FIND_CLASS_CODE, dev_class, 0);
+#else
+    return UINT16_C(0xffff);
+#endif
 }
 
@@ -134,5 +144,10 @@
 uint32_t pci_read_config_dword(uint8_t bus, uint8_t dev_fn, uint8_t reg)
 {
+#if VBOX_BIOS_CPU >= 80386
     return pci_read_cfgd((PCIBIOS_ID << 8) | PCIBIOS_READ_CONFIG_DWORD, (bus << 8) | dev_fn, reg);
+#else
+    return pci_read_cfgw((PCIBIOS_ID << 8) | PCIBIOS_READ_CONFIG_WORD, (bus << 8) | dev_fn, reg)
+        || ((uint32_t)pci_read_cfgw((PCIBIOS_ID << 8) | PCIBIOS_READ_CONFIG_WORD, (bus << 8) | dev_fn, reg + 2) << 16);
+#endif
 }
 
Index: /trunk/src/VBox/Devices/PC/DevPcBios.cpp
===================================================================
--- /trunk/src/VBox/Devices/PC/DevPcBios.cpp	(revision 60432)
+++ /trunk/src/VBox/Devices/PC/DevPcBios.cpp	(revision 60433)
@@ -1347,4 +1347,10 @@
     }
 
+    /*
+     * Get the CPU arch so we can load the appropriate ROMs.
+     */
+    PVM pVM = PDMDevHlpGetVM(pDevIns);
+    CPUMMICROARCH const enmMicroarch = pVM ? pVM->cpum.ro.GuestFeatures.enmMicroarch : kCpumMicroarch_Intel_P6;
+
     if (pThis->pszPcBiosFile)
     {
@@ -1405,6 +1411,4 @@
          * Use one of the embedded BIOS ROM images.
          */
-        PVM pVM = PDMDevHlpGetVM(pDevIns);
-        CPUMMICROARCH enmMicroarch = pVM ? pVM->cpum.ro.GuestFeatures.enmMicroarch : kCpumMicroarch_Intel_P6;
         uint8_t const *pbBios;
         uint32_t       cbBios;
@@ -1534,103 +1538,109 @@
     }
 
-    uint64_t cbFileLanBoot;
-    const uint8_t *pu8LanBootBinary = NULL;
-    uint64_t cbLanBootBinary;
-
-    /*
-     * Determine the LAN boot ROM size, open specified ROM file in the process.
-     */
-    RTFILE FileLanBoot = NIL_RTFILE;
-    if (pThis->pszLanBootFile)
-    {
-        rc = RTFileOpen(&FileLanBoot, pThis->pszLanBootFile,
-                        RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
-        if (RT_SUCCESS(rc))
-        {
-            rc = RTFileGetSize(FileLanBoot, &cbFileLanBoot);
+    /*
+     * Not loading LAN ROM for old CPUs.
+     */
+    if (   enmMicroarch != kCpumMicroarch_Intel_8086
+        && enmMicroarch != kCpumMicroarch_Intel_80186
+        && enmMicroarch != kCpumMicroarch_NEC_V20
+        && enmMicroarch != kCpumMicroarch_NEC_V30
+        && enmMicroarch != kCpumMicroarch_Intel_80286)
+    {
+        const uint8_t  *pu8LanBootBinary = NULL;
+        uint64_t        cbLanBootBinary;
+        uint64_t        cbFileLanBoot;
+
+        /*
+         * Open the LAN boot ROM and figure it size.
+         * Determine the LAN boot ROM size, open specified ROM file in the process.
+         */
+        if (pThis->pszLanBootFile)
+        {
+            RTFILE hFileLanBoot = NIL_RTFILE;
+            rc = RTFileOpen(&hFileLanBoot, pThis->pszLanBootFile,
+                            RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
             if (RT_SUCCESS(rc))
             {
-                if (cbFileLanBoot > _64K - (VBOX_LANBOOT_SEG << 4 & 0xffff))
-                    rc = VERR_TOO_MUCH_DATA;
-            }
-        }
-        if (RT_FAILURE(rc))
-        {
-            /*
-             * Ignore failure and fall back to the built-in LAN boot ROM.
-             */
-            LogRel(("PcBios: Failed to open LAN boot ROM file '%s', rc=%Rrc!\n", pThis->pszLanBootFile, rc));
-            RTFileClose(FileLanBoot);
-            FileLanBoot = NIL_RTFILE;
-            MMR3HeapFree(pThis->pszLanBootFile);
-            pThis->pszLanBootFile = NULL;
-        }
-    }
-
-    /*
-     * Get the LAN boot ROM data.
-     */
-    if (pThis->pszLanBootFile)
-    {
-        LogRel(("PcBios: Using LAN ROM '%s' with a size of %#x bytes\n", pThis->pszLanBootFile, cbFileLanBoot));
+                rc = RTFileGetSize(hFileLanBoot, &cbFileLanBoot);
+                if (RT_SUCCESS(rc))
+                {
+                    if (cbFileLanBoot <= _64K - (VBOX_LANBOOT_SEG << 4 & 0xffff))
+                    {
+                        LogRel(("PcBios: Using LAN ROM '%s' with a size of %#x bytes\n", pThis->pszLanBootFile, cbFileLanBoot));
+
+                        /*
+                         * Allocate buffer for the LAN boot ROM data and load it.
+                         */
+                        pThis->pu8LanBoot = (uint8_t *)PDMDevHlpMMHeapAllocZ(pDevIns, cbFileLanBoot);
+                        if (pThis->pu8LanBoot)
+                        {
+                            rc = RTFileRead(hFileLanBoot, pThis->pu8LanBoot, cbFileLanBoot, NULL);
+                            AssertLogRelRCReturnStmt(rc, RTFileClose(hFileLanBoot), rc);
+                        }
+                        else
+                            rc = VERR_NO_MEMORY;
+                    }
+                    else
+                        rc = VERR_TOO_MUCH_DATA;
+                }
+                RTFileClose(hFileLanBoot);
+            }
+            if (RT_FAILURE(rc))
+            {
+                /*
+                 * Play stupid and ignore failures, falling back to the built-in LAN boot ROM.
+                 */
+                /** @todo r=bird: This should have some kind of rational. We don't usually
+                 *        ignore the VM configuration.  */
+                LogRel(("PcBios: Failed to open LAN boot ROM file '%s', rc=%Rrc!\n", pThis->pszLanBootFile, rc));
+                MMR3HeapFree(pThis->pszLanBootFile);
+                pThis->pszLanBootFile = NULL;
+            }
+        }
+
+        /* If we were unable to get the data from file for whatever reason, fall
+         * back to the built-in LAN boot ROM image.
+         */
+        if (pThis->pu8LanBoot == NULL)
+        {
+#ifdef VBOX_WITH_PXE_ROM
+            pu8LanBootBinary = g_abNetBiosBinary;
+            cbLanBootBinary  = g_cbNetBiosBinary;
+#endif
+        }
+        else
+        {
+            pu8LanBootBinary = pThis->pu8LanBoot;
+            cbLanBootBinary  = cbFileLanBoot;
+        }
+
         /*
-         * Allocate buffer for the LAN boot ROM data.
+         * Map the Network Boot ROM into memory.
+         *
+         * Currently there is a fixed mapping: 0x000e2000 to 0x000effff contains
+         * the (up to) 56 kb ROM image.  The mapping size is fixed to trouble with
+         * the saved state (in PGM).
          */
-        pThis->pu8LanBoot = (uint8_t *)PDMDevHlpMMHeapAllocZ(pDevIns, cbFileLanBoot);
-        if (pThis->pu8LanBoot)
-        {
-            rc = RTFileRead(FileLanBoot, pThis->pu8LanBoot, cbFileLanBoot, NULL);
-            if (RT_FAILURE(rc))
-            {
-                AssertMsgFailed(("RTFileRead(,,%d,NULL) -> %Rrc\n", cbFileLanBoot, rc));
-                MMR3HeapFree(pThis->pu8LanBoot);
-                pThis->pu8LanBoot = NULL;
-            }
-            rc = VINF_SUCCESS;
-        }
-        else
-            rc = VERR_NO_MEMORY;
-    }
+        if (pu8LanBootBinary)
+        {
+            pThis->cbLanBoot = cbLanBootBinary;
+
+            rc = PDMDevHlpROMRegister(pDevIns, VBOX_LANBOOT_SEG << 4,
+                                      RT_MAX(cbLanBootBinary, _64K - (VBOX_LANBOOT_SEG << 4 & 0xffff)),
+                                      pu8LanBootBinary, cbLanBootBinary,
+                                      PGMPHYS_ROM_FLAGS_SHADOWED, "Net Boot ROM");
+            AssertRCReturn(rc, rc);
+        }
+    }
+    else if (pThis->pszLanBootFile)
+        LogRel(("PcBios: Skipping LAN ROM '%s' due to ancient target CPU.\n", pThis->pszLanBootFile));
+#ifdef VBOX_WITH_PXE_ROM
     else
-        pThis->pu8LanBoot = NULL;
-
-    /* cleanup */
-    if (FileLanBoot != NIL_RTFILE)
-        RTFileClose(FileLanBoot);
-
-    /* If we were unable to get the data from file for whatever reason, fall
-     * back to the built-in LAN boot ROM image.
-     */
-    if (pThis->pu8LanBoot == NULL)
-    {
-#ifdef VBOX_WITH_PXE_ROM
-        pu8LanBootBinary = g_abNetBiosBinary;
-        cbLanBootBinary  = g_cbNetBiosBinary;
+        LogRel(("PcBios: Skipping built in ROM due to ancient target CPU.\n"));
 #endif
-    }
-    else
-    {
-        pu8LanBootBinary = pThis->pu8LanBoot;
-        cbLanBootBinary  = cbFileLanBoot;
-    }
-
-    /*
-     * Map the Network Boot ROM into memory.
-     *
-     * Currently there is a fixed mapping: 0x000e2000 to 0x000effff contains
-     * the (up to) 56 kb ROM image.  The mapping size is fixed to trouble with
-     * the saved state (in PGM).
-     */
-    if (pu8LanBootBinary)
-    {
-        pThis->cbLanBoot = cbLanBootBinary;
-
-        rc = PDMDevHlpROMRegister(pDevIns, VBOX_LANBOOT_SEG << 4,
-                                  RT_MAX(cbLanBootBinary, _64K - (VBOX_LANBOOT_SEG << 4 & 0xffff)),
-                                  pu8LanBootBinary, cbLanBootBinary,
-                                  PGMPHYS_ROM_FLAGS_SHADOWED, "Net Boot ROM");
-        AssertRCReturn(rc, rc);
-    }
-
+
+    /*
+     * Configure Boot delay.
+     */
     rc = CFGMR3QueryU8Def(pCfg, "DelayBoot", &pThis->uBootDelay, 0);
     if (RT_FAILURE(rc))
