Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm	(revision 167)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm	(revision 169)
@@ -15,5 +15,5 @@
 ;		SS:BP:	Ptr to IDEPACK
 ;	Parameters on INTPACK:
-;		AL:		Number of sectors to read (1...127)
+;		AL:		Number of sectors to read (1...255, 0=256)
 ;		CH:		Cylinder number, bits 7...0
 ;		CL:		Bits 7...6: Cylinder number bits 9 and 8
@@ -28,7 +28,4 @@
 ALIGN JUMP_ALIGN
 AH2h_HandlerForReadDiskSectors:
-	cmp		al, 0
-	jle		SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
-
 	call	CommandLookup_GetOldInt13hIndexToBX
 	mov		ah, [cs:bx+g_rgbReadCommandLookup]
@@ -42,14 +39,2 @@
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
 %endif
-
-
-;--------------------------------------------------------------------
-; AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
-;	Parameters:
-;		Nothing
-;	Returns:
-;		Jumps to Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
-;--------------------------------------------------------------------
-AH2h_ExitInt13hSinceSectorCountInIntpackIsZero:
-	mov		ah, RET_HD_INVALID
-	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm	(revision 167)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm	(revision 169)
@@ -15,5 +15,5 @@
 ;		SS:BP:	Ptr to IDEREGS_AND_INTPACK
 ;	Parameters on INTPACK:
-;		AL:		Number of sectors to write (1...127)
+;		AL:		Number of sectors to write (1...255, 0=256)
 ;		CH:		Cylinder number, bits 7...0
 ;		CL:		Bits 7...6: Cylinder number bits 9 and 8
@@ -27,7 +27,4 @@
 ALIGN JUMP_ALIGN
 AH3h_HandlerForWriteDiskSectors:
-	cmp		al, 0
-	jle		SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
-
 	call	CommandLookup_GetOldInt13hIndexToBX
 	mov		ah, [cs:bx+g_rgbWriteCommandLookup]
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm	(revision 167)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm	(revision 169)
@@ -15,5 +15,5 @@
 ;		SS:BP:	Ptr to INTPACK
 ;	Parameters on INTPACK in SS:BP:
-;		AL:		Number of sectors to verify (1...127)
+;		AL:		Number of sectors to verify (1...255, 0=256)
 ;		CH:		Cylinder number, bits 7...0
 ;		CL:		Bits 7...6: Cylinder number bits 9 and 8
@@ -26,7 +26,4 @@
 ALIGN JUMP_ALIGN
 AH4h_HandlerForVerifyDiskSectors:
-	cmp		al, 0
-	jle		SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
-
 	mov		ah, COMMAND_VERIFY_SECTORS
 	mov		bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm	(revision 167)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm	(revision 169)
@@ -54,8 +54,9 @@
 	mov		es, [bp+IDEPACK.intpack+INTPACK.ds]	; ES:SI to point Disk Address Packet
 	cmp		BYTE [es:si+DAP.bSize], MINIMUM_DAP_SIZE
-	jb		SHORT .DapContentsNotValid
+	jb		SHORT AH42h_ReturnWithInvalidFunctionError
 	cmp		WORD [es:si+DAP.wSectorCount], BYTE 0
-	jle		SHORT .DapContentsNotValid			; Must be 1...127
+	je		SHORT AH42h_ReturnWithInvalidFunctionError
 	ret
-.DapContentsNotValid:
-	jmp		AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
+AH42h_ReturnWithInvalidFunctionError:
+	mov		ah, RET_HD_INVALID
+	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm	(revision 167)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm	(revision 169)
@@ -27,5 +27,5 @@
 AH43h_HandlerForExtendedWriteSectors:
 	cmp		BYTE [bp+IDEPACK.intpack+INTPACK.al], 2	; Verify requested?
-	jae		SHORT .WriteWithVerifyNotSupported
+	jae		SHORT AH42h_ReturnWithInvalidFunctionError
 
 	call	AH42h_LoadDapToESSIandVerifyForTransfer
@@ -40,5 +40,2 @@
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
 %endif
-
-.WriteWithVerifyNotSupported:
-	jmp		AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH47h_ExtendedSeek.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH47h_ExtendedSeek.asm	(revision 167)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH47h_ExtendedSeek.asm	(revision 169)
@@ -25,5 +25,5 @@
 	mov		es, [bp+IDEPACK.intpack+INTPACK.ds]	; ES:SI to point Disk Address Packet
 	cmp		BYTE [es:si+DAP.bSize], MINIMUM_DAP_SIZE
-	jb		SHORT .DapContentsNotValid
+	jb		SHORT AH42h_ReturnWithInvalidFunctionError
 
 	mov		ah, COMMAND_SEEK
@@ -36,5 +36,2 @@
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
 %endif
-
-.DapContentsNotValid:
-	jmp		AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 167)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 169)
@@ -34,13 +34,11 @@
 	call	AH25h_GetDriveInformationToBufferInESSI
 	jc		SHORT .ReturnWithError
-	call	AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI
-	xchg	cx, ax		; Sector count now in BX:DX:CX
 
-	; Point ES:DI to Destination buffer
+	; Point DS:DI to Destination buffer
 	mov		di, [bp+IDEPACK.intpack+INTPACK.si]
-	mov		es, [bp+IDEPACK.intpack+INTPACK.ds]
+	mov		ds, [bp+IDEPACK.intpack+INTPACK.ds]
 	mov		ax, MINIMUM_EDRIVEINFO_SIZE
-	cmp		WORD [es:di+EDRIVE_INFO.wSize], ax
-	jb		SHORT .BufferTooSmall
+	cmp		WORD [di+EDRIVE_INFO.wSize], ax
+	jb		SHORT AH42h_ReturnWithInvalidFunctionError
 	je		SHORT .SkipEddConfigurationParameters
 
@@ -48,31 +46,34 @@
 	xor		ax, ax
 	dec		ax			; AX = FFFFh
-	mov		[es:di+EDRIVE_INFO.fpEDDparams], ax
-	mov		[es:di+EDRIVE_INFO.fpEDDparams+2], ax
+	mov		[di+EDRIVE_INFO.fpEDDparams], ax
+	mov		[di+EDRIVE_INFO.fpEDDparams+2], ax
 	mov		ax, EDRIVE_INFO_size
 
-	; Fill Extended Drive Information Table in ES:DI
+	; Fill Extended Drive Information Table in DS:DI
 .SkipEddConfigurationParameters:
-	stosw				; Store Extended Drive Information Table size
-	mov		al, FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS
-	stosw
-	add		di, BYTE 12	; Skip CHS parameters
-	xchg	ax, cx
-	stosw				; LBA WORD 0
-	xchg	ax, dx
-	stosw				; LBA WORD 1
-	xchg	ax, bx
-	stosw				; LBA WORD 2
-	xor		ax, ax
-	stosw				; LBA WORD 3 always zero since 48-bit address
-	mov		ah, 512>>8
-	stosw				; Always 512-byte sectors
+	mov		[di+EDRIVE_INFO.wSize], ax
+	mov		WORD [di+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS | FLG_CHS_INFORMATION_IS_VALID
+
+	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
+	mov		[di+EDRIVE_INFO.qwTotalSectors+2], dx
+	mov		[di+EDRIVE_INFO.qwTotalSectors+4], bx
+	mov		[di+EDRIVE_INFO.qwTotalSectors+6], cx
+
+	mov		WORD [di+EDRIVE_INFO.wSectorSize], 512
 
 	; Return with success
 	xor		ah, ah
-	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
-
-.BufferTooSmall:
-	mov		ah, RET_HD_INVALID
 .ReturnWithError:
 	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
