Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm	(revision 568)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm	(revision 580)
@@ -49,5 +49,5 @@
 ALIGN JUMP_ALIGN
 .InswLoop:
-	%rep 8 ; WORDs
+	%rep 8	; WORDs
 		XTIDE_INSW
 	%endrep
@@ -76,5 +76,5 @@
 	rep insb
 	ret
-%else ; If 8088/8086
+%else ; 808x
 	UNROLL_SECTORS_IN_CX_TO_OWORDS
 ALIGN JUMP_ALIGN
@@ -112,5 +112,5 @@
 	ret
 
-%else ; If 8088/8086
+%else ; 808x
 	UNROLL_SECTORS_IN_CX_TO_OWORDS
 ALIGN JUMP_ALIGN
@@ -130,5 +130,5 @@
 	db		0C1h		; SHL
 	db		0E1h		; CX
-	db		7			; 7	(Sectors to DWORDs)
+	db		7			; 7 (Sectors to DWORDs)
 	rep
 	db		66h			; Override operand size to 32-bit
@@ -155,5 +155,5 @@
 ;		Nothing
 ;	Corrupts registers:
-;		AX, BX, CX, DX
+;		AX, BX, CX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -162,6 +162,6 @@
 	UNROLL_SECTORS_IN_CX_TO_QWORDS
 	mov		bl, 8		; Bit mask for toggling data low/high reg
-	push	es			; Copy ES...
-	pop		ds			; ...to DS
+	push	es
+	pop		ds
 ALIGN JUMP_ALIGN
 .OutswLoop:
@@ -183,5 +183,5 @@
 ;		Nothing
 ;	Corrupts registers:
-;		AX, BX, CX, DX
+;		AX, BX, CX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -189,10 +189,10 @@
 	UNROLL_SECTORS_IN_CX_TO_QWORDS
 	push	ds
-	push	es		; Copy ES...
-	pop		ds		; ...to DS
+	push	es
+	pop		ds
 ALIGN JUMP_ALIGN
 .WriteNextQword:
 	%rep 4	; WORDs
-		XTIDE_MOD_OUTSW	; special macro
+		XTIDE_MOD_OUTSW
 	%endrep
 	loop	.WriteNextQword
@@ -210,5 +210,5 @@
 ;		Nothing
 ;	Corrupts registers:
-;		AX, BX, CX, DX
+;		AX, BX, CX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -220,9 +220,7 @@
 	ret
 
-%else ; If 8088/8086
-	UNROLL_SECTORS_IN_CX_TO_QWORDS
-	push	ds
-	;mov	ax, es
-	;mov	ds, ax	; move es to ds via ax (does this run faster on 8088?)
+%else ; 808x
+	UNROLL_SECTORS_IN_CX_TO_QWORDS
+	push	ds
 	push	es
 	pop		ds
@@ -231,5 +229,5 @@
 	%rep 8	; BYTEs
 		lodsb			; Load BYTE from [DS:SI]
-		out	dx, al		; Write BYTE
+		out		dx, al	; Write BYTE
 	%endrep
 	loop	.WriteNextQword
@@ -251,5 +249,5 @@
 ;		Nothing
 ;	Corrupts registers:
-;		AX, BX, CX, DX
+;		AX, BX, CX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -261,9 +259,7 @@
 	ret
 
-%else ; If 8088/8086
-	UNROLL_SECTORS_IN_CX_TO_QWORDS
-	push	ds
-	;mov	ax, es
-	;mov	ds, ax		; move es to ds via ax (does this run faster on 8088?)
+%else ; 808x
+	UNROLL_SECTORS_IN_CX_TO_QWORDS
+	push	ds
 	push	es
 	pop		ds
@@ -272,10 +268,10 @@
 	%rep 4	; WORDs
 		lodsw			; Load WORD from [DS:SI]
-		out	dx, ax		; Write WORD
+		out		dx, ax	; Write WORD
 	%endrep
 	loop	.WriteNextQword
 	pop		ds
 	ret
-%endif	; if/else USE_186
+%endif
 
 ;--------------------------------------------------------------------
@@ -284,5 +280,5 @@
 	db		0C1h		; SHL
 	db		0E1h		; CX
-	db		7			; 7	(Sectors to DWORDs)
+	db		7			; 7 (Sectors to DWORDs)
 	es					; Source is ES segment
 	rep
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 568)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 580)
@@ -74,6 +74,6 @@
 
 ;--------------------------------------------------------------------
-; AH15h_GetSectorCountFromForeignDriveToDXAX:
-; AH15h_GetSectorCountToBXDXAX:
+; AH15h_GetSectorCountFromForeignDriveToDXAX
+; AH15h_GetSectorCountToBXDXAX
 ;	Parameters:
 ;		DL:		Drive number (AH15h_GetSectorCountFromForeignDriveToDXAX only)
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 568)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 580)
@@ -100,8 +100,8 @@
 	jb		Prepare_ReturnFromInt13hWithInvalidFunctionError
 	mov		[di+EDRIVE_INFO.wSize], ax
-	add		al, EDRIVEINFO_SIZE_WITH_DPTE - MINIMUM_EDRIVEINFO_SIZE
+	mov		al, EDRIVEINFO_SIZE_WITH_DPTE
 	cmp		cx, ax
 	jb		SHORT .SkipEddConfigurationParameters
