Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 316)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 322)
@@ -30,20 +30,6 @@
 	mov		[RAMVARS.xlateVars+XLATEVARS.bXlatedDrv], dl
 
-	call	FindDPT_ForDriveNumberInDL				; DS:DI points to our DPT, or NULL if not our drive
-	jnc		SHORT .OurFunction						; DPT found, this is one of our drives, and thus our function
-
-	test	ah, ah
-	jz		SHORT .OurFunction						; we handle all function 0h requests (resets)
-	cmp		ah, 8
-	jne		SHORT Int13h_DirectCallToAnotherBios	; non-8h function, handled by foreign bios
-
-%ifndef MODULE_SERIAL_FLOPPY
-; With floppy support, we handle all traffic for function 08h, as we need to wrap both hard disk and
-; floppy drive counts.  Without floppy support, we handle only hard disk traffic for function 08h,
-; and thus need the check below.
-;
-	test	dl, dl
-	jns		SHORT Int13h_DirectCallToAnotherBios
-%endif
+	call	FindDPT_ForDriveNumberInDL	; DS:DI points to our DPT, or NULL if not our drive
+	jc		SHORT .NotOurDrive			; DPT not found so this is not one of our drives
 
 .OurFunction:
@@ -65,11 +51,25 @@
 	test	BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
 	jz		SHORT Int13h_UnsupportedFunction	; No eINT 13h for CHS drives
+	sub		bl, 41h<<1					; BX = Offset to eINT 13h jump table
+	jb		SHORT Int13h_UnsupportedFunction
 	cmp		ah, 48h
 	ja		SHORT Int13h_UnsupportedFunction
-	sub		bl, 41h<<1					; BX = Offset to eINT 13h jump table
-	jb		SHORT Int13h_UnsupportedFunction
 	jmp		[cs:bx+g_rgwEbiosFunctionJumpTable]
 %endif
 
+ALIGN JUMP_ALIGN
+.NotOurDrive:
+	test	ah, ah
+	jz		SHORT .OurFunction			; We handle all function 0h requests (resets)
+
+%ifndef MODULE_SERIAL_FLOPPY
+; Without floppy support, we handle only hard disk traffic for function 08h.
+	test	dl, dl
+	jns		SHORT Int13h_DirectCallToAnotherBios
+%endif
+; With floppy support, we handle all traffic for function 08h, as we need to wrap both hard disk and floppy drive counts.
+	cmp		ah, 8
+	je		SHORT .OurFunction
+	; Fall to Int13h_DirectCallToAnotherBios
 
 ;--------------------------------------------------------------------
@@ -103,6 +103,6 @@
 	pop		bp	; Standard INT 13h functions never uses BP as return register
 %ifdef USE_386
-	mov		[bp+IDEPACK.intpack+INTPACK.gs], gs
-	mov		[bp+IDEPACK.intpack+INTPACK.fs], fs
+;	mov		[bp+IDEPACK.intpack+INTPACK.gs], gs
+;	mov		[bp+IDEPACK.intpack+INTPACK.fs], fs
 %endif
 	mov		[bp+IDEPACK.intpack+INTPACK.es], es
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm	(revision 316)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm	(revision 322)
@@ -22,7 +22,6 @@
 ALIGN JUMP_ALIGN
 AH25h_HandlerForGetDriveInformation:
-	mov		al, 1			; Read 1 sector
-	call	Prepare_BufferToESSIforOldInt13hTransfer
-	mov		ah, COMMAND_IDENTIFY_DEVICE
+	mov		ax, (COMMAND_IDENTIFY_DEVICE << 8 | 1)		; Read 1 sector
+	call	Prepare_BufferToESSIforOldInt13hTransfer	; Preserves AX
 	mov		bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
 %ifdef USE_186
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm	(revision 316)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm	(revision 322)
@@ -111,5 +111,4 @@
 	cmp		al, 128
 	ja		SHORT InvalidNumberOfSectorsRequested
-	mov		ah, RET_HD_BOUNDARY
 	test	si, si								; Offset must be zero to xfer 128 sectors
 	jnz		SHORT CannotAlignPointerProperly
@@ -120,6 +119,8 @@
 Prepare_ReturnFromInt13hWithInvalidFunctionError:
 	mov		ah, RET_HD_INVALID
+	SKIP2B	f
+CannotAlignPointerProperly:
+	mov		ah, RET_HD_BOUNDARY
 ZeroSectorsRequestedSoNoErrors:
-CannotAlignPointerProperly:
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
 
