Index: /trunk/Serial_Server/library/FlatImage.h
===================================================================
--- /trunk/Serial_Server/library/FlatImage.h	(revision 258)
+++ /trunk/Serial_Server/library/FlatImage.h	(revision 259)
@@ -24,4 +24,5 @@
 			double sizef;
 			FileAccess cf;
+			char sizeChar;
 
 			size = (unsigned long) p_cyl * (unsigned long) p_sect * (unsigned long) p_head;
@@ -29,4 +30,10 @@
 				log( -1, "'%s', can't create flat file with size greater than %lu 512-byte sectors", name, cf.MaxSectors );
 			sizef = size / 2048.0;   // 512 byte sectors -> MB
+			sizeChar = 'M';
+			if( sizef < 1 ) 
+			{
+				sizef *= 1024;
+				sizeChar = 'K';
+			}
 
 			if( cf.Create( name ) )
@@ -37,7 +44,7 @@
 				
 				if( p_cyl > 1024 )
-					log( 0, "Created file '%s', size %.1lf MB", name, sizef );
+					log( 0, "Created file '%s', size %.2lf %cB", name, sizef, sizeChar );
 				else
-					log( 0, "Created file '%s', geometry %u:%u:%u, size %.1lf MB", name, p_cyl, p_sect, p_head, sizef );
+					log( 0, "Created file '%s', geometry %u:%u:%u, size %.2lf %cB", name, p_cyl, p_head, p_sect, sizef, sizeChar );
 				cf.Close();
 			}
Index: /trunk/Serial_Server/library/Image.cpp
===================================================================
--- /trunk/Serial_Server/library/Image.cpp	(revision 258)
+++ /trunk/Serial_Server/library/Image.cpp	(revision 259)
@@ -12,22 +12,31 @@
 #include <stdio.h>
 
