Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 221)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 227)
@@ -53,5 +53,4 @@
 	jmp		SHORT ConvertAH08hReturnValuesToSectorCount
 
-ALIGN JUMP_ALIGN
 AH15h_GetSectorCountToDXAX:
 	call	AH8h_GetDriveParameters
@@ -60,10 +59,10 @@
 ConvertAH08hReturnValuesToSectorCount:
 	call	Address_ExtractLCHSparametersFromOldInt13hAddress
-	xor		ax, ax			; Zero AX
-	inc		cx				; Max cylinder number to cylinder count
-	xchg	al, bh			; AX=Max head number, BX=Sectors per track
-	inc		ax				; AX=Head count
-	mul		bx				; AX=Head count * Sectors per track
-	mul		cx				; DX:AX = Total sector count
-	xor		bx, bx			; Zero BX for 48-bit sector count (and clear CF)
+	xchg	ax, cx
+	inc		ax				; Max cylinder number to cylinder count
+.MultiplyChsInAXBLBHtoBXDXAX:
+	xchg	bx, ax
+	mul		ah			; Multiply heads and sectors
+	mul		bx			; Multiply with cylinders
+	xor		bx, bx
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm	(revision 221)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm	(revision 227)
@@ -22,5 +22,4 @@
 ;		CF:		0 if successfull, 1 if error
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 AH8h_HandlerForReadDiskDriveParameters:
 	call	RamVars_IsDriveHandledByThisBIOS
@@ -56,7 +55,6 @@
 ;		AX, BX
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 AH8h_GetDriveParameters:
-	call	AccessDPT_GetLCHS		; AX=sectors, BX=cylinders, DX=heads
+	call	AccessDPT_GetLCHStoAXBLBH
 	; Fall to .PackReturnValues
 
@@ -66,7 +64,7 @@
 ; .PackReturnValues
 ;	Parameters:
-;		AX:		Number of L-CHS sectors per track (1...63)
-;		BX:		Number of L-CHS cylinders available (1...1024)
-;		DX:		Number of L-CHS heads (1...256)
+;		AX:		Number of L-CHS cylinders available (1...1024)
+;		BL:		Number of L-CHS heads (1...256)
+;		BH:		Number of L-CHS sectors per track (1...63)
 ;		DS:		RAMVARS segment
 ;	Returns:
@@ -80,10 +78,10 @@
 ;--------------------------------------------------------------------
 .PackReturnValues:
-	dec		bx						; Cylinder count to last cylinder
-	dec		dx						; Head count to max head number
-	mov		dh, dl					; Max head number to DH
-	mov		ch, bl					; Cylinder bits 7...0 to CH
-	mov		cl, bh					; Cylinder bits 9...8 to CL
-	eROR_IM	cl, 2					; Cylinder bits 9...8 to CL bits 7...6
-	or		cl, al					; Sectors per track to CL bits 5...0
+	dec		ax						; AX = Number of last cylinder
+	dec		bx						; BL = Number of last head
+	xchg	cx, ax
+	xchg	cl, ch					; CH = Last cylinder bits 0...7
+	eROR_IM	cl, 2					; CL bits 6...7 = Last cylinder bits 8...9
+	or		cl, bh					; CL bits 0...5 = Sectors per track
+	mov		dh, bl					; DH = Maximum head number
 	jmp		RamVars_GetCountOfKnownDrivesToDL
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 221)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 227)
@@ -17,5 +17,4 @@
 ;		CF:		0 if succesfull, 1 if error
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 AH9h_HandlerForInitializeDriveParameters:
 %ifndef USE_186
@@ -41,5 +40,4 @@
 ;		AL, BX, DX
 ;--------------------------------------------------------------------
-;ALIGN JUMP_ALIGN
 AH9h_InitializeDriveForUse:
 	push	cx
@@ -87,5 +85,4 @@
 ;		AL, BX, CX, DX
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 InitializeDeviceParameters:
 	; No need to initialize CHS parameters if LBA mode enabled
@@ -94,7 +91,7 @@
 
 	; Initialize Logical Sectors per Track and Max Head number
-	mov		ah, [di+DPT.bHeads]
+	mov		ah, [di+DPT.bPchsHeads]
 	dec		ah							; Max Head number
-	mov		dl, [di+DPT.bSectors]		; Sectors per Track
+	mov		dl, [di+DPT.bPchsSectors]	; Sectors per Track
 	mov		al, COMMAND_INITIALIZE_DEVICE_PARAMETERS
 	mov		bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY)
