#include #include #include #include #define INT2F 0x2f void exit(int errno); /* * MSCDEX Substitue, setting alteration program. * * Operation: * This modifies the configuration of MSCSUB whilst it is loaded and * running. It allows: * 1. Drives to be added or deleted. * 2. Alteration of MSCDEX version number. * 3. To turn off MSCMON and pass calls to MSCDEX (if installed). * 4. To turn on MSCMON if turned off. * 5. Change Device Driver Name (eg MSCD000) * 6. Change Name of file containing data for MSCSUB functions * 02h,03h,04h * * Syntax: * Run the program without arguments to check the command switches. * * Compiler Used: * Borland C++, 3.1 * * Compile: bcc -1 -ml mscmon.c * * Test History: * Works okay on 486's and 386's. I haven't tried it out on any 286's yet. * * Author: Colin Ian King, Templeman Library, University of Kent. * * Modification Record: * * 01/03/93 Creation. */ void syntax(void) { fprintf(stderr,"\nUsage: mscmod -a drive ... add drives\n"); fprintf(stderr," mscmod -r drive ... remove drives\n"); fprintf(stderr," mscmod -v version modify mscdex version number\n"); fprintf(stderr," eg: mscmod -v 0210 (version 2.10)\n"); fprintf(stderr," mscmod -mon mscmon on\n"); fprintf(stderr," mscmod -moff mscmon off\n"); fprintf(stderr," mscmod -name MSCxxxx set name of device driver to MSCxxxx\n"); fprintf(stderr," mscmod -file file set name of data file for functions 02h,03h,04h\n"); } void main(int argc, char** argv) { int i; char buffer[64]; union REGS inregs,outregs; struct SREGS segregs; fprintf(stdout,"MSCSUB Modifier by cik@ukc.ac.uk, "); if (argc < 2) { syntax(); exit(1); } /* * bx sub-command: * 00, Install drive in cx, eg cx=0, Drive A, * cx=1, Drive B, etc * 01, Remove drive in cx, eg cx=0, Drive A, etc * 02, Set mscdex version number, eg cx = 0x020a => 2.10 * 03, Turn off this mscsub, pass over to normal handler * 04, Turn on mscsub. */ if (!strcmp(argv[1],"-a")) { for (i=2;i