-struct floppyInfo {
-	unsigned long size;
-	unsigned char type;
-	unsigned char cylinders;
-	unsigned char heads;
-	unsigned char sectors;
-} floppyInfos[] = 
-{
-{ 2949120 / 512, 6, 80, 2, 36 },   // 2.88MB 3.5"
-{ 1474560 / 512, 4, 80, 2, 18 },        // 1.44MB 3.5"
-{ 1228800 / 512, 2, 80, 2, 15 },     // 1.2MB 5.25"
-{ 737280 / 512, 3, 80, 1, 18 },    // 720KB 3.5"
-{ 368640 / 512, 1, 40, 2, 9 }, // 360KB 5.25"
-{ 327680 / 512, 0, 40, 2, 8 }, // 320KB 5.25"
-{ 184320 / 512, 0, 40, 1, 9 }, // 180KB 5.25" single sided
-{ 163840 / 512, 0, 40, 1, 8 }, // 160KB 5.25" single sided
-{ 0, 0, 0, 0, 0 }
+struct floppyInfo floppyInfos[] = 
+{
+	{ 1, 2949120 / 512, 6, 80, 2, 36 },   		// 2.88MB 3.5"
+	{ 0, 2867200 / 512, 6, 80, 2, 36 },   		// 2.88MB 3.5" (alternate spelling with 2.8)
+	{ 0, 2969600 / 512, 6, 80, 2, 36 },   		// 2.88MB 3.5" (alternate spelling with 2.9)
+	{ 1, 1474560 / 512, 4, 80, 2, 18 },         // 1.44MB 3.5"
+	{ 0, 1433600 / 512, 4, 80, 2, 18 },         // 1.44MB 3.5" (alternate spelling with 1.4)
+	{ 1, 1228800 / 512, 2, 80, 2, 15 },     	// 1.2MB 5.25"
+	{ 1, 737280 / 512, 3, 80, 1, 18 },    		// 720KB 3.5"
+	{ 1, 368640 / 512, 1, 40, 2, 9 }, 			// 360KB 5.25"
+	{ 1, 327680 / 512, 0, 40, 2, 8 }, 			// 320KB 5.25"
+	{ 1, 184320 / 512, 0, 40, 1, 9 }, 			// 180KB 5.25" single sided
+	{ 1, 163840 / 512, 0, 40, 1, 8 }, 			// 160KB 5.25" single sided
+	{ 0, 0, 0, 0, 0, 0 }
 };
+
+struct floppyInfo *FindFloppyInfoBySize( double size )
+{
+	struct floppyInfo *fi;
+
+	for( fi = floppyInfos; fi->size != 0 && !(size+5 > fi->size && size-5 < fi->size); fi++ ) ;
+
+	if( fi->size == 0 )
+		fi = NULL;
+
+	return( fi );
+}
 
 Image::Image( char *name, int p_readOnly, int p_drive )
@@ -69,5 +78,5 @@
 
 	floppy = 0;
-	for( f = floppyInfos; f->size && f->size != totallba; f++ ) ;
+	for( f = floppyInfos; f->size && !(f->size == totallba && f->real); f++ ) ;
 	if( f->size )
 	{
@@ -78,4 +87,5 @@
 		p_head = f->heads;
 		p_sect = f->sectors;
+		totallba = p_cyl * p_head * p_sect;
 	}
 
Index: /trunk/Serial_Server/library/Library.h
===================================================================
--- /trunk/Serial_Server/library/Library.h	(revision 258)
+++ /trunk/Serial_Server/library/Library.h	(revision 259)
@@ -15,4 +15,15 @@
 
 unsigned short checksum( unsigned short *wbuff, int wlen );
+
+struct floppyInfo {
+	unsigned char real;
+	unsigned long size;
+	unsigned char type;
+	unsigned char cylinders;
+	unsigned char heads;
+	unsigned char sectors;
+};
+
+struct floppyInfo *FindFloppyInfoBySize( double size );
 
 class Image
Index: /trunk/Serial_Server/win32/Win32.cpp
===================================================================
--- /trunk/Serial_Server/win32/Win32.cpp	(revision 258)
+++ /trunk/Serial_Server/win32/Win32.cpp	(revision 259)
@@ -30,4 +30,5 @@
 		"  -n [megabytes]      Create new disk with given size or use -g geometry",
 		"                      Maximum size is " USAGE_MAXSECTORS, 
+		"                      Floppy images can also be created, such as \"360K\"",
 		"                      (default is a 32 MB disk, with CHS geometry 65:16:63)",
 		"",
@@ -160,8 +161,25 @@
 				if( atol(argv[t+1]) != 0 )
 				{
-					unsigned long size = atol(argv[++t]);
-					sect = 63;
-					head = 16;
-					cyl = (size*1024*2) / (16*63);
+					double size = atof(argv[++t]);
+					struct floppyInfo *fi;
+					char *c;
+
+					size *= 2;
+					for( c = argv[t]; *c && *c != 'k' && *c != 'K'; c++ ) ;
+					if( !(*c) )
+						size *= 1000;
+
+					if( (fi = FindFloppyInfoBySize( size )) )
+					{
+						sect = fi->sectors;
+						head = fi->heads;
+						cyl = fi->cylinders;
+					}
+					else
+					{
+						sect = 63;
+						head = 16;
+						cyl = size / (16*63);
+					}
 				}
 				break;
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 258)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 259)
@@ -23,8 +23,7 @@
 	mov		bp, sp
 
-	call	RamVars_IsDriveHandledByThisBIOS				
+	call	RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber
 	jc		.notOurs
 
-	call	FindDPT_ForDriveNumber					; if it is one of ours, print the string in bootnfo
 	call	BootMenuInfo_ConvertDPTtoBX
 	mov		si, g_szDriveNumBOOTNFO					; special g_szDriveNum that prints from BDA
@@ -112,15 +111,12 @@
 	mov		si, g_szCapacity							; Setup print string now, carries through to print call
 
