Only in fd: bin
Only in edr: copying
diff -u -r fd/doc/format/bugs.txt edr/doc/format/bugs.txt
--- fd/doc/format/bugs.txt	2005-02-24 14:17:07.000000000 +0100
+++ edr/doc/format/bugs.txt	2005-05-30 18:20:12.000000000 +0200
@@ -1,3 +1,10 @@
+Known bugs/problems in DR-DOS FORMAT v1.0:
+
+- At least in the Watcom C compiled version, FORMAT will display
+  "Stack Overflow" on exit. I do not know what causes this, but the
+  other functions do not seem to be affected by this.
+
+-------------------------------------------------------------------------------
 Known bugs and problems (in 0.91k / known by Brian or Eric):
 *** = bug which is definitely still an issue in 0.91t...
 Please test and tell if the non-*** problems are REALLY fixed now!
diff -u -r fd/doc/format/contrib.txt edr/doc/format/contrib.txt
--- fd/doc/format/contrib.txt	2005-04-27 03:00:06.000000000 +0200
+++ edr/doc/format/contrib.txt	2005-05-30 18:28:32.000000000 +0200
@@ -29,6 +29,9 @@
 Eric Auer           Many changes, bug fixes and improvements for
                     versions 0.90b ... 0.91u in 2003, 2004 and 2005.
 
+Udo Kuhnt           Specific changes for Enhanced DR-DOS 7.01.0x, also
+                    other fixes and enhancements
+
 Additional tests    2003/2004: Bernd Blaauw, Wilhelm Spiegl, Geraldo
                     Netto, David Flechl, Johnson Lam, Tyler H. D.,
                     Matthew Gruett and many others before. Using DOS
diff -u -r fd/doc/format/help.txt edr/doc/format/help.txt
--- fd/doc/format/help.txt	2005-05-25 02:09:47.000000000 +0200
+++ edr/doc/format/help.txt	2005-05-30 18:25:26.000000000 +0200
@@ -13,6 +13,7 @@
  /Q         Quick formats the disk. If not combined with /U, can be UNFORMATed
             and bad cluster list is preserved (not preserved in /Q /U mode).
  /U         Unconditionally formats the disk. Lowlevel format if floppy disk.
+ /C:clsize  Specifies the cluster size (in sectors) to be used for formatting.
  /F:size    Specifies the size of the floppy disk to format. Normal sizes are:
             360, 720, 1200, 1440, or 2880 (unit: kiloBytes). /F:0 shows a list.
  /4         Formats a 360k floppy disk in a 1.2 MB floppy drive. As 1.2 MB
@@ -45,6 +46,7 @@
  /Q /U      Quick formats the disk but does NOT preserve unformat data and
             does NOT wipe or scan the surface. Just deletes everything FAST.
             *** This is the default if an unformatted harddisk is detected.
+ /C:clsize  Specifies the cluster size (in sectors) to be used for formatting.
  /F:size    Specifies the size of the floppy disk to format. Normal sizes are:
               160, 180, 320, 360, 720, 1200, 1440, or 2880. To format to 720k
             in a drive which can do 1440k or more, you must use 720k DD media.
diff -u -r fd/doc/format/news.txt edr/doc/format/news.txt
--- fd/doc/format/news.txt	2005-05-25 02:05:03.000000000 +0200
+++ edr/doc/format/news.txt	2005-05-29 19:40:40.000000000 +0200
@@ -2,6 +2,16 @@
 
 Version History:
 
+DR FORMAT v1.0 (28 May 2005)
+              Changes by Udo Kuhnt to support Enhanced DR-DOS
+              - some strings changed
+              - accept FS Info Sector/Backup Boot Sector independent of
+                number of reserved sectors
+              - accept FS Info Sector in sector 2
+              - support for 128K cluster size, warning added
+              - use Kbytes instead of bytes on 128K cluster drives
+              - new option /C:clsize to override cluster size in BPB
+
 Version 0.91u (27 Apr 2005 / 25 May 2005)
               Changes by Eric Auer ("charset research" by Wilhelm Spiegl)
               - volume label prompt and volume label command line option
diff -u -r fd/doc/format/readme.txt edr/doc/format/readme.txt
--- fd/doc/format/readme.txt	2005-02-15 19:11:29.000000000 +0100
+++ edr/doc/format/readme.txt	2005-05-30 18:31:50.000000000 +0200
@@ -23,7 +23,8 @@
              responsibility for the program's execution.
 
 Operating    Systems this program is known to work under:
