summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/shell/main_msdosfmt.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2009-04-29 08:31:27 +0000
committerChris Johns <chrisj@rtems.org>2009-04-29 08:31:27 +0000
commit07d6fd513f1c4d3c6905c880948671de1181fac2 (patch)
tree4dabf3fdd0b056bba7b0e9beb40f01277e5c2776 /cpukit/libmisc/shell/main_msdosfmt.c
parent2009-04-28 Chris Johns <chrisj@rtems.org> (diff)
downloadrtems-07d6fd513f1c4d3c6905c880948671de1181fac2.tar.bz2
2009-04-29 Chris Johns <chrisj@rtems.org>
* libcsupport/include/rtems/libio.h: Add rtems_off64_t for internal use. Update the internal off_t to the 64bit offset. * libnetworking/lib/ftpfs.c, libnetworking/lib/tftpDriver.c, libfs/src/nfsclient/src/nfs.c, libfs/src/imfs/imfs_fifo.c, libfs/src/imfs/memfile.c, libfs/src/imfs/imfs_directory.c, libfs/src/imfs/imfs.h, libfs/src/imfs/deviceio.c: Change off_t to rtems_off64_t. * libmisc/shell/main_msdosfmt.c: Add an info level so the format code can tell the user what is happening. Add more options to control the format configuration. * libfs/src/dosfs/msdos_format.c: Add a print function to display the format progress and print statements. Select a better default cluster size depending on the size of the disk. This lowers the size of the FAT on large disks. Read and maintain the MRB partition information. * libfs/src/dosfs/dosfs.h, libfs/src/dosfs/fat.h, libfs/src/dosfs/fat_file.c, libfs/src/dosfs/fat_file.h, libfs/src/dosfs/msdos.h, libfs/src/dosfs/msdos_conv.c, libfs/src/dosfs/msdos_create.c, libfs/src/dosfs/msdos_file.c, libfs/src/dosfs/msdos_handlers_dir.c, libfs/src/dosfs/msdos_handlers_file.c, libfs/src/dosfs/msdos_init.c, libfs/src/dosfs/msdos_initsupp.c, libfs/src/dosfs/msdos_misc.c, libfs/src/dosfs/msdos_mknod.c: Add long file name support. Change off_t to rtems_off64_t.
Diffstat (limited to 'cpukit/libmisc/shell/main_msdosfmt.c')
-rw-r--r--cpukit/libmisc/shell/main_msdosfmt.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/cpukit/libmisc/shell/main_msdosfmt.c b/cpukit/libmisc/shell/main_msdosfmt.c
index 12ba79e8c8..65e6e73a75 100644
--- a/cpukit/libmisc/shell/main_msdosfmt.c
+++ b/cpukit/libmisc/shell/main_msdosfmt.c
@@ -42,7 +42,8 @@ int rtems_shell_main_msdos_format(
fattype: MSDOS_FMT_FATANY,
media: 0,
quick_format: TRUE,
- cluster_align: 0
+ cluster_align: 0,
+ info_level: 0
};
const char* driver = NULL;
@@ -51,7 +52,7 @@ int rtems_shell_main_msdos_format(
for (arg = 1; arg < argc; arg++) {
if (argv[arg][0] == '-') {
switch (argv[arg][1]) {
- case 'v':
+ case 'V':
arg++;
if (arg == argc) {
fprintf (stderr, "error: no volume label.\n");
@@ -59,6 +60,15 @@ int rtems_shell_main_msdos_format(
}
rqdata.VolLabel = argv[arg];
break;
+
+ case 's':
+ arg++;
+ if (arg == argc) {
+ fprintf (stderr, "error: sectors per cluster count.\n");
+ return 1;
+ }
+ rqdata.sectors_per_cluster = rtems_shell_str2int(argv[arg]);
+ break;
case 'r':
arg++;
@@ -90,6 +100,10 @@ int rtems_shell_main_msdos_format(
}
break;
+ case 'v':
+ rqdata.info_level++;
+ break;
+
default:
fprintf (stderr, "error: invalid option: %s\n", argv[arg]);
return 1;
@@ -111,6 +125,19 @@ int rtems_shell_main_msdos_format(
}
printf ("msdos format: %s\n", driver);
+
+ if (rqdata.info_level)
+ {
+ printf (" %-20s: %s\n", "OEMName", "RTEMS");
+ printf (" %-20s: %s\n", "VolLabel", "RTEMSDisk");
+ printf (" %-20s: %i\n", "sectors per cluster", rqdata.sectors_per_cluster);
+ printf (" %-20s: %i\n", "fats", rqdata.fat_num);
+ printf (" %-20s: %i\n", "files per root dir", rqdata.files_per_root_dir);
+ printf (" %-20s: %i\n", "fat type", rqdata.fattype);
+ printf (" %-20s: %d\n", "media", rqdata.media);
+ printf (" %-20s: %d\n", "quick_format", rqdata.quick_format);
+ printf (" %-20s: %i\n", "cluster align", rqdata.cluster_align);
+ }
if (msdos_format (driver, &rqdata) < 0) {
fprintf (stderr, "error: format failed: %s\n", strerror (errno));