|
|
1.1 ! root 1: /* ! 2: * coh_intro.c ! 3: * 06/29/92 COHERENT 386 ! 4: * 06/22/93 COHERENT 4.2 ! 5: * Usage: coh_intro ! 6: * Uses routines in build0.c: cc -o coh_intro coh_intro.c build0.c ! 7: */ ! 8: ! 9: #include <stdio.h> ! 10: #include "build0.h" ! 11: ! 12: #define VERSION "2.2" ! 13: #define DEFPAGER "exec more -d" ! 14: ! 15: /* External. */ ! 16: extern char *getenv(); ! 17: ! 18: /* Forward. */ ! 19: int lcdir(); ! 20: void mycls(); ! 21: void tour(); ! 22: ! 23: /* Global. */ ! 24: char *pager; ! 25: int ttyflag; ! 26: ! 27: main(argc, argv) int argc; char *argv[]; ! 28: { ! 29: if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'V') ! 30: fprintf(stderr, "%s: V%s\n", argv[0], VERSION); ! 31: ttyflag = isatty(fileno(stdout)); ! 32: if ((pager = getenv("PAGER")) == NULL || *pager == '\0') ! 33: pager = DEFPAGER; ! 34: if (!ttyflag || yes_no("Would you like an introductory tour of COHERENT")) ! 35: tour(); ! 36: exit(0); ! 37: } ! 38: ! 39: /* ! 40: * List the contents of a directory. ! 41: * Flush stdout in case output is redirected. ! 42: * If pflag is true (big directory), pipe output through PAGER. ! 43: */ ! 44: int ! 45: lcdir(dir, msg, pflag) char *dir, *msg; int pflag; ! 46: { ! 47: mycls(1); ! 48: printf(msg); ! 49: fflush(stdout); ! 50: if (ttyflag && pflag) ! 51: sprintf(cmd, "lc %s | %s", dir, pager); ! 52: else ! 53: sprintf(cmd, "lc %s", dir); ! 54: return sys(cmd, S_IGNORE); ! 55: } ! 56: ! 57: /* Print newlines if stdout is redirected; otherwise, clear the screen. */ ! 58: void ! 59: mycls(flag) ! 60: { ! 61: if (ttyflag) ! 62: cls(flag); ! 63: else ! 64: printf("\n\n"); ! 65: } ! 66: ! 67: /* Take a walk on the Boardwalk... */ ! 68: void ! 69: tour() ! 70: { ! 71: mycls(0); ! 72: /* Startup and shutdown. */ ! 73: printf( ! 74: "When you boot your computer system (by turning on the power,\n" ! 75: "by hitting the reset switch, or by typing <Ctrl><Alt><Del>),\n" ! 76: "the bootstrap program by default runs the operating system on\n" ! 77: "the partition marked as active. To boot an operating system\n" ! 78: "system on a different partition, type a partition number (0 to 7)\n" ! 79: "when the boot tries to read the floppy disk.\n" ! 80: "\n" ! 81: "When you boot COHERENT, it starts up in single-user mode.\n" ! 82: "It automatically executes the commands in the file /etc/brc,\n" ! 83: "which typically check COHERENT filesystems for consistency\n" ! 84: "using /etc/fsck. If the filesystems check without errors,\n" ! 85: "the system goes into multi-user mode, automatically executing\n" ! 86: "the commands in the file /etc/rc. You can interrupt file system\n" ! 87: "checking by typing <Ctrl-C>.\n" ! 88: "\n" ! 89: "To shut down COHERENT from multi-user mode, log in as root and\n" ! 90: "execute /etc/shutdown to return the system to single-user mode.\n" ! 91: "Then type sync before rebooting or turning off the power.\n" ! 92: "Your COHERENT filesystems may be damaged if you reboot or\n" ! 93: "power down without following this procedure.\n" ! 94: "\n" ! 95: ); ! 96: ! 97: /* Root. */ ! 98: lcdir("/", ! 99: "Now we will take a quick tour of your COHERENT filesystem.\n" ! 100: "The root directory / contains:\n\n", ! 101: 0); ! 102: printf( ! 103: "\n" ! 104: "COHERENT executes file /.profile when the superuser root logs in.\n" ! 105: "File /coherent (linked to /autoboot) is the COHERENT system image.\n" ! 106: "Empty directories /f0 and /f1 are used for mounting diskettes.\n" ! 107: "Empty directory /mnt is used for mounting other devices.\n" ! 108: "The filesystem checking program /etc/fsck uses empty directory\n" ! 109: "/lost+found if it finds a problem with the root filesystem.\n" ! 110: "COHERENT uses directory /tmp for temporary files; it removes files\n" ! 111: "in /tmp automatically when the system goes multiuser (via /etc/rc).\n" ! 112: "\n" ! 113: ); ! 114: ! 115: /* /bin. */ ! 116: mycls(1); ! 117: printf( ! 118: "Directory /bin contains executable programs (commands).\n" ! 119: "Some of the most commonly used commands are:\n" ! 120: "\tbc\tinteractive calculator with arbitrary precision\n" ! 121: "\tcat\tconcatenate/print files\n" ! 122: "\tcc\tC compiler\n" ! 123: "\tcmp\tcompare files\n" ! 124: "\tcp\tcopy files\n" ! 125: "\tcpdir\tcopy directory hierarchy\n" ! 126: "\tdiff\tsummarize differences between files\n" ! 127: "\tdoscp\ttransfer files to or from MS-DOS\n" ! 128: "\tegrep\textended pattern search\n" ! 129: "\temacs\tMicroEMACS screen editor\n" ! 130: "\thelp\tprint concise command description\n" ! 131: "\tls\tlist directory contents\n" ! 132: "\tmail\tcomputer mail\n" ! 133: "\tmore\tview files one screenful at a time\n" ! 134: "\tps\tprint process status\n" ! 135: "\trm\tremove files\n" ! 136: "\trmdir\tremove directories\n" ! 137: "\tsort\tsort lines of text\n" ! 138: "\tvi\ta popular screen editor\n" ! 139: "\twc\tcount words, lines, characters in a file\n" ! 140: "The next screen lists all the commands in /bin.\n" ! 141: ); ! 142: lcdir("/bin", "", 1); ! 143: putchar('\n'); ! 144: ! 145: /* /conf. */ ! 146: lcdir("/conf", "Directory /conf contains:\n\n", 0); ! 147: putchar('\n'); ! 148: ! 149: /* /conf/kbd. */ ! 150: lcdir ("/conf/kbd", ! 151: "Subdirectory /conf/kbd contains keyboard support:\n\n", ! 152: 0); ! 153: printf( ! 154: "\n" ! 155: "You can change the operation of various keys on your keyboard by changing\n" ! 156: "the appropriate file in /conf/kbd and running /etc/kbdinstall.\n" ! 157: ); ! 158: ! 159: /* /dev. */ ! 160: lcdir("/dev", "Directory /dev contains COHERENT devices:\n\n", 1); ! 161: putchar('\n'); ! 162: mycls(1); ! 163: printf( ! 164: "Some important devices are:\n" ! 165: "\t/dev/at*\tCooked (block-by-block) hard disk partitions\n" ! 166: #if _I386 ! 167: "\t/dev/color*\tVirtual console: color video devices\n" ! 168: #endif ! 169: "\t/dev/com*\tSerial port devices (COM1, COM2, COM3, COM4)\n" ! 170: "\t/dev/console\tConsole terminal\n" ! 171: "\t/dev/f*\t\tFloppy disk devices\n" ! 172: "\t/dev/lpt*\tParallel port devices (LPT1, LPT2 and LPT3)\n" ! 173: #if _I386 ! 174: "\t/dev/mono*\tVirtual console: monochrome video devices\n" ! 175: #endif ! 176: "\t/dev/null\tBit bucket\n" ! 177: #if _I386 ! 178: "\t/dev/pty*\tPseudo-terminal devices\n" ! 179: #endif ! 180: "\t/dev/rat*\tRaw (character-by-character) hard disk partitions\n" ! 181: "\t/dev/rf*\tRaw (character-by-character) floppy disk devices\n" ! 182: #if _I386 ! 183: "\t/dev/rsd*\tRaw (character-by-character) SCSI devices\n" ! 184: "\t/dev/sd*\tCooked (block-by-block) SCSI devices\n" ! 185: #endif ! 186: "\t/dev/tty*\tTerminal devices\n" ! 187: "\n" ! 188: ); ! 189: #if !_I386 ! 190: /* /drv. */ ! 191: lcdir("/drv", "Directory /drv contains loadable device drivers:\n\n", 0); ! 192: putchar('\n'); ! 193: #endif ! 194: /* /etc. */ ! 195: lcdir("/etc", ! 196: "Directory /etc contains files and programs used in system administration:\n\n", ! 197: 0); ! 198: putchar('\n'); ! 199: mycls(1); ! 200: printf( ! 201: "Files of particular interest in /etc include:\n" ! 202: "\t/etc/brc\tExecuted when the system comes up single-user\n" ! 203: "\t/etc/domain\tDefines the electronic mail \"domain\"\n" ! 204: "\t/etc/group\tDefines user group membership information\n" ! 205: "\t/etc/passwd\tDefines user login information\n" ! 206: "\t/etc/profile\tExecuted for each shell\n" ! 207: "\t/etc/rc\t\tExecuted when the system comes up multi-user\n" ! 208: "\t/etc/ttys\tDefines status of terminals attached to system\n" ! 209: "\t/etc/ttytype\tDefines the types of terminals attached to system\n" ! 210: "\t/etc/uucpname\tDefines the system name for use with UUCP\n" ! 211: "\n" ! 212: ); ! 213: /* /etc/default. */ ! 214: lcdir("/etc/default", ! 215: "Directory /etc/default contains configuration files used by some commands:\n\n", ! 216: 0); ! 217: putchar('\n'); ! 218: printf( ! 219: "Files of particular interest in /etc/default include:\n" ! 220: "\t/etc/default/async\tSpecifies serial port hardware configuration\n" ! 221: "\t/etc/default/msdos\tSpecifies defaults for the /bin/dos* commands\n" ! 222: "\n" ! 223: ); ! 224: ! 225: /* /lib. */ ! 226: lcdir("/lib", ! 227: "Directory /lib contains libraries and C compiler phases:\n\n", ! 228: 0); ! 229: putchar('\n'); ! 230: ! 231: /* /usr. */ ! 232: lcdir("/usr", ! 233: "Directory /usr contains a number of subdirectories:\n\n", ! 234: 0); ! 235: printf( ! 236: "\n" ! 237: "\t/usr/adm\tSystem administration files\n" ! 238: "\t/usr/bin\tAdditional COHERENT commands\n" ! 239: "\t/usr/dict\tDictionary for spell command\n" ! 240: "\t/usr/games\tGames\n" ! 241: "\t/usr/include\tHeader files\n" ! 242: "\t/usr/lib\tAdditional libraries\n" ! 243: "\t/usr/man\tCOHERENT online manual pages\n" ! 244: "\t/usr/msgs\tSystem-wide messages\n" ! 245: "\t/usr/pub\tPublic information\n" ! 246: "\t/usr/spool\tWork area for daemon processes\n" ! 247: "\t/usr/src\tSome sources and sample programs\n" ! 248: "\t/usr/tmp\tTemporary file directory\n" ! 249: "\n" ! 250: ); ! 251: ! 252: /* Shells */ ! 253: mycls(1); ! 254: printf( ! 255: "The COHERENT system includes the following shells (command interpreters):\n\n" ! 256: "\t/usr/bin/vsh\tThe COHERENT visual (full screen) shell\n" ! 257: "\t/usr/bin/ksh\tThe Korn shell\n" ! 258: "\t/bin/sh\t\tThe Bourne shell\n" ! 259: "\n" ! 260: ); ! 261: /* File types. */ ! 262: mycls(1); ! 263: printf( ! 264: "COHERENT filenames often contain an extension following '.' which\n" ! 265: "indicates the contents of the file. Some common extensions are:\n" ! 266: "\n" ! 267: "\t.a\tarchive (or library) in ar format\n" ! 268: "\t.b\tbc source\n" ! 269: "\t.c\tC source\n" ! 270: "\t.h\tC header\n" ! 271: "\t.i\tC intermediate file (cpp output)\n" ! 272: "\t.l\tlex source\n" ! 273: "\t.m\tmacro assembler source\n" ! 274: "\t.o\tobject file (unlinked)\n" ! 275: "\t.r\tnroff or troff input\n" ! 276: "\t.s\tassembler source\n" ! 277: "\t.tar\tarchive in tar format\n" ! 278: "\t.tar.Z\tcompressed tar-format archive, cf. tar, compress\n" ! 279: "\t.tmp\ttemporary file\n" ! 280: "\t.y\tyacc source\n" ! 281: "\t.Z\tcompressed file, cf. compress/uncompress\n" ! 282: "\n" ! 283: ); ! 284: ! 285: /* Diskettes. */ ! 286: mycls(1); ! 287: printf( ! 288: "Some commonly used diskette device names and formats are:\n\n" ! 289: "\tDevice name Sectors/track Heads Sectors Bytes Format\n" ! 290: "\t/dev/f9a0 9 2 720 360 KB 5.25\"\n" ! 291: "\t/dev/fqa0 9 2 1440 720 KB 3.5\"\n" ! 292: "\t/dev/fha0 15 2 2400 1.2 MB 5.25\"\n" ! 293: "\t/dev/fva0 18 2 2880 1.44 MB 3.5\"\n" ! 294: "\nDevice names ending in '0' and '1' indicate drives A: and B:.\n" ! 295: "In addition, wherever possible, common floppy device names are provided for\n" ! 296: "compatibility with other operating systems.\n" ! 297: "\n" ! 298: ); ! 299: mycls(1); ! 300: printf( ! 301: "To use a floppy disk filesystem with COHERENT, you must:\n\n" ! 302: "\t(1) format and verify it with /etc/fdformat,\n" ! 303: "\t(2) build an empty filesystem on it with /etc/mkfs,\n" ! 304: "\t(3) mount it with /bin/mount or /etc/mount,\n" ! 305: "\t(4) copy files to or from it, e.g. with /bin/cp or /bin/cpdir,\n" ! 306: "and\t(5) unmount it with /bin/umount or /etc/umount.\n" ! 307: "\n" ! 308: "For example, to copy directory /dir to a 5.25\" high density diskette in A:\n\n" ! 309: "\t/etc/fdformat -av /dev/rfha0\n" ! 310: "\t/etc/mkfs /dev/fha0 2400\n" ! 311: "\t/etc/mount /dev/fha0 /f0\n" ! 312: "\tcpdir -vd /dir /f0/dir\n" ! 313: "\t/etc/umount /dev/fha0\n\n" ! 314: "/bin/mount and /bin/umount provide handy abbreviations for \"mount\" commands.\n" ! 315: "\n" ! 316: ); ! 317: ! 318: /* Done. */ ! 319: mycls(1); ! 320: printf( ! 321: "This concludes your brief introduction to COHERENT.\n" ! 322: "To see this introduction again, type \"/etc/coh_intro\".\n" ! 323: "To create a file with this information, type \"/etc/coh_intro >/tmp/tour\".\n" ! 324: "\n" ! 325: ); ! 326: } ! 327: ! 328: /* end of coh_intro.c */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.