-             FreeDOS ("normal" and for DOSEMU image drives), MS-DOS 6.22
+             FreeDOS ("normal" and for DOSEMU image drives), MS-DOS 6.22,
+             Enhanced DR-DOS 7.01.0x
 
 Windows:     Windows NT / 2000 / XP / 2003 (.NET) will not allow any DOS
              program to format an harddisk partition. Windows 95 / 98 /
diff -u -r fd/source/format/bcread.c edr/source/format/bcread.c
--- fd/source/format/bcread.c	2005-02-15 18:59:47.000000000 +0100
+++ edr/source/format/bcread.c	2005-05-27 01:23:38.000000000 +0200
@@ -126,7 +126,7 @@
           bad_sector_map_pointer--; /* too-many-bad-clusters workaround! */
         }
         bad_sector_map[bad_sector_map_pointer] =
-          cluststart + ((j+i-2) * parameter_block.bpb.sectors_per_cluster);
+          cluststart + ((j+i-2) * ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1));
         bad_sector_map_pointer++;
         countbad++;
       }
@@ -145,7 +145,7 @@
   printf("\n Cluster stats: %lu used, %lu bad, %lu items, %lu last.\n",
     countused, countbad, countitems, last_used);
   return ( cluststart +
-    ( (1+last_used-2) * parameter_block.bpb.sectors_per_cluster ) - 1 );
+    ( (1+last_used-2) * ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1) ) - 1 );
     /* we round up to the END of the cluster */
 } /* BadClustPreserve32 */
 
@@ -204,7 +204,7 @@
           bad_sector_map_pointer--; /* too-many-bad-clusters workaround! */
         }
         bad_sector_map[bad_sector_map_pointer] =
-          cluststart + ((j+i-2) * parameter_block.bpb.sectors_per_cluster);
+          cluststart + ((j+i-2) * ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1));
         bad_sector_map_pointer++;
         countbad++;
       }
@@ -216,7 +216,7 @@
   printf("\n Cluster stats: %lu used, %lu bad, %lu items, %lu last.\n",
     countused, countbad, countitems, last_used);
   return ( cluststart +
-    ( (1+last_used-2) * parameter_block.bpb.sectors_per_cluster ) - 1 );
+    ( (1+last_used-2) * ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1) ) - 1 );
     /* we round up to the END of the cluster */
 } /* BadClustPreserve16 */
 
@@ -270,7 +270,7 @@
         bad_sector_map_pointer--; /* too-many-bad-clusters workaround! */
       }
       bad_sector_map[bad_sector_map_pointer] =
-        cluststart + ((clust-2) * parameter_block.bpb.sectors_per_cluster);
+        cluststart + ((clust-2) * ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1));
       bad_sector_map_pointer++;
     }
     if (clustb > 0xff0) {
@@ -280,7 +280,7 @@
         bad_sector_map_pointer--; /* too-many-bad-clusters workaround! */
       }
       bad_sector_map[bad_sector_map_pointer] =
-        cluststart + ((clust+1-2) * parameter_block.bpb.sectors_per_cluster);
+        cluststart + ((clust+1-2) * ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1));
       bad_sector_map_pointer++;
     }
     if (clusta > 0) {
@@ -297,7 +297,7 @@
   printf("\n Cluster stats: %lu used, %lu bad, %lu items, %lu last.\n",
     countused, countbad, countitems, last_used);
   return ( cluststart +
-    ( (1+last_used-2) * parameter_block.bpb.sectors_per_cluster ) - 1 );
+    ( (1+last_used-2) * ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1) ) - 1 );
     /* we round up to the END of the cluster */
 } /* BadClustPreserve12 */
 
diff -u -r fd/source/format/createfs.c edr/source/format/createfs.c
--- fd/source/format/createfs.c	2005-05-25 01:55:34.000000000 +0200
+++ edr/source/format/createfs.c	2005-05-28 03:39:24.000000000 +0200
@@ -111,6 +111,7 @@
           parameter_block.xbpb.file_system_version);
         parameter_block.xbpb.file_system_version = 0;
       }