-	xor		di, di
-	call	RamVars_IsDriveHandledByThisBIOS
-	jc		SHORT .notours
-	call	FindDPT_ForDriveNumber						; DS:DI to point DPT
-.notours:		
-		
+	xor		di, di										; Zero DI for checks for our drive later on
+	call	RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber
+
 	test	dl, dl										; are we a hard disk?
-	js		BootMenuPrint_HardDiskRefreshInformation		
-
-	test	di,di
-	jnz		.ours
+	js		BootMenuPrint_HardDiskRefreshInformation	
+
+	test	di, di
+	jnz		.ours										; Based on CF from RamVars_IsDriveHandledByThisBIOS above
 	call	FloppyDrive_GetType							; Get Floppy Drive type to BX
 	jmp		.around
@@ -187,5 +183,4 @@
 ; BootMenuPrint_HardDiskMenuitemInformation
 ;	Parameters:
-;		DL:		Untranslated Hard Disk number
 ;		DS:		RAMVARS segment
 ;	Returns:
@@ -196,12 +191,10 @@
 ALIGN JUMP_ALIGN
 BootMenuPrint_HardDiskRefreshInformation:		
-	test	di,di
+	test	di, di
 	jz		.HardDiskMenuitemInfoForForeignDrive		
 
 .HardDiskMenuitemInfoForOurDrive:
-	ePUSH_T	ax, g_szInformation
-
-	; Get and push total LBA size
-	call	BootMenuInfo_GetTotalSectorCount
+	ePUSH_T ax, g_szInformation						; Add substring for our hard disk information
+	call	BootMenuInfo_GetTotalSectorCount		; Get Total LBA Size
 	jmp		.ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
 		
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 258)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 259)
@@ -22,4 +22,28 @@
 	eMOVZX	bx, dl						; Copy requested drive to BL, zero BH to assume no errors
 	call	ResetFloppyDrivesWithInt40h
+
+%ifdef MODULE_SERIAL_FLOPPY
+;
+; "Reset" emulatd serial floppy drives, if any.  There is nothing to actually do for this reset,
+; but record the proper error return code if one of these floppy drives is the drive requested.
+;
+	call	RamVars_UnpackFlopCntAndFirstToAL
+	cbw													; Clears AH (there are flop drives) or ffh (there are not)
+														; Either AH has success code (flop drives are present)
+														; or it doesn't matter because we won't match drive ffh
+
+	cwd													; clears DX (there are flop drives) or ffffh (there are not)
+
+	adc		dl, al										; second drive (CF set) if present
+														; If no drive is present, this will result in ffh which 
+														; won't match a drive
+	call	BackupErrorCodeFromTheRequestedDriveToBH
+	mov		dl, al										; We may end up doing the first drive twice (if there is
+	call	BackupErrorCodeFromTheRequestedDriveToBH	; only one drive), but doing it again is not harmful.
+%endif
+
+	test	bl, bl										; If we were called with a floppy disk, then we are done,
+	jns		SHORT .SkipHardDiskReset					; don't do hard disks.
+		
 	call	ResetForeignHardDisks
 	call	AH0h_ResetHardDisksHandledByOurBIOS
@@ -129,27 +153,7 @@
 	jb		SHORT .DriveResetLoop		;  If not, reset next drive
 .AllDrivesReset:
-%ifdef MODULE_SERIAL_FLOPPY
-;
-; "Reset" emulatd serial floppy drives, if any.  There is nothing to actually do for this reset,
-; but record the proper error return code if one of these floppy drives is the drive requested.
-;
-	call	RamVars_UnpackFlopCntAndFirstToAL
-
-	cbw													; Clears AH (there are flop drives) or ffh (there are not)
-														; Either AH has success code (flop drives are present)
-														; or it doesn't matter because we won't match drive ffh
-
-	cwd													; clears DX (there are flop drives) or ffffh (there are not)
-
-	adc		dl, al										; second drive (CF set) if present
-														; If no drive is present, this will result in ffh which 
-														; won't match a drive
-	call	BackupErrorCodeFromTheRequestedDriveToBH
-	mov		dl, al										; We may end up doing the first drive twice (if there is
-	jmp		BackupErrorCodeFromTheRequestedDriveToBH	; only one drive), but doing it again is not harmful.
-%else
-	ret
-%endif
-		
+	ret
+
+				
 ;--------------------------------------------------------------------
 ; .BackupErrorCodeFromMasterOrSlaveToBH