@@ -113,5 +110,4 @@
 ;		AL, BX, CX, DX
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 InitializeBlockMode:
 	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED	; Clear CF
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 221)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 227)
@@ -21,58 +21,32 @@
 ;		CF:		0 if succesfull, 1 if error
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 AH48h_HandlerForGetExtendedDriveParameters:
-	; Get our buffer to ES:SI
-	push	di
-	call	FindDPT_ForNewDriveToDSDI
-	lea		si, [di+LARGEST_DPT_SIZE]	; IdeCommand.asm required fake DPT
-	pop		di
-	push	ds
-	pop		es
+	call	AccessDPT_GetLbaSectorCountToBXDXAX
 
-	; Get Drive ID and total sector count from it
-	call	AH25h_GetDriveInformationToBufferInESSI
-	jc		SHORT .ReturnWithError
-
-	; Point DS:DI to Destination buffer
-	mov		di, [bp+IDEPACK.intpack+INTPACK.si]
+	; Point DS:SI to Extended Drive Information Table to fill
 	mov		ds, [bp+IDEPACK.intpack+INTPACK.ds]
-	mov		ax, MINIMUM_EDRIVEINFO_SIZE
-	cmp		[di+EDRIVE_INFO.wSize], ax
+	mov		cx, MINIMUM_EDRIVEINFO_SIZE
+	cmp		[si+EDRIVE_INFO.wSize], cx
 	jb		SHORT Prepare_ReturnFromInt13hWithInvalidFunctionError
 	je		SHORT .SkipEddConfigurationParameters
 
 	; We do not support EDD Configuration Parameters so set to FFFF:FFFFh
-	mov		ax, -1		; AX = FFFFh
-	mov		[di+EDRIVE_INFO.fpEDDparams], ax
-	mov		[di+EDRIVE_INFO.fpEDDparams+2], ax
-	mov		ax, EDRIVE_INFO_size
+	mov		cx, -1		; FFFFh
+	mov		[si+EDRIVE_INFO.fpEDDparams], cx
+	mov		[si+EDRIVE_INFO.fpEDDparams+2], cx
+	mov		cx, EDRIVE_INFO_size
 
-	; Fill Extended Drive Information Table in DS:DI
+	; Fill Extended Drive Information Table in DS:SI
 .SkipEddConfigurationParameters:
-	mov		[di+EDRIVE_INFO.wSize], ax
-	mov		WORD [di+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS | FLG_CHS_INFORMATION_IS_VALID
+	mov		[si+EDRIVE_INFO.wSize], cx
+	mov		WORD [si+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS
 
-	call	AtaID_GetPCHStoAXBLBHfromAtaInfoInESSI
-	xor		cx, cx
-	mov		[di+EDRIVE_INFO.dwCylinders], ax
-	mov		[di+EDRIVE_INFO.dwCylinders+2], cx
-	eMOVZX	ax, bl
-	mov		[di+EDRIVE_INFO.dwHeads], ax
-	mov		[di+EDRIVE_INFO.dwHeads+2], cx
-	mov		al, bh
-	mov		[di+EDRIVE_INFO.dwSectorsPerTrack], ax
-	mov		[di+EDRIVE_INFO.dwSectorsPerTrack+2], cx
-
-	call	AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI
 	mov		[di+EDRIVE_INFO.qwTotalSectors], ax
+	xor		ax, ax									; Return with success
 	mov		[di+EDRIVE_INFO.qwTotalSectors+2], dx
 	mov		[di+EDRIVE_INFO.qwTotalSectors+4], bx
-	mov		[di+EDRIVE_INFO.qwTotalSectors+6], cx
-
+	mov		[di+EDRIVE_INFO.qwTotalSectors+6], ax
 	mov		WORD [di+EDRIVE_INFO.wSectorSize], 512
 
-	; Return with success
-	xor		ah, ah
 .ReturnWithError:
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm	(revision 221)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm	(revision 227)
@@ -53,5 +53,5 @@
 	; LHead / PHeadCount and LHead % PHeadCount
 	eMOVZX	ax, bh					; Copy L-CHS Head number to AX
-	div		BYTE [di+DPT.bHeads]	; AL = LHead / PHeadCount, AH = LHead % PHeadCount
+	div		BYTE [di+DPT.bPchsHeads]; AL = LHead / PHeadCount, AH = LHead % PHeadCount
 	mov		bh, ah					; Copy P-CHS Head number to BH
 	xor		ah, ah					; AX = LHead / PHeadCount
@@ -129,5 +129,5 @@
 	; cylToSeek*headsPerCyl (18-bit result)
 	mov		ax, cx					; Copy Cylinder number to AX
-	eMOVZX	dx, BYTE [di+DPT.bHeads]
+	eMOVZX	dx, BYTE [di+DPT.bLbaHeads]
 	mul		dx						; DX:AX = cylToSeek*headsPerCyl
 