+#if 0
       if ( (parameter_block.xbpb.info_sector_number == 0) ||
            (parameter_block.xbpb.backup_boot_sector == 0) ||
            (parameter_block.xbpb.info_sector_number == 0xffff) || /* new 0.91p */
@@ -138,6 +139,7 @@
               parameter_block.xbpb.backup_boot_sector = 0xffff;
             }
         } /* Win98se fix added 20 jan 2004 0.91L */
+#endif
 
       E_memcpy(&sector_buffer[where], (void *)&parameter_block.xbpb,
         sizeof(FAT32_BPB) ); /* was [36] and 63-36+1 */
@@ -202,7 +204,8 @@
     }
 
   /* Add OEM ID */
-  memcpy(&bs_start.oem_id,"FRDOS4.1", 8);    /* new 0.91p, was FDOS_1.0 */
+  memcpy(&bs_start.oem_id,"DRDOS7.0", 8);
+/*  memcpy(&bs_start.oem_id,"FRDOS4.1", 8);*/    /* new 0.91p, was FDOS_1.0 */
   /* OEM ID is 5 uppercase chars, digit, dot, digit, to please Windoze. */
   /* Win9x+ itself uses OEM IDs like "MSWIN4.1" ... */
   /* According to John Elliot, MS wants at least "?????3.3" */
@@ -278,12 +281,12 @@
 
   fs_info_sector.free_count         = file_sys_info.total_clusters -
     ( file_sys_info.number_root_dir_sect
-      / parameter_block.bpb.sectors_per_cluster ); /* root dir consumes clusters! */
+      / ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1) ); /* root dir consumes clusters! */
 
 #if 0 /* more correct but not even MS FORMAT seems to use that value! */
   fs_info_sector.next_free          = 2UL + /* 2 based counting */
     ( file_sys_info.number_root_dir_sect
-      / parameter_block.bpb.sectors_per_cluster ); /* root dir consumes clusters! */
+      / ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1) ); /* root dir consumes clusters! */
 #else
   fs_info_sector.next_free          = 2UL;
 #endif
@@ -317,12 +320,12 @@
   if (param.fat_type != FAT32) /* in FAT32, root dir uses normal clusters */
     totalsect -= file_sys_info.number_root_dir_sect;
 
-  if (parameter_block.bpb.sectors_per_cluster==0) {
+  if ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1==0) {
     printf("0 sectors/cluster in BPB!? Aborting.\n");
     Exit(4,20);
   } /* new 0.91b sanity check */
 
-  return (totalsect / parameter_block.bpb.sectors_per_cluster);
+  return (totalsect / ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1));
 }
 
 
@@ -376,7 +379,7 @@
       unsigned long rdent = 512; /* default number of root dir entries */
 
       entries_per_cluster = parameter_block.bpb.bytes_per_sector / 32;
-      entries_per_cluster *= parameter_block.bpb.sectors_per_cluster;
+      entries_per_cluster *= (BT8)(parameter_block.bpb.sectors_per_cluster-1)+1;
 
       parameter_block.bpb.root_directory_entries = 0; /* must be 0 for FAT32 */
 
@@ -557,8 +560,10 @@
     if ( ((parameter_block.xbpb.info_sector_number + use_backups) >=
           parameter_block.bpb.reserved_sectors) ||
           (parameter_block.xbpb.info_sector_number == 0xffff) ||
-          (parameter_block.xbpb.info_sector_number < 1) || /* 0.91k */
-          (parameter_block.xbpb.info_sector_number == 2)   /* 0.91L */
+          (parameter_block.xbpb.info_sector_number < 1) /* 0.91k */
+#if 0
+          || (parameter_block.xbpb.info_sector_number == 2) /*??*/ /* 0.91L */
+#endif
        )
       {
         if (parameter_block.xbpb.info_sector_number == 0xffff)
@@ -714,7 +719,7 @@
     /* ADDED CLUSTER CHAIN CREATION - 0.91e, fixed 0.91i+ */
     sbp = 8;
     nclust = file_sys_info.number_root_dir_sect;
-    nclust /= parameter_block.bpb.sectors_per_cluster;
+    nclust /= ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1);
     printf(" Optimized initial Root Directory size: %lu clusters.\n",
       nclust);
     cnum = 2; /* first data cluster has number 2, not 0...: 2 based counting */
