/* * cbinst - cbios install program for * Morrow Designs micro decision * * Lenny Edmondson * for Morrow Designs * * 1982 * * Micro decision utilities * * Micro-Decision installation executive * Runs three overlays * * Steps: * * 1) Format - format a floppy (init.001) * * 2) Copy - make a backup copy (init.002) * * 3) Patch - customize the BIOS (init.003) * * */ # include "bi.h" # define DRIVEB 1 char drive = DRIVEB, /* drive on which the BIOS is found */ *biosbuf = NULL, c = 0, ndrives = 0; unsigned term = 0; /* the index number of the terminal */ main () { logo (); findndrive (); /* * format the diskette in Drive B * Try possibly many times */ for (;;) { put ("\n\nPreparing to format DESTINATION diskette.\n"); c = exec ("init.001 b"); if (c == 0) break; /* success */ reformat: prs ("\ \n\ DESTINATION diskette may be flawed. Replace with another diskette,\n\ then press any key.\ "); getch (); } /* * run the BACKUP program * to copy everything from drive A to drive B */ for (;;) { put ("\n\nNow copying CP/M DISTRIBUTION diskette.\n"); c = exec ("init.002"); if (!c) break; if (c == 1) { goto reformat; } else { prs ("\ \n\ CP/M DISTRIBUTION diskette is defective. Contact your dealer or Morrow\n\ Designs customer service for a replacement.\n\ "); for (;;); /* hang */ } } /* * run the terminal installation */ exec ("init.003", ndrives); /* * erase init.com, init.001, init.002 from * destination diskette */ if (ndrives) /* multi-drive system */ { remove ("b:init.com"); remove ("b:init.001"); remove ("b:init.002"); remove ("b:init.003"); remove ("b:terminal.dat"); } else { remove ("a:init.com"); remove ("a:init.001"); remove ("a:init.002"); remove ("a:init.003"); remove ("a:terminal.dat"); } put ("\n\n"); put ("\ The DESTINATION diskette is now a configured CP/M SYSTEM DISKETTE\n\ for your Micro-Decision. Put your CP/M Distribution Diskette away in a\n\ safe place.\n\ \n\ "); put ("\ Next, label the DESTINATION diskette \"CP/M SYSTEM DISKETTE.\"\n\ \n\ "); put ("\ When you get the Menu display, we suggest you first make a back-up\n\ copy of your new CP/M SYSTEM DISKETTE.\n\ \n\ "); put ("\ Press the RESET button and when asked to do so, insert the CP/M\n\ SYSTEM DISKETTE into drive A.\n\ \n\ "); /* * hang in an infinite loop */ for (;;) ; } _main () { main (); } logo () { prs ("\ CP/M Distribution Diskette\n\ \n\ Use this diskette to create a CP/M SYSTEM DISKETTE customized for your\n\ Micro-Decision and terminal. You will need a diskette to receive the\n\ "); prs ("\ customized CP/M system. This diskette will be called the DESTINATION\n\ diskette. It must be soft-sectored, but need not be blank. However, any\n\ information currently on it will be erased.\n\ \n\ "); } findndrive () { static unsigned char c; static int *i; static struct mtab *m; howmany: put ("\n\nHow many disk drives do you have? (1-4) "); for (;;) { c = getch (); if (c < '1' || '4' < c) { if (!iswhite (c)) put ("\b \b"); continue; } ndrives = c - '1'; /* zero origin */ put ("\n\n"); cputc (c); put (" disk drive(s). OK (Y/N) "); c = getch (); if (c != 'y') { goto howmany; } else { /* * set the ram copy of the data */ * (char *) 8 = ndrives; /* * patch the mtab in memory */ i = 1; /* BIOS address */ i = (*i & ~255) + 0x44; m = *i; domtab (m); if (!ndrives) /* single drive system */ { drive = 0; /* BIOS on A: */ prs ("\ \n\ \n\ Your single drive Micro-Decision will require you to change diskettes at\n\ various times during this process. Be sure to follow the instructions\n\ which appear on the screen.\n\ \n\ "); } break; } } }