129537Ssam #ifndef lint
2*34668Skarels static char sccsid[] = "@(#)status.c 1.3 (Berkeley/CCI) 06/07/88";
329537Ssam #endif
429537Ssam
529537Ssam #include "vdfmt.h"
629537Ssam
729537Ssam /*
829537Ssam ** These routines are used to display the status of the formatter.
929537Ssam */
1029537Ssam
status()1129537Ssam status()
1229537Ssam {
1329537Ssam indent();
1429537Ssam switch (cur.state) {
1529537Ssam case cmd :
1629537Ssam print("Waiting for operator response.\n");
1729537Ssam break;
1829537Ssam case fmt :
1929537Ssam dump_state("Formatting");
2029537Ssam break;
2129537Ssam case vfy :
2229537Ssam dump_state("Verifying");
2329537Ssam break;
2429537Ssam case rel :
2529537Ssam dump_state("Relocating");
2629537Ssam break;
2729537Ssam case cor :
2829537Ssam dump_state("Correcting");
2929537Ssam break;
3029537Ssam case inf :
3129537Ssam dump_state("Collecting information");
3229537Ssam break;
3329537Ssam case exec :
3429537Ssam dump_state("Exercising disk");
3529537Ssam break;
3629981Skarels case setup:
3729981Skarels printf("Initializing for operation ");
3829981Skarels printf("on controller %d, drive %d.\n",
3929981Skarels cur.controller, cur.drive);
4029537Ssam default:
4129537Ssam print("Current state is unknown.\n");
4229537Ssam }
4329537Ssam exdent(1);
4429537Ssam }
4529537Ssam
4629537Ssam
4729537Ssam /*
4829537Ssam **
4929537Ssam */
5029537Ssam
dump_state(string)5129537Ssam dump_state(string)
5229537Ssam char *string;
5329537Ssam {
54*34668Skarels extern int wait_for_char;
55*34668Skarels
5629537Ssam indent();
5729537Ssam print("%s on controller %d, drive %d.\n",
5829537Ssam string, cur.controller, cur.drive);
59*34668Skarels if (wait_for_char)
60*34668Skarels print("Waiting for operator response.\n");
61*34668Skarels else {
62*34668Skarels print("Currently accessing cylinder %d, head %d.\n",
63*34668Skarels cur.daddr.cylinder, cur.daddr.track);
64*34668Skarels print("Currently ");
65*34668Skarels switch (cur.substate) {
66*34668Skarels case sub_chk :
67*34668Skarels printf("determining drive state.\n");
68*34668Skarels break;
69*34668Skarels case sub_fmt :
70*34668Skarels printf("formatting drive surface.\n");
71*34668Skarels break;
72*34668Skarels case sub_vfy :
73*34668Skarels printf("verifying drive surface.\n");
74*34668Skarels break;
75*34668Skarels case sub_rel :
76*34668Skarels printf("performing relocation operations.\n");
77*34668Skarels break;
78*34668Skarels case sub_rcvr :
79*34668Skarels printf("recovering from hardware error.\n");
80*34668Skarels break;
81*34668Skarels case sub_wmap :
82*34668Skarels printf("writing relocation map.\n");
83*34668Skarels break;
84*34668Skarels default :
85*34668Skarels printf("I don't know what is happening.\n");
86*34668Skarels break;
87*34668Skarels }
8829537Ssam }
8929537Ssam exdent(1);
9029537Ssam }
9129537Ssam
92