diff -u -r fd/source/format/floppy.c edr/source/format/floppy.c
--- fd/source/format/floppy.c	2005-05-25 02:32:19.000000000 +0200
+++ edr/source/format/floppy.c	2005-05-27 16:56:00.000000000 +0200
@@ -982,7 +982,7 @@
     / parameter_block.bpb.bytes_per_sector;
 
   drive_statistics.sect_in_each_allocation_unit =
-    (unsigned long)parameter_block.bpb.sectors_per_cluster;
+    (unsigned long)((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1);
 
   drive_statistics.bad_sectors = 0; /* 0.91c */
   drive_statistics.bytes_per_sector =
diff -u -r fd/source/format/format.h edr/source/format/format.h
--- fd/source/format/format.h	2005-04-27 02:03:40.000000000 +0200
+++ edr/source/format/format.h	2005-05-29 18:23:48.000000000 +0200
@@ -132,6 +132,7 @@
   int s;
   int t;
   int n;
+  int c;
   int one;
   int four;
   int eight;
@@ -140,6 +141,7 @@
   unsigned long cylinders;
   unsigned long sectors;
   unsigned long sides; /* for /1 processing -ea */
+  unsigned long clsize;
 
   } FP;
 
diff -u -r fd/source/format/hdisk.c edr/source/format/hdisk.c
--- fd/source/format/hdisk.c	2005-02-15 18:25:39.000000000 +0100
+++ edr/source/format/hdisk.c	2005-05-29 20:58:18.000000000 +0200
@@ -277,6 +277,8 @@
 
   Get_Device_Parameters(); /* read the default BPB etc., find FAT type */
 
+  if (param.c==TRUE && param.clsize>0) parameter_block.bpb.sectors_per_cluster=param.clsize;
+
   if ((param.fat_type == FAT32) && (alignment > 1)) /* new feature in 0.91m */
     {
       unsigned int mask = 3;
@@ -344,19 +346,25 @@
       Exit(4,58);
     }
 
-  i = parameter_block.bpb.sectors_per_cluster;
+  i = (BT8)(parameter_block.bpb.sectors_per_cluster-1)+1;
+  if (i == 256)
+    {
+      printf("WARNING: Cluster size is 128K. This will cause problems with some DOS versions.\n");
+      printf("  Enhanced DR-DOS, WinNT and supposedly some versions of PTS-DOS support this.\n");
+    /* Examples of systems which do support 128k cluster size: EDR-DOS and PTS-DOS */
+    }
   if (i == 128)
     {
-      printf("WARNING: Cluster size is 64k. Will not work with Win9x or MS DOS!\n");
-      printf("  WinME, WinNT/2k/XP/2003 and FreeDOS will be okay, though.\n");
-    /* Examples of systems which do support 64k cluster size: FreeDOS and WinXP */
-    }
-  while ((i < 128) && (i != 0)) 
-    i += i;	/* shift left until 64k / cluster */
-  if (i != 128) /* SANITY CHECK */
+      printf("WARNING: Cluster size is 64K. This will cause problems with some DOS versions.\n");
+      printf("  Enhanced DR-DOS, FreeDOS, WinNT and supposedly MS-DOS 8.0 support this.\n");
+    /* Examples of systems which do support 64k cluster size: EDR-DOS and FreeDOS */
+    }
+  while ((i < 256) && (i != 0)) 
+    i += i;	/* shift left until 128k / cluster */
+  if (i != 256) /* SANITY CHECK */
     {
-    i = parameter_block.bpb.sectors_per_cluster;
-    printf("FATAL: Cluster size not 0.5, 1, 2, 4, 8, 16, 32 or 64k but %d.%dk!\n",
+    i = (BT8)(parameter_block.bpb.sectors_per_cluster-1)+1;
+    printf("FATAL: Cluster size not 0.5, 1, 2, 4, 8, 16, 32, 64 or 128k but %d.%dk!\n",
       i/2, (i & 1) ? 5 : 0);
     Exit(4,59);
     }
@@ -396,7 +404,7 @@
 
   /* changed 0.91i */
   drive_statistics.sect_available_on_disk = file_sys_info.total_clusters
-    * parameter_block.bpb.sectors_per_cluster;
+    * ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1);
 
   if (param.fat_type == FAT32)
     drive_statistics.sect_available_on_disk -= file_sys_info.number_root_dir_sect;
@@ -406,7 +414,7 @@
   unsigned long slack = drive_statistics.sect_available_on_disk;
 
   drive_statistics.sect_available_on_disk &=
