Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-pe16.asm
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-pe16.asm	(revision 60555)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-pe16.asm	(revision 60556)
@@ -50,7 +50,8 @@
 extern Bs3TestInit_c64
 
+BS3_BEGIN_RMTEXT16
+EXTERN Bs3InitMemory_rm_far
+
 BS3_BEGIN_TEXT16
-EXTERN Bs3InitMemory_rm
-
 %if 0
 EXTERN Main_pe16
@@ -86,5 +87,5 @@
     ; We need to enter 16-bit protected mode before we can call Main_pe16.
     ;
-    call    NAME(Bs3InitMemory_rm)      ; Initialize the memory (must be done from real mode).
+    call far NAME(Bs3InitMemory_rm_far) ; Initialize the memory (must be done from real mode).
     call    Bs3Trap32Init
     sub     xSP, 20h                    ; for 64-bit calls.
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-CpuDetect.asm
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-CpuDetect.asm	(revision 60555)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-CpuDetect.asm	(revision 60556)
@@ -28,5 +28,5 @@
 
 BS3_EXTERN_DATA16 g_uBs3CpuDetected
-TMPL_BEGIN_TEXT
+
 
 ;;
@@ -42,5 +42,15 @@
 ; @remarks  ASSUMES we're in ring-0 when not in some kind of real mode.
 ;
-BS3_PROC_BEGIN_MODE Bs3CpuDetect, BS3_PBC_HYBRID_0_ARGS
+; @note     We put the real mode version of this code in the RMTEXT16 segment
+;           to save space elsewhere.  We generate a far call stub that goes
+;           to the right segment.
+;
+%if TMPL_MODE == BS3_MODE_RM
+BS3_BEGIN_RMTEXT16
+BS3_PROC_BEGIN_MODE Bs3CpuDetect, BS3_PBC_FAR
+%else
+TMPL_BEGIN_TEXT
+BS3_PROC_BEGIN_MODE Bs3CpuDetect, BS3_PBC_HYBRID
+%endif
 CPU 8086
         push    xBP
@@ -297,2 +307,11 @@
 BS3_PROC_END_MODE   Bs3CpuDetect
 
+
+%if TMPL_MODE == BS3_MODE_RM
+BS3_BEGIN_TEXT16_NEARSTUBS
+BS3_PROC_BEGIN_MODE Bs3CpuDetect, BS3_PBC_NEAR
+        call far TMPL_FAR_NM(Bs3CpuDetect)
+        ret
+BS3_PROC_END_MODE   Bs3CpuDetect
+%endif
+
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c	(revision 60555)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c	(revision 60556)
@@ -41,7 +41,7 @@
 BS3_DECL(void) Bs3InitAll_rm(void)
 {
-    Bs3CpuDetect_rm();
-    Bs3InitMemory_rm();
-    Bs3InitGdt_rm();
+    Bs3CpuDetect_rm_far();
+    Bs3InitMemory_rm_far();
+    Bs3InitGdt_rm_far();
 
     ASMIntDisable();
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitGdt.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitGdt.c	(revision 60555)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitGdt.c	(revision 60556)
@@ -42,5 +42,5 @@
 
 
-BS3_DECL_FAR(void) Bs3InitGdt_rm(void)
+BS3_DECL_FAR(void) Bs3InitGdt_rm_far(void)
 {
     Bs3Gdte_X0TEXT16_CS.Gen.u16LimitLow = Bs3X0Text16_Size - 1;
@@ -52,3 +52,2 @@
 }
 
-
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitMemory.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitMemory.c	(revision 60555)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitMemory.c	(revision 60556)
@@ -239,5 +239,5 @@
 
 
-BS3_DECL(void) BS3_FAR_CODE Bs3InitMemory_rm(void)
+BS3_DECL(void) BS3_FAR_CODE Bs3InitMemory_rm_far(void)
 {
     uint16_t        i;
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h	(revision 60555)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h	(revision 60556)
@@ -2508,10 +2508,10 @@
  * For proper operation on OLDer CPUs, call #Bs3CpuDetect_mmm first.
  */
-BS3_DECL_FAR(void) Bs3InitMemory_rm(void);
+BS3_DECL_FAR(void) Bs3InitMemory_rm_far(void);
 
 /**
  * Initialized the X0TEXT16 and X1TEXT16 GDT entries.
  */
-BS3_DECL_FAR(void) Bs3InitGdt_rm(void);
+BS3_DECL_FAR(void) Bs3InitGdt_rm_far(void);
 
 