Index: /trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 258)
+++ /trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 259)
@@ -72,14 +72,12 @@
 .StoreDptPointersToIntVectors:
 	mov		dl, 80h
-	call	RamVars_IsDriveHandledByThisBIOS
+	call	RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber   ; DPT to DS:DI
 	jc		SHORT .FindForDrive81h	; Store nothing if not our drive
-	call	FindDPT_ForDriveNumber	; DPT to DS:DI
 	mov		[es:HD0_DPT_POINTER_41h*4], di
 	mov		[es:HD0_DPT_POINTER_41h*4+2], ds
 .FindForDrive81h:
 	inc		dx
-	call	RamVars_IsDriveHandledByThisBIOS
+	call	RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber
 	jc		SHORT .ResetDetectedDrives
-	call	FindDPT_ForDriveNumber
 	mov		[es:HD1_DPT_POINTER_46h*4], di
 	mov		[es:HD1_DPT_POINTER_46h*4+2], ds
Index: /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 258)
+++ /trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 259)
@@ -23,7 +23,6 @@
 	add		al, [RAMVARS.xlateVars+XLATEVARS.bFlopCreateCnt]
 %endif
-	xchg	ax, dx		
-	; Fall to FindDPT_ForDriveNumber
-
+	xchg	ax, dx
+	; fall-through to FindDPT_ForDriveNumber
 
 ;--------------------------------------------------------------------
@@ -66,5 +65,27 @@
 	xchg	di, ax						; Restore AX and put result in DI
 	pop		dx
-	ret
+		
+	ret
+
+;--------------------------------------------------------------------
+; Consolidator for checking the result from RamVars_IsDriveHandledByThisBIOS
+; and then if it is our drive, getting the DPT with FindDPT_ForDriveNumber
+;
+; RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber
+;	Parameters:
+;		DL:		Drive number
+;		DS:		RAMVARS segment
+;	Returns:
+;		DS:DI:	Ptr to DPT, if it is our drive
+;       CF:     Set if not our drive, clear if it is our drive
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber:
+	call	RamVars_IsDriveHandledByThisBIOS
+	jnc		FindDPT_ForDriveNumber
+	ret
+
 
 ;--------------------------------------------------------------------
@@ -212,10 +233,10 @@
 	push	cx
 
-	mov		cl, [RAMVARS.bDrvCnt]		
-	mov		ch, 0
-		
 	mov		di, RAMVARS_size			; Point DS:DI to first DPT
 		
-	jcxz	.NotFound					; Return if no drives
+	mov		cl, [RAMVARS.bDrvCnt]
+	xor		ch, ch						; Clears CF  
+		
+	jcxz	.AllDptsIterated			; Return if no drives, CF will be clear from xor above
 		
 ALIGN JUMP_ALIGN
@@ -223,9 +244,8 @@
 	call	si							; Is wanted DPT?
 	jc		SHORT .AllDptsIterated		;  If so, return
-	add		di, BYTE LARGEST_DPT_SIZE	; Point to next DPT
+	add		di, BYTE LARGEST_DPT_SIZE	; Point to next DPT, clears CF
 	loop	.LoopWhileDPTsLeft
-		
-.NotFound:		
-	clc									; Clear CF since DPT not found
+	
+	; fall-through: DPT was not found, CF is already clear from ADD di inside the loop
 		
 ALIGN JUMP_ALIGN
@@ -233,2 +253,3 @@
 	pop		cx
 	ret
+