-    ~( (unsigned long) ( parameter_block.bpb.sectors_per_cluster - 1 ) );
+    ~( (unsigned long) ( (BT8)(parameter_block.bpb.sectors_per_cluster - 1) ) );
 
   slack -= drive_statistics.sect_available_on_disk;
 
@@ -421,7 +429,7 @@
   /* now "total" is "diskimage" size and "avail" is "free in data area" size. */
 
   drive_statistics.sect_in_each_allocation_unit =
-    parameter_block.bpb.sectors_per_cluster;
+    (BT8)(parameter_block.bpb.sectors_per_cluster-1)+1;
    
   /* 0.91k - already tell the user what she has to expect size-wise */
   if (drive_statistics.bytes_per_sector == 512) {
diff -u -r fd/source/format/main.c edr/source/format/main.c
--- fd/source/format/main.c	2005-05-25 00:58:14.000000000 +0200
+++ edr/source/format/main.c	2005-05-29 21:00:40.000000000 +0200
@@ -229,6 +229,8 @@
 
   int drive_letter_found = FALSE;
 
+  int i=0;
+
   Initialization();
 
 
@@ -256,7 +258,7 @@
 
   /* (jh) check command line */
 
-  while (  (index = getopt (argc, argv, "V:v:Z:z:QqUuBbSsYyAa148F:f:T:t:N:n:/")) != EOF)
+  while (  (index = getopt (argc, argv, "V:v:Z:z:QqUuBbSsYyAa148F:f:T:t:N:n:C:c:/")) != EOF)
     {
       switch(index)
 	{
@@ -413,6 +415,29 @@
 	    }
 	  break;
 
+	case 'C': /* cluster size (sectors) */
+	case 'c': /* cluster size (sectors) */
+	  param.c = TRUE;
+	  n = atoi (optarg + 1);
+
+	  i=1;
+	  while (i<=256) {
+	    if (i==n) {
+	      param.clsize=n;
+	      break;
+	    }
+	    if (i>n) break;
+	  i*=2;
+	  }
+
+	  printf("Test %d,%d\n",i,n);
+
+	  if (i!=n) {
+	    printf("Supported cluster sizes: 1,2,4,8,16,32,64,128 or 256 sectors\n");
+	    IllegalArg("/C",optarg);
+	  }
+	  break;
+
 	case '~':
 	  param.drive_letter[0] = toupper (optarg[0]);
 	  param.drive_number = param.drive_letter[0] - 'A';
@@ -458,7 +483,7 @@
   /* if FORMAT is typed with a drive letter */
 
   if (debug_prog==TRUE) {
-    printf("\n[DEBUG]  FORMAT " VERSION ", selected drive %c:\n",
+    printf("\n[DEBUG]  DR-DOS FORMAT v1.0 (based on FreeDOS FORMAT " VERSION "), selected drive %c:\n",
       param.drive_letter[0]);
     printf("[DEBUG]  Sector buffer at %04x:%04x, track buffer at %04x:%04x\n",
       FP_SEG(sector_buffer), FP_OFF(sector_buffer),
diff -u -r fd/source/format/recordbc.c edr/source/format/recordbc.c
--- fd/source/format/recordbc.c	2005-02-15 18:11:10.000000000 +0100
+++ edr/source/format/recordbc.c	2005-05-27 01:15:30.000000000 +0200
@@ -40,7 +40,7 @@
 
 void Record_Bad_Clusters(void)
 {
-  if (parameter_block.bpb.sectors_per_cluster == 0)
+  if ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1 == 0)
     {
     /* Terminate the program... internal error in FORMAT */
     printf("\nInternal R.B.C. error!\n");
@@ -112,8 +112,8 @@
     /* Translate the sector into a cluster number. */
     /* *** is this correct? *** */
     bad_cluster = ( (bad_sector_map[index] - first_data_sector)
-     + parameter_block.bpb.sectors_per_cluster - 1 ) /* round up */
-       / parameter_block.bpb.sectors_per_cluster;
+     + (BT8)(parameter_block.bpb.sectors_per_cluster - 1) ) /* round up */
+       / ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1);
     bad_cluster += 2; /* 2 based counting */
 
     if (bad_cluster != last_bad_cluster)
@@ -234,8 +234,8 @@
 	/* *** changed in 0.91i - hope it is correct now??? *** */
 	bad_cluster = (
 	   (bad_sector_map[bad_sector_map_index] - first_data_sector)
-	   + parameter_block.bpb.sectors_per_cluster - 1 ) /* round up */
-	 / parameter_block.bpb.sectors_per_cluster;
+	   + (BT8)(parameter_block.bpb.sectors_per_cluster - 1) ) /* round up */
+	 / ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1);
 	bad_cluster += 2; /* 2 based counting */
 	}
       else
@@ -244,7 +244,7 @@
       if ( (bad_cluster != last_bad_cluster) && (bad_cluster != 100000L) )
 	{
 	drive_statistics.bad_sectors +=
-	  parameter_block.bpb.sectors_per_cluster;
+	  (BT8)(parameter_block.bpb.sectors_per_cluster-1)+1;
 
 	last_bad_cluster = bad_cluster;
 	drive_statistics.allocation_units_with_bad_sectors++; /* 0.91c */
@@ -329,8 +329,8 @@
     /* *** changed in 0.91i - correct now? *** */
     bad_cluster = (
       ( bad_sector_map[bad_sector_map_index] - first_data_sector )
-      + parameter_block.bpb.sectors_per_cluster - 1 ) /* round up */
-      / parameter_block.bpb.sectors_per_cluster;
+      + (BT8)(parameter_block.bpb.sectors_per_cluster - 1) ) /* round up */
+      / ((BT8)(parameter_block.bpb.sectors_per_cluster-1)+1);
     bad_cluster += 2; /* 2 based counting */
 
     /* no extra rounding needed... 4 bytes per FAT entry. */
diff -u -r fd/source/format/savefs.c edr/source/format/savefs.c
--- fd/source/format/savefs.c	2005-05-25 01:05:06.000000000 +0200
+++ edr/source/format/savefs.c	2005-05-27 01:21:06.000000000 +0200
@@ -213,7 +213,7 @@
           }
       } /* root directory an FAT and drive size was plausible */
 
-      sectors_per_cluster = BSWord(0x0d) & 0xff; /* only a byte */
+      sectors_per_cluster = (BT8)((BSWord(0x0d) & 0xff)-1)+1; /* only a byte */
 
       if (fat_type == FAT32)
         {
@@ -267,7 +267,7 @@
   if ((fat_type == param.fat_type) &&
       (reserved_sectors == parameter_block.bpb.reserved_sectors) &&
       (number_of_fats == parameter_block.bpb.number_of_fats) &&
-      (sectors_per_cluster == parameter_block.bpb.sectors_per_cluster) &&
+      (sectors_per_cluster == (BT8)(parameter_block.bpb.sectors_per_cluster-1)+1) &&
       ( (sectors_per_fat & 0xffff) ==
         ( (fat_type == FAT32) ? parameter_block.xbpb.fat_size_low
                               : parameter_block.bpb.sectors_per_fat ) )
@@ -290,9 +290,9 @@
       if (number_of_fats != parameter_block.bpb.number_of_fats)
         printf("Number of FATs differs: FOUND %lu / PLANNED %hu\n",
           number_of_fats, parameter_block.bpb.number_of_fats);
-      if (sectors_per_cluster != parameter_block.bpb.sectors_per_cluster)
+      if (sectors_per_cluster != (BT8)(parameter_block.bpb.sectors_per_cluster-1)+1)
         printf("Cluster size differs: FOUND %lu / PLANNED %hu (sectors)\n",
-          sectors_per_cluster, parameter_block.bpb.sectors_per_cluster);
+          sectors_per_cluster, (BT8)(parameter_block.bpb.sectors_per_cluster-1)+1);
       scratch = parameter_block.xbpb.fat_size_high;
       scratch <<= 16;
       scratch |= parameter_block.xbpb.fat_size_low;
diff -u -r fd/source/format/userint.c edr/source/format/userint.c
--- fd/source/format/userint.c	2005-05-25 01:40:16.000000000 +0200
+++ edr/source/format/userint.c	2005-05-29 18:54:48.000000000 +0200
@@ -373,12 +373,12 @@
 void Display_Drive_Statistics()
 {
 
-#define DDS_unitstring ((param.fat_type == FAT32) ? "kbytes" : "bytes")
-#define DDS_factor(x) ((param.fat_type == FAT32) ? ((x)>>1) : ((x) * \
+#define DDS_unitstring (((param.fat_type == FAT32) || (drive_statistics.sect_in_each_allocation_unit == 256)) ? "kbytes" : "bytes")
+#define DDS_factor(x) (((param.fat_type == FAT32) || (drive_statistics.sect_in_each_allocation_unit == 256)) ? ((x)>>1) : ((x) * \
   drive_statistics.bytes_per_sector))
 /* a cheat: ASCII_CD_Number puts the decimal point at index 15... */
