home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_100
/
129_02
/
ctdlcnfg.sys
< prev
next >
Wrap
Text File
|
1985-03-10
|
17KB
|
340 lines
/************************************************************************/
/* ctdlCnfg.sys */
/* */
/* configuration file for Citadel bulletin board system. */
/* This is >>>NOT<<< a C file! It is read in by configur.com */
/* which sets up a "ctdlTabl.sys" binary file recording the local */
/* configuration parameters. (CtdlTabl.sys is read by the other */
/* Citadel programs.) */
/* NB: all numbers are in hex. */
/************************************************************************/
/************************************************************************/
/* History */
/* */
/* 84Aug22 HAW Modified to run on Z100 CPM-85 using Serial B. */
/* 84Jun10 HAW ALLMAIL... */
/* 83Feb26 CrT LOGINOK, ENTEROK & READOK... */
/* 83Feb06 CrT Mods to debug ICS files on ODD-DATA machine... */
/* 82Nov24 CrT This file now handles H89 with SmartModem @ port D8 */
/* 82Nov21 CrT Created. */
/************************************************************************/
/************************************************************************/
/* This file must be edited to be appropriate to the local environ- */
/* ment. It specifies the name of the installation, location of the */
/* modem port, et cetera. You will have to add some simple routines */
/* to handle carrier-detect etc. This file is then processed by */
/* CONFIGUR.COM, which produces the ctdlTabl.sys file which is read */
/* automatically by the other Citadel programs -- currently SYSOP.COM */
/* and CITADEL.COM. */
/* Lines not beginning with "#" are ignored by CONFIGUR and may be */
/* deleted once the file is successfully configured -- they are purely */
/* documentary. */
/************************************************************************/
/* nodeTitle will be printed whenever Citadel.com is run, and should */
/* identify your local installation. */
#nodeTitle "Citadel-85 Test System"
/* nodeName is purely for networking purposes. Messages which orignated*/
/* on your system will have headers looking like */
/* 82Nov23 From Cynbe ru Taren @ODD-DATA
/* This should be a short (for the sake of the reader!) mnemonic */
/* identifying your node for humans. */
#nodeName "RotGut"
/* nodeId is also purely for networking purposes. Messages which */
/* originate on your system will be marked with the nodeId, but it will */
/* not normally be printed out. It is primarily for the use of the */
/* networking support software, and forms a globally unique name and */
/* address of your system. It consists of a country abbreviation */
/* followed by area code and phone number. (The "country codes" listed */
/* in the phone book are >not< fixed, but depend on the country the */
/* call is originating from. They are basically routing codes rather */
/* than addresses.) Country abbreviation for the US is "US", for */
/* Canada is "CA". (For others, see COUNTRY.DOC.) */
#nodeId "US 612 431-1107" /* Ye olde computer line */
/* CLOCK tells Citadel whether you have a hardware clock in the system */
/* for day-hours. All it does at the moment: if you have one, you */
/* won't be prompted for date etc each time you boot in standalone */
/* mode. The auto-network software will use this eventually also... */
#define CLOCK 0 /* 1 if hardware clock, else 0 */
/* CRYPTSEED is a number used in encrypting the password file. Change */
/* it once when you install the system, but not thereafter -- or you */
/* won't be able to read the existing files any more. */
#define CRYPTSEED 553 /* */
/* MDATA is the port Citadel will attempt to read and write modem data */
/* from. We expect 8-bit bytes, naturally... */
#define MDATA EC /* Modem data port */
/* MEGAHZ is the 8080-equivalent clock rate, used for busy-wait loops */
/* various places -- in particular, in the WC-protocol code. */
#define MEGAHZ 5 /* Z100 8085 rate (for wait loops) */
/* MESSAGEK sizes "ctdlmsg.sys", the file message text is stored in. */
/* The size of this parameter together with the rate message text is */
/* entered at determines message lifetime. ICS ran for a few months */
/* with 87K, and message lifetime sometimes dropped below 3 days, */
/* upsetting the weekly callers. A one-week minimum seems the target */
/* to try for. ICS is currently (82Nov26) running a 250K message file. */
/* Note that MESSAGEK is a >>Hex Number<< like all others in this file! */
#define MESSAGEK 1 /* number of Kbyte to use in ctdlmsg.sys*/
/* RCPM is a switch to indicate whether Citadel is running as a stand- */
/* alone system or as a utility within a larger (presumably RCPM) */
/* system. The difference is basically that RCPM mode skips some */
/* initialization and exits to CP/M when the caller logs out, while */
/* standalone mode breaks the modem connection when the caller logs out.*/
/* RCPM mode is completely untested as of 82Dec05 */
#define RCPM 0 /* 0 for standalone, 1 for RCPM mode */
/* HOMEDISK, HOMEUSER and MSGDISK tell Citadel where to look for its */
/* personal data files, help files etc. These should be isolated in */
/* an otherwise inaccessable disk/user space, to protect the password */
/* file etc. Citadel will expect to find all files in the userspace */
/* indicated by HOMEUSER. It expects to find ctdlmsg.sys on MSGDISK, */
/* and all other Citadel-specific files on HOMEDISK. Set HOMEDISK and */
/* MSGDISK to 0 for disk A:, 1 for B: etc. User numbers run 0->31 in */
/* CPM 2.xx . It's OK if HOMEDISK=MSGDISK, the separation is just for */
/* some systems which may not have room for everything on one disk. */
#define HOMEDISK 0 /* disk A */
#define HOMEUSER 0 /* user 0 */
#define MSGDISK 0 /* disk A */
/* LOGINOK, ENTEROK and READOK are configuration switches used to set */
/* the privileges of new callers. */
/* If LOGINOK is TRUE (nonzero), callers can establish a name and */
/* password for themselves without sysop intervention. If it is */
/* FALSE (zero), new accounts can only be established from the system */
/* console. */
/* If ENTEROK is TRUE callers can enter messages without logging */
/* in. Such messages will have nameless headers but the date will be */
/* intact. Setting ENTEROK to FALSE can reduce vandalism, or keep */
/* nonpaying folks off commercial systems. */
/* If READOK is TRUE, callers can read messages without logging */
/* in. This provides a friendly first contact. Setting READOK to */
/* FALSE may again be appropriate in commercial installations. */
#define LOGINOK 1 /* user-established accounts */
#define READOK 1 /* anonymous message-reading */
#define ENTEROK 0 /* no anonymous message-entry */
/* ROOMOK is a configuration switch setting the room-creation privileges*/
/* of established callers. If ROOMOK is TRUE (nonzero) then regular */
/* folks can create new rooms, else only those with aide privileges */
/* can do so. */
#define ROOMOK 1 /* general room-creation privileges */
/* ALLMAIL is a configuration switch which lets the sysop decide whether*/
/* all people should be allowed to send private mail to each other, or */
/* if only aides should have access to private mail and the ordinary */
/* folk can only send mail to the Sysop. If ALLMAIL is TRUE, all get */
/* privileges; FALSE and only aides have the privilege. */
#define ALLMAIL 1 /* Everybody can send mail */
/* CPU8085 is used to indicate if the CPU in use is an 8085, rather */
/* than a Z80 or 8080. If it is, then there is a timing difference; */
/* this switch is used to resolve the timing difference. Normally, */
/* CP/M-85 is used with the 8085 chip. This switch was implemented */
/* to allow the Zenith Z100 run Citadel on the 8085 side. */
#define CPU8085 1 /* Yes, CP/M-85 */
/************************************************************************/
/* Interpreter Routines */
/* */
/* For portability, Citadel modem I/O and related functions are done */
/* through tiny routines written in a primitive language for a trivial */
/* little interpreter which implements a virtual machine with exactly */
/* one accumulator. There is also a scratch array of 40 bytes which */
/* may be used for whatever you please. The interpreter will probably */
/* grow more sophisticated with time. REMEMBER THAT ALL VALUES ARE */
/* IN HEX!!! The current instruction set (82Dec05) is: */
/* */
/* #start <routine name> */
/* This labels the beginning of a routine. */
/* */
/* #code ANDI <byte> */
/* Bitwise AND of the byte-wide accumulator with <byte>. This */
/* is the way to mask off the bit you're interested in. */
/* */
/* #code INP <port> */
/* Load accumulator from given port. */
/* */
/* #code LOAD <address> */
/* Load accumulator from given RAM address. */
/* */
/* #code LOADI <byte> */
/* Load <byte> into accumulator. */
/* */
/* #code ORI <byte> */
/* Bitwise OR of accumulator and <byte>. */
/* */
/* #code OUTP <port> */
/* Store accumulator value to <port>. */
/* */
/* #code OUTSTRING "any string you want" */
/* Stuff string out modem. This calls MOREADY, so obviously */
/* MOREADY should not call it! */
/* */
/* #code PAUSEI <byte> */
/* Pause for <byte> 100ths of a second. */
/* */
/* #code RET */
/* Return whatever is in the accumulator. Some routines ignore */
/* the returned value: the rest will interpret zero as FALSE and */
/* anything else as TRUE, in typical C fashion. */
/* */
/* #code STORE <address> */
/* Store the accumulator in RAM byte <address>. */
/* */
/* #code XORI <byte> */
/* Bitwise eXclusive-OR of accumulator and <byte>. This is the */
/* way to flip a bit if you have an active-low signal. */
/* */
/* #code ARRAY[]= <byte> */
/* Store accumulator into array[<byte>]. If <byte> is not in */
/* the range 0->27 hex (i.e., 0->39 decimal), you will be */
/* overwriting Citadel variables and your guess is as good as */
/* mine as to the eventual consequences. Let's not, OK? */
/* */
/* #code ARRAY[] <byte> */
/* Load accumulator from array[<byte>]. This is the complement */
/* of ARRAY[]=, giving limited scratchpad capabilities and */
/* somewhere to stash stuff between calls. */
/* */
/* #code OPR# "prompt" <byte0> <byte1> */
/* Prints prompt on the console and gets a number between <byte0> */
/* and <byte1> from the operator, which is loaded in accumulator. */
/************************************************************************/
/************************************************************************/
/* ARRAY[] usage (array[0..27]) (0..39 decimal) */
/* */
/* (Change routines to store and retrieve these from your */
/* clock if you have one.) */
/* */
/* ARRAY[0] is YEAR */
/* ARRAY[1] is MONTH */
/* ARRAY[2] is DAY */
/* ARRAY[3] is HOUR (24-hour format) */
/* ARRAY[4] is MINUTE */
/* ARRAY[5] is SECOND */
/************************************************************************/
/************************************************************************/
/* CARRDETECT returns nonzero value on valid carrier, else zero */
/************************************************************************/
#start CARRDETECT x /* routine to sense valid carrier */
#code INP ED /* get modem line status */
#code ANDI 40 /* mask off Recieved Line Signal Detect */
#code RET x /* return 80 (TRUE) if carrier else 0 */
/************************************************************************/
/* GETYEAR return current year */
/************************************************************************/
#start GETYEAR x /* */
#code ARRAY[] 0 /* load from ARRAY[0] */
#code RET x /* return it */
/************************************************************************/
/* GETMONTH return current month */
/************************************************************************/
#start GETMONTH x /* */
#code ARRAY[] 1 /* load from ARRAY[1] */
#code RET x /* return it */
/************************************************************************/
/* GETDAY return current day */
/************************************************************************/
#start GETDAY x /* */
#code ARRAY[] 2 /* load from ARRAY[2] */
#code RET x /* return it */
/************************************************************************/
/* HANGUP breaks the modem connection. */
/************************************************************************/
#start HANGUP x /* routine to break modem connection */
#code INP EF /* Grab from command register */
#code ANDI FD /* Clear DTR bit ONLY */
#code OUTP EF /* Chuck it back to the cmd register, */
#code PAUSEI 50 /* then pause half a sec. */
#code XORI 2 /* This SHOULD set DTR back to 1. */
#code OUTP EF /* And throw at cmd register. */
#code RET x /* No interesting value returned. */
/************************************************************************/
/* INITDATE sets up date, in hardware clock if available */
/* */
/* ARRAY[0] is YEAR */
/* ARRAY[1] is MONTH */
/* ARRAY[2] is DAY */
/* ARRAY[3] is HOUR (24-hour format) */
/* ARRAY[4] is MINUTE */
/* ARRAY[5] is SECOND */
/************************************************************************/
#start INITDATE x /* */
#code OPR# "Year" 84 90 /* get year from console */
#code ARRAY[]= 0 /* remember it in ARRAY[0] */
#code OPR# "Month" 1 12 /* get month from console */
#code ARRAY[]= 1 /* remember it in ARRAY[1] */
#code OPR# "Day" 1 31 /* get day from console */
#code ARRAY[]= 2 /* remember it in ARRAY[2] */
/* forget HMS, ODD-DATA has no clock */
#code RET x /* return nothing interesting */
/************************************************************************/
/* INITPORT sets up the modem port and modem. No return value. */
/************************************************************************/
#start INITPORT x /* routine to initialize modem port */
/************************************************/
/* Next line initializes the Hayes Smartmodem: */
/* AT Attention */
/* Q1 Quiet mode -- no result codes */
/* S0=1 Answer on first ring */
/* E0 No echo of command line */
/* S2=255 Disable escape character */
/* S5=130 Disable backspace char */
/* T Touch-tone dialing. */
/* */
/* My Smartmodem switches are set so: */
/* #1 up Support DTR, to hang up */
/* #2 down Non verbose result codes */
/* #3 up No result codes anyway */
/* #4 down No echo in command state */
/* #5 up Auto answer first ring */
/* #6 up Generate true Carrier Detect */
/* #7 up Single - line phone */
/* #8 down Looks prettier that way */
/* (You will note that some of these are */
/* redundantly with next command.) */
/************************************************/
#code OUTSTRING "AT Q1 S0=1 E0 S2=255 S5=130 T" /* stupify SmartModem */
#code RET x /* return nothing interesting */
/************************************************************************/
/* MIREADY returns nonzero value if modem char can be input, else 0*/
/************************************************************************/
#start MIREADY x /* routine to sense modem char available*/
#code INP ED /* read modem status port */
#code ANDI 2 /* mask off char-ready bit
#code RET x /* return 1 if char ready, else zero */
/************************************************************************/
/* MOREADY returns nonzero if modem is ready for output, else 0 */
/************************************************************************/
#start MOREADY x /* routine to sense modem output OK */
#code INP ED /* read modem status port */
#code ANDI 1 /* mask off output-ok bit */
#code RET x /* return 20 (TRUE) if ok, else zero */
#alldone x x /* end of file */
/
#code OUTSTRING "AT Q1 S0=1 E0 S2=255 S5=130