date and time created 86/07/05 17:37:35 by sam
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 6 Jul 1986 08:37:35 +0000 (00:37 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 6 Jul 1986 08:37:35 +0000 (00:37 -0800)
SCCS-vsn: sys/tahoe/stand/vdformat/help.c 1.1
SCCS-vsn: sys/tahoe/stand/vdformat/info.c 1.1

usr/src/sys/tahoe/stand/vdformat/help.c [new file with mode: 0644]
usr/src/sys/tahoe/stand/vdformat/info.c [new file with mode: 0644]

diff --git a/usr/src/sys/tahoe/stand/vdformat/help.c b/usr/src/sys/tahoe/stand/vdformat/help.c
new file mode 100644 (file)
index 0000000..00a180e
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef lint
+static char sccsid[] = "@(#)help.c     1.1 (Berkeley/CCI) %G%";
+#endif
+
+#include       "vdfmt.h"
+#include       "cmd.h"
+
+/*
+**     These routines are used to display all the system help messages
+** that the operator requests.  They look through the system command 
+** tables to print the commands and the help messages in a neat mannor.
+**
+**     The only break in this rule is the help processor for digit entry
+** Which informs the operator what numeric range is valid.
+*/
+
+help_text(tbl)
+cmd_text_element       *tbl;
+{
+       indent();
+       print_common_help();
+       indent();
+       while(tbl->cmd_token != 0) {
+               register int    count;
+
+               count = 9 - strlen(tbl->cmd_text);
+               print("%s", tbl->cmd_text);
+               while(count--)
+                       putchar(' ');
+               printf("- %s.\n", tbl->cmd_help);
+               tbl++;
+       }
+       exdent(2);
+       print("\n");
+}
+
+
+/*
+**
+*/
+
+print_common_help()
+{
+       print("The following commands are available:\n");
+       indent();
+       print("%s - %s.\n", "KILL    ", "Abort all operations");
+       print("%s - %s.\n", "STATus  ", "Display formatter state");
+       exdent(1);
+}
diff --git a/usr/src/sys/tahoe/stand/vdformat/info.c b/usr/src/sys/tahoe/stand/vdformat/info.c
new file mode 100644 (file)
index 0000000..c9bdc1b
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef lint
+static char sccsid[] = "@(#)info.c     1.1 (Berkeley/CCI) %G%";
+#endif
+
+#include       "vdfmt.h"
+
+/*
+**
+*/
+
+info()
+{
+       extern boolean  read_bad_sector_map();
+       boolean         has_map;
+
+       cur.state = inf;
+       print("Gathering information for ");
+       printf("controller %d, drive %d.\n\n", cur.controller, cur.drive);
+
+       has_map = read_bad_sector_map();
+       print("Module serial number is %d.\n", bad_map->bs_id);
+       print("Drive type is %s.\n", CURRENT->vc_name);
+       if(has_map == true)
+               print("Drive contains a bad sector map.\n");
+       else
+               print("Drive does not contain a bad sector map.\n");
+       print_bad_sector_list();
+       print("Information display completed successfully.\n");
+}
+