-#define DDS_dp ((param.fat_type == FAT32) ? ascii_cd_number[15] : ' ')
-#define DDS_half(x) ((param.fat_type == FAT32) ? (((x) & 1) ? "5" : "0") : "")
+#define DDS_dp (((param.fat_type == FAT32) || (drive_statistics.sect_in_each_allocation_unit == 256)) ? ascii_cd_number[15] : ' ')
+#define DDS_half(x) (((param.fat_type == FAT32) || (drive_statistics.sect_in_each_allocation_unit == 256)) ? (((x) & 1) ? "5" : "0") : "")
 
   if ((drive_statistics.bytes_per_sector != 512) && (param.fat_type == FAT32))
     printf("Not 512 bytes/sector - stats will be wrong.\n");
@@ -477,26 +477,27 @@
 /* 0.91n - if detailed is non-zero, display multi-page help screen. */
 void Display_Help_Screen(int detailed)
 {
-  printf("FreeDOS %6s Version %s\n",NAME,VERSION);
+  printf("DR-DOS Format v1.0 - based on FreeDOS %6s Version %s\n",NAME,VERSION);
   printf("Written by Brian E. Reifsnyder, Eric Auer and others.\n");
+  printf("Modified for use with Enhanced DR-DOS by Udo Kuhnt.\n");
   printf("Copyright 1999 - 2005 under the terms of the GNU GPL, Version 2.\n\n");
 
   if (detailed)
-    printf("Syntax (see documentation for more details background information):\n\n");
+    printf("Syntax (see documentation for more details background information):\n");
   else
-    printf("Syntax (see documentation or use /Z:longhelp for more options):\n\n");
+    printf("Syntax (see documentation or use /Z:longhelp for more options):\n");
 
 #if LEGACY_HELP /* with legacy stuff */
   printf("FORMAT drive: [/V[:label]] [/Q] [/U] [/F:size] [/B | /S] [/D]\n");
   printf("FORMAT drive: [/V[:label]] [/Q] [/U] [/T:tracks /N:sectors] [/B | /S] [/D]\n");
   printf("FORMAT drive: [/V[:label]] [/Q] [/U] [/4] [/B | /S] [/D]\n");
-  printf("FORMAT drive: [/Q] [/U] [/1] [/4] [/8] [/B | /S] [/D]\n\n");
+  printf("FORMAT drive: [/Q] [/U] [/1] [/4] [/8] [/B | /S] [/D]\n");
 #else /* new - without legacy stuff */
   printf("FORMAT drive: [/V[:label]] [/Q] [/U] [/F:size] [/S] [/D]\n");
   printf("FORMAT drive: [/V[:label]] [/Q] [/U] [/T:tracks /N:sectors] [/S] [/D]\n");
   /* the /4 option is a legacy shorthand for size selection: 360k in 1.2M drive */
   /* (drive type detection and "double stepping" setting are automatic on ATs.) */
-  printf("FORMAT drive: [/V[:label]] [/Q] [/U] [/4] [/S] [/D]\n\n");
+  printf("FORMAT drive: [/V[:label]] [/Q] [/U] [/4] [/S] [/D]\n");
 #endif
 
   printf(" /V:label   Specifies a volume label for the disk, stores date and time of it.\n");
@@ -511,6 +512,8 @@
   printf("            and preserves bad cluster marks (/Q /U does not).\n");
   /* preserving the bad cluster list is new in 0.91k */
   printf(" /U         Unconditionally formats the disk. Lowlevel format if floppy disk.\n");
+  printf(" /C:clsize  specifies a particular cluster size (in sectors). Supported values:\n");
+  printf("            1,2,4,8,16,32,64,128 and 256. Not all OSes support 128 and 256.\n");
 
   printf(" /F:size    Specifies the size of the floppy disk to format. Normal sizes are:\n");
   printf("            360, 720, 1200, 1440, or 2880 (unit: kiloBytes). /F:0 shows a list.\n");
