Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 560)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 561)
@@ -176,6 +176,9 @@
 	; Simulate INT by pushing flags and return address
 	push	WORD [bp+IDEPACK.intpack+INTPACK.flags]
+%if 0
+	; No standard INT 13h function uses FLAGS as parameters so no need to restore them
 	popf
-	pushf								; Simulate INT by pushing flags
+	pushf
+%endif
 	push	cs
 	ePUSH_T	di, .ReturnFromAnotherBios	; Can not corrupt flags
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13hBiosInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13hBiosInit.asm	(revision 560)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13hBiosInit.asm	(revision 561)
@@ -22,5 +22,5 @@
 SECTION .text
 
-TEMPORARY_VECTOR_FOR_SYSTEM_INT13h		EQU		20h	; MS-DOS so BIOSes most likely do not use this
+TEMPORARY_VECTOR_FOR_SYSTEM_INT13h		EQU		32h	; Unused by BIOS
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 560)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 561)
@@ -31,9 +31,13 @@
 	sti											; Enable interrupts
 	cld											; String instructions to increment pointers
+%ifdef MODULE_VERY_LATE_INITIALIZATION
+	LOAD_BDA_SEGMENT_TO	ds, ax					; Load BDA segment (zero) to DS
+	les		ax, [TEMPORARY_VECTOR_FOR_SYSTEM_INT13h*4]
+	mov		[BIOS_DISK_INTERRUPT_13h*4], ax
+	mov		[BIOS_DISK_INTERRUPT_13h*4+2], es
+	push	ds									; BDA segment (zero)...
+	pop		es									; ...to ES
+%else
 	LOAD_BDA_SEGMENT_TO	es, ax					; Load BDA segment (zero) to ES
-%ifdef MODULE_VERY_LATE_INITIALIZATION
-	lds		ax, [es:TEMPORARY_VECTOR_FOR_SYSTEM_INT13h*4]
-	mov		[es:BIOS_DISK_INTERRUPT_13h*4], ax
-	mov		[es:BIOS_DISK_INTERRUPT_13h*4+2], ds
 %endif
 	; Fall to .PrepareBootLoaderStack
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 560)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 561)
@@ -52,8 +52,8 @@
 	; when our INT 19h is not called
 	les		ax, [BIOS_DISK_INTERRUPT_13h*4]	; Load system INT 13h handler
+	mov		WORD [BIOS_DISK_INTERRUPT_13h*4], Int13hBiosInit_Handler
+	mov		[BIOS_DISK_INTERRUPT_13h*4+2], cs
 	mov		[TEMPORARY_VECTOR_FOR_SYSTEM_INT13h*4], ax
 	mov		[TEMPORARY_VECTOR_FOR_SYSTEM_INT13h*4+2], es
-	mov		WORD [BIOS_DISK_INTERRUPT_13h*4], Int13hBiosInit_Handler
-	mov		[BIOS_DISK_INTERRUPT_13h*4+2], cs
 	pop		es
 %endif
Index: trunk/XTIDE_Universal_BIOS/makefile
===================================================================
--- trunk/XTIDE_Universal_BIOS/makefile	(revision 560)
+++ trunk/XTIDE_Universal_BIOS/makefile	(revision 561)
@@ -101,8 +101,8 @@
 # Assembler preprocessor defines.                               #
 #################################################################
-DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_VERY_LATE_INITIALIZATION MODULE_FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER
+DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER
 DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED MODULE_COMPATIBLE_TABLES
 
-DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED
+DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED MODULE_VERY_LATE_INITIALIZATION
 DEFINES_XTPLUS = $(DEFINES_COMMON) $(DEFINES_XT) USE_186
 DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 MODULE_IRQ MODULE_ADVANCED_ATA MODULE_COMPATIBLE_TABLES