-	mov		[di+EDRIVE_INFO.wSize], ax
+	mov		[di+EDRIVE_INFO.wSize], al
 
 	; Store DPTE for standard controllers only,
@@ -159,4 +159,4 @@
 	mov		[di+EDRIVE_INFO.dwCylinders+2], cx
 
-	xor		ax, ax		; Success
+	xchg	ax, cx		; Success
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm	(revision 568)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm	(revision 580)
@@ -32,4 +32,5 @@
 ;		AX, BX, CX
 ;--------------------------------------------------------------------
+%ifndef NO_ATAID_VALIDATION
 AtaID_VerifyFromESSI:
 	; We cannot start by reading ATA version since the ID might be
@@ -87,4 +88,5 @@
 .ValidPCHorSinOffsetBX:
 	ret
+%endif ; NO_ATAID_VALIDATION
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 568)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 580)
@@ -48,4 +48,11 @@
 	call	StartDetectionWithDriveSelectByteInBHandStringInCX
 
+%ifdef MODULE_HOTKEYS
+%ifdef MODULE_SERIAL
+	; This is only needed for hotkey F6 (ComDtct) to work
+	call	ScanHotkeysFromKeyBufferAndStoreToBootvars			; Done here while CX is still protected
+%endif
+%endif
+
 	pop		cx
 
@@ -68,5 +75,5 @@
 
 %ifdef MODULE_HOTKEYS
-	cmp		al, COM_DETECT_HOTKEY_SCANCODE	; Set by last call to HotkeyBar_UpdateDuringDriveDetection above
+	cmp		al, COM_DETECT_HOTKEY_SCANCODE	; Set by last call to ScanHotkeysFromKeyBufferAndStoreToBootvars above
 	je		.DriveDetectLoop
 %endif
@@ -76,5 +83,5 @@
 	and		al, 8							; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
 	jnz		.DriveDetectLoop
-%endif
+%endif ; MODULE_SERIAL
 
 .AddHardDisks:
@@ -226,8 +233,10 @@
 ;--------------------------------------------------------------------
 CreateBiosTablesForHardDisk:
+%ifndef NO_ATAID_VALIDATION
 	push	bx
 	call	AtaID_VerifyFromESSI
 	pop		bx
 	jnz		SHORT DetectDrives_DriveNotFound
+%endif
 	call	CreateDPT_FromAtaInformation
 	jc		SHORT DetectDrives_DriveNotFound
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 568)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 580)
@@ -82,6 +82,16 @@
 	call	RamVars_Initialize
 	call	BootVars_Initialize
+%ifdef MODULE_HOTKEYS
+	; This is a simple fix for the so called "No Fixed Disk Present in FDISK"-bug introduced in r551. MODULE_HOTKEYS includes the internal
+	; module MODULE_DRIVEXLATE which is needed if interrupt handlers are installed before drive detection. The reason for this is that
+	; Interrupts_InitializeInterruptVectors won't install our interrupt 13h handler if no drives were detected (unless MODULE_DRIVEXLATE is included).
+	; Since the drive detection hasn't been done yet, the handler will not be installed, causing the above mentioned bug.
 	call	Interrupts_InitializeInterruptVectors	; HotkeyBar requires INT 40h so install handlers before drive detection
 	call	DetectDrives_FromAllIDEControllers
+%else
+	; Without MODULE_HOTKEYS (or actually MODULE_DRIVEXLATE) we *must* use this call order.
+	call	DetectDrives_FromAllIDEControllers
+	call	Interrupts_InitializeInterruptVectors
+%endif
 	mov		[RAMVARS.wDrvDetectSignature], es		; No longer in drive detection mode (set normal timeouts)
 	; Fall to .StoreDptPointersToIntVectors
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 568)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 580)
@@ -22,5 +22,6 @@
 
 ;--------------------------------------------------------------------
-; Drives must be detected before this function is called!
+; Drives must be detected before this function is called unless
+; MODULE_DRIVEXLATE has been included in the BIOS.
 ;
 ; Interrupts_InitializeInterruptVectors
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm	(revision 568)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm	(revision 580)
@@ -304,5 +304,5 @@
 	; Max = 16,514,064 / 63 = 262128
 	mov		cx, LBA_ASSIST_SPT			; CX = 63
-	call	Math_DivDXAXbyCX
+	call	Math_DivDXAXbyCX			; Preserves CX
 	push	dx
 	push	ax							; Value CH stored for later use
@@ -316,12 +316,10 @@
 	; AX = Number of heads = ((Value CH - 1) / 1024) + 1
 	; Max = (262127 / 1024) + 1 = 256
-	push	si
-	call	Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
-	pop		si
+	call	Size_DivideSizeInBXDXAXby1024	; Preserves CX
 	inc		ax							; + 1
 
 	; Heads must be 16, 32, 64, 128 or 255 (round up to the nearest)
 	; Max = 255
-	mov		cx, 16						; Min number of heads
+	mov		cl, 16						; Min number of heads
 .CompareNextValidNumberOfHeads:
 	cmp		ax, cx
