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 >
Text File  |  1985-03-10  |  17KB  |  340 lines

  1. /************************************************************************/
  2. /*                ctdlCnfg.sys                */
  3. /*                                    */
  4. /*    configuration file for Citadel bulletin board system.        */
  5. /*    This is >>>NOT<<< a C file!  It is read in by configur.com    */
  6. /*    which sets up a "ctdlTabl.sys" binary file recording the local    */
  7. /*    configuration parameters.  (CtdlTabl.sys is read by the other    */
  8. /*    Citadel programs.)                        */
  9. /*       NB:    all numbers are in hex.                 */
  10. /************************************************************************/
  11.  
  12. /************************************************************************/
  13. /*                History                 */
  14. /*                                    */
  15. /* 84Aug22 HAW    Modified to run on Z100 CPM-85 using Serial B.        */
  16. /* 84Jun10 HAW    ALLMAIL...                        */
  17. /* 83Feb26 CrT    LOGINOK, ENTEROK & READOK...                */
  18. /* 83Feb06 CrT    Mods to debug ICS files on ODD-DATA machine...        */
  19. /* 82Nov24 CrT    This file now handles H89 with SmartModem @ port D8    */
  20. /* 82Nov21 CrT    Created.                        */
  21. /************************************************************************/
  22.  
  23. /************************************************************************/
  24. /*   This file must be edited to be appropriate to the local environ-    */
  25. /* ment.  It specifies the name of the installation, location of the    */
  26. /* modem port, et cetera.  You will have to add some simple routines    */
  27. /* to handle carrier-detect etc.  This file is then processed by    */
  28. /* CONFIGUR.COM, which produces the ctdlTabl.sys file which is read    */
  29. /* automatically by the other Citadel programs -- currently SYSOP.COM    */
  30. /* and CITADEL.COM.                            */
  31. /*    Lines not beginning with "#" are ignored by CONFIGUR and may be    */
  32. /* deleted once the file is successfully configured -- they are purely    */
  33. /* documentary.                             */
  34. /************************************************************************/
  35.  
  36. /* nodeTitle will be printed whenever Citadel.com is run, and should    */
  37. /* identify your local installation.                    */
  38. #nodeTitle "Citadel-85 Test System"
  39.  
  40. /* nodeName is purely for networking purposes.    Messages which orignated*/
  41. /* on your system will have headers looking like            */
  42. /* 82Nov23 From Cynbe ru Taren @ODD-DATA
  43. /* This should be a short (for the sake of the reader!) mnemonic    */
  44. /* identifying your node for humans.                    */
  45. #nodeName "RotGut"
  46.  
  47. /* nodeId is also purely for networking purposes.  Messages which    */
  48. /* originate on your system will be marked with the nodeId, but it will */
  49. /* not normally be printed out.  It is primarily for the use of the    */
  50. /* networking support software, and forms a globally unique name and    */
  51. /* address of your system.  It consists of a country abbreviation    */
  52. /* followed by area code and phone number.  (The "country codes" listed */
  53. /* in the phone book are >not< fixed, but depend on the country the    */
  54. /* call is originating from.  They are basically routing codes rather    */
  55. /* than addresses.)  Country abbreviation for the US is "US", for    */
  56. /* Canada is "CA".  (For others, see COUNTRY.DOC.)            */
  57. #nodeId "US 612 431-1107"    /* Ye olde computer line        */
  58.  
  59. /* CLOCK tells Citadel whether you have a hardware clock in the system    */
  60. /* for day-hours.  All it does at the moment:  if you have one, you    */
  61. /* won't be prompted for date etc each time you boot in standalone    */
  62. /* mode.  The auto-network software will use this eventually also...    */
  63. #define CLOCK 0         /* 1 if hardware clock, else 0        */
  64.  
  65. /* CRYPTSEED is a number used in encrypting the password file.    Change    */
  66. /* it once when you install the system, but not thereafter -- or you    */
  67. /* won't be able to read the existing files any more.            */
  68. #define CRYPTSEED  553        /*                    */
  69.  
  70. /* MDATA is the port Citadel will attempt to read and write modem data    */
  71. /* from.  We expect 8-bit bytes, naturally...                */
  72. #define MDATA EC        /* Modem data port            */
  73.  
  74. /* MEGAHZ is the 8080-equivalent clock rate, used for busy-wait loops    */
  75. /* various places -- in particular, in the WC-protocol code.        */
  76. #define MEGAHZ 5        /* Z100 8085 rate (for wait loops)    */
  77.  
  78. /* MESSAGEK sizes "ctdlmsg.sys", the file message text is stored in.    */
  79. /* The size of this parameter together with the rate message text is    */
  80. /* entered at determines message lifetime.  ICS ran for a few months    */
  81. /* with 87K, and message lifetime sometimes dropped below 3 days,    */
  82. /* upsetting the weekly callers.  A one-week minimum seems the target    */
  83. /* to try for.    ICS is currently (82Nov26) running a 250K message file. */
  84. /* Note that MESSAGEK is a >>Hex Number<< like all others in this file! */
  85. #define MESSAGEK  1        /* number of Kbyte to use in ctdlmsg.sys*/
  86.  
  87. /* RCPM is a switch to indicate whether Citadel is running as a stand-    */
  88. /* alone system or as a utility within a larger (presumably RCPM)    */
  89. /* system.  The difference is basically that RCPM mode skips some    */
  90. /* initialization and exits to CP/M when the caller logs out, while    */
  91. /* standalone mode breaks the modem connection when the caller logs out.*/
  92. /* RCPM mode is completely untested as of 82Dec05            */
  93. #define RCPM 0            /* 0 for standalone, 1 for RCPM mode    */
  94.  
  95. /* HOMEDISK, HOMEUSER and MSGDISK tell Citadel where to look for its    */
  96. /* personal data files, help files etc.  These should be isolated in    */
  97. /* an otherwise inaccessable disk/user space, to protect the password    */
  98. /* file etc.  Citadel will expect to find all files in the userspace    */
  99. /* indicated by HOMEUSER.  It expects to find ctdlmsg.sys on MSGDISK,    */
  100. /* and all other Citadel-specific files on HOMEDISK.  Set HOMEDISK and    */
  101. /* MSGDISK to 0 for disk A:, 1 for B: etc.  User numbers run 0->31 in    */
  102. /* CPM 2.xx .  It's OK if HOMEDISK=MSGDISK, the separation is just for    */
  103. /* some systems which may not have room for everything on one disk.    */
  104. #define HOMEDISK 0        /* disk A                */
  105. #define HOMEUSER 0        /* user 0                */
  106. #define MSGDISK  0        /* disk A                */
  107.  
  108. /* LOGINOK, ENTEROK and READOK are configuration switches used to set    */
  109. /* the privileges of new callers.                    */
  110. /*    If LOGINOK is TRUE (nonzero), callers can establish a name and    */
  111. /* password for themselves without sysop intervention.    If it is    */
  112. /* FALSE (zero), new accounts can only be established from the system    */
  113. /* console.                                */
  114. /*    If ENTEROK is TRUE callers can enter messages without logging    */
  115. /* in.    Such messages will have nameless headers but the date will be    */
  116. /* intact.  Setting ENTEROK to FALSE can reduce vandalism, or keep    */
  117. /* nonpaying folks off commercial systems.                */
  118. /*    If READOK is TRUE, callers can read messages without logging    */
  119. /* in.    This provides a friendly first contact.  Setting READOK to    */
  120. /* FALSE may again be appropriate in commercial installations.        */
  121. #define LOGINOK 1        /* user-established accounts        */
  122. #define READOK 1        /* anonymous message-reading        */
  123. #define ENTEROK 0        /* no anonymous message-entry        */
  124.  
  125. /* ROOMOK is a configuration switch setting the room-creation privileges*/
  126. /* of established callers.  If ROOMOK is TRUE (nonzero) then regular    */
  127. /* folks can create new rooms, else only those with aide privileges    */
  128. /* can do so.                                */
  129. #define ROOMOK 1        /* general room-creation privileges    */
  130.  
  131. /* ALLMAIL is a configuration switch which lets the sysop decide whether*/
  132. /* all people should be allowed to send private mail to each other, or    */
  133. /* if only aides should have access to private mail and the ordinary    */
  134. /* folk can only send mail to the Sysop.  If ALLMAIL is TRUE, all get    */
  135. /* privileges; FALSE and only aides have the privilege.         */
  136. #define ALLMAIL 1        /* Everybody can send mail        */
  137.  
  138. /* CPU8085 is used to indicate if the CPU in use is an 8085, rather    */
  139. /* than a Z80 or 8080. If it is, then there is a timing difference;    */
  140. /* this switch is used to resolve the timing difference. Normally,    */
  141. /* CP/M-85 is used with the 8085 chip. This switch was implemented    */
  142. /* to allow the Zenith Z100 run Citadel on the 8085 side.        */
  143. #define CPU8085     1        /* Yes, CP/M-85         */
  144.  
  145. /************************************************************************/
  146. /*            Interpreter Routines                */
  147. /*                                    */
  148. /*  For portability, Citadel modem I/O and related functions are done    */
  149. /* through tiny routines written in a primitive language for a trivial    */
  150. /* little interpreter which implements a virtual machine with exactly    */
  151. /* one accumulator.  There is also a scratch array of 40 bytes which    */
  152. /* may be used for whatever you please.  The interpreter will probably    */
  153. /* grow more sophisticated with time.  REMEMBER THAT ALL VALUES ARE    */
  154. /* IN HEX!!!  The current instruction set (82Dec05) is:         */
  155. /*                                    */
  156. /* #start <routine name>                        */
  157. /*    This labels the beginning of a routine.             */
  158. /*                                    */
  159. /* #code ANDI <byte>                            */
  160. /*    Bitwise AND of the byte-wide accumulator with <byte>.  This    */
  161. /*  is the way to mask off the bit you're interested in.        */
  162. /*                                    */
  163. /* #code INP <port>                            */
  164. /*    Load accumulator from given port.                */
  165. /*                                    */
  166. /* #code LOAD <address>                         */
  167. /*    Load accumulator from given RAM address.            */
  168. /*                                    */
  169. /* #code LOADI <byte>                            */
  170. /*    Load <byte> into accumulator.                    */
  171. /*                                    */
  172. /* #code ORI <byte>                            */
  173. /*    Bitwise OR of accumulator and <byte>.                */
  174. /*                                    */
  175. /* #code OUTP <port>                            */
  176. /*    Store accumulator value to <port>.                */
  177. /*                                    */
  178. /* #code OUTSTRING "any string you want"                */
  179. /*    Stuff string out modem.  This calls MOREADY, so obviously    */
  180. /*    MOREADY should not call it!                    */
  181. /*                                    */
  182. /* #code PAUSEI <byte>                            */
  183. /*    Pause for <byte> 100ths of a second.                */
  184. /*                                    */
  185. /* #code RET                                */
  186. /*    Return whatever is in the accumulator.    Some routines ignore    */
  187. /*    the returned value: the rest will interpret zero as FALSE and    */
  188. /*    anything else as TRUE, in typical C fashion.            */
  189. /*                                    */
  190. /* #code STORE <address>                        */
  191. /*    Store the accumulator in RAM byte <address>.            */
  192. /*                                    */
  193. /* #code XORI <byte>                            */
  194. /*    Bitwise eXclusive-OR of accumulator and <byte>.  This is the    */
  195. /*    way to flip a bit if you have an active-low signal.        */
  196. /*                                    */
  197. /* #code ARRAY[]= <byte>                        */
  198. /*    Store accumulator into array[<byte>].  If <byte> is not in    */
  199. /*    the range 0->27 hex (i.e., 0->39 decimal), you will be        */
  200. /*    overwriting Citadel variables and your guess is as good as    */
  201. /*    mine as to the eventual consequences.  Let's not, OK?        */
  202. /*                                    */
  203. /* #code ARRAY[] <byte>                         */
  204. /*    Load accumulator from array[<byte>].  This is the complement    */
  205. /*    of ARRAY[]=, giving limited scratchpad capabilities and     */
  206. /*    somewhere to stash stuff between calls.             */
  207. /*                                    */
  208. /* #code OPR# "prompt" <byte0> <byte1>                    */
  209. /*    Prints prompt on the console and gets a number between <byte0>    */
  210. /*    and <byte1> from the operator, which is loaded in accumulator.    */
  211. /************************************************************************/
  212.  
  213. /************************************************************************/
  214. /*            ARRAY[] usage    (array[0..27]) (0..39 decimal)    */
  215. /*                                    */
  216. /*        (Change routines to store and retrieve these from your    */
  217. /*         clock if you have one.)                    */
  218. /*                                    */
  219. /*    ARRAY[0]    is YEAR                     */
  220. /*    ARRAY[1]    is MONTH                    */
  221. /*    ARRAY[2]    is DAY                        */
  222. /*    ARRAY[3]    is HOUR (24-hour format)            */
  223. /*    ARRAY[4]    is MINUTE                    */
  224. /*    ARRAY[5]    is SECOND                    */
  225. /************************************************************************/
  226.  
  227. /************************************************************************/
  228. /*    CARRDETECT returns nonzero value on valid carrier, else zero    */
  229. /************************************************************************/
  230. #start CARRDETECT x        /* routine to sense valid carrier    */
  231. #code INP ED            /* get modem line status        */
  232. #code ANDI 40            /* mask off Recieved Line Signal Detect */
  233. #code RET x            /* return 80 (TRUE) if carrier else 0    */
  234.  
  235. /************************************************************************/
  236. /*    GETYEAR return current year                    */
  237. /************************************************************************/
  238. #start GETYEAR x        /*                    */
  239. #code ARRAY[] 0         /* load from ARRAY[0]            */
  240. #code RET x            /* return it                */
  241.  
  242. /************************************************************************/
  243. /*    GETMONTH return current month                    */
  244. /************************************************************************/
  245. #start GETMONTH x        /*                    */
  246. #code ARRAY[] 1         /* load from ARRAY[1]            */
  247. #code RET x            /* return it                */
  248.  
  249. /************************************************************************/
  250. /*    GETDAY return current day                    */
  251. /************************************************************************/
  252. #start GETDAY x         /*                    */
  253. #code ARRAY[] 2         /* load from ARRAY[2]            */
  254. #code RET x            /* return it                */
  255.  
  256. /************************************************************************/
  257. /*    HANGUP breaks the modem connection.                */
  258. /************************************************************************/
  259. #start HANGUP x         /* routine to break modem connection    */
  260. #code INP    EF         /* Grab from command register        */
  261. #code ANDI   FD         /* Clear DTR bit ONLY            */
  262. #code OUTP   EF         /* Chuck it back to the cmd register,    */
  263. #code PAUSEI 50         /* then pause half a sec.        */
  264. #code XORI    2         /* This SHOULD set DTR back to 1.    */
  265. #code OUTP   EF         /* And throw at cmd register.        */
  266. #code RET x            /* No interesting value returned.    */
  267.  
  268. /************************************************************************/
  269. /*    INITDATE sets up date, in hardware clock if available        */
  270. /*                                    */
  271. /*    ARRAY[0]    is YEAR                     */
  272. /*    ARRAY[1]    is MONTH                    */
  273. /*    ARRAY[2]    is DAY                        */
  274. /*    ARRAY[3]    is HOUR (24-hour format)            */
  275. /*    ARRAY[4]    is MINUTE                    */
  276. /*    ARRAY[5]    is SECOND                    */
  277. /************************************************************************/
  278. #start INITDATE x        /*                    */
  279.  
  280. #code OPR# "Year" 84 90     /* get year from console        */
  281. #code ARRAY[]= 0        /* remember it in ARRAY[0]        */
  282.  
  283. #code OPR# "Month" 1 12     /* get month from console        */
  284. #code ARRAY[]= 1        /* remember it in ARRAY[1]        */
  285.  
  286. #code OPR# "Day" 1 31        /* get day from console         */
  287. #code ARRAY[]= 2        /* remember it in ARRAY[2]        */
  288.  
  289.                 /* forget HMS, ODD-DATA has no clock    */
  290.  
  291. #code RET x            /* return nothing interesting        */
  292.  
  293. /************************************************************************/
  294. /*    INITPORT sets up the modem port and modem.  No return value.    */
  295. /************************************************************************/
  296. #start INITPORT x        /* routine to initialize modem port    */
  297.     /************************************************/
  298.     /* Next line initializes the Hayes Smartmodem:    */
  299.     /* AT        Attention            */
  300.     /* Q1        Quiet mode -- no result codes    */
  301.     /* S0=1     Answer on first ring        */
  302.     /* E0        No echo of command line     */
  303.     /* S2=255    Disable escape character    */
  304.     /* S5=130    Disable backspace char        */
  305.     /* T        Touch-tone dialing.        */
  306.     /*                        */
  307.     /* My Smartmodem switches are set so:        */
  308.     /* #1 up    Support DTR, to hang up     */
  309.     /* #2 down    Non verbose result codes    */
  310.     /* #3 up    No result codes anyway        */
  311.     /* #4 down    No echo in command state    */
  312.     /* #5 up    Auto answer first ring        */
  313.     /* #6 up    Generate true Carrier Detect    */
  314.     /* #7 up    Single - line phone        */
  315.     /* #8 down    Looks prettier that way     */
  316.     /*    (You will note that some of these are    */
  317.     /*     redundantly with next command.)    */
  318.     /************************************************/
  319. #code OUTSTRING "AT Q1 S0=1 E0 S2=255 S5=130 T" /* stupify SmartModem    */
  320. #code RET x            /* return nothing interesting        */
  321.  
  322. /************************************************************************/
  323. /*    MIREADY returns nonzero value if modem char can be input, else 0*/
  324. /************************************************************************/
  325. #start MIREADY x        /* routine to sense modem char available*/
  326. #code INP ED            /* read modem status port        */
  327. #code ANDI 2            /* mask off char-ready bit
  328. #code RET x            /* return 1 if char ready, else zero    */
  329.  
  330. /************************************************************************/
  331. /*    MOREADY returns nonzero if modem is ready for output, else 0    */
  332. /************************************************************************/
  333. #start MOREADY x        /* routine to sense modem output OK    */
  334. #code INP ED            /* read modem status port        */
  335. #code ANDI 1            /* mask off output-ok bit        */
  336. #code RET x            /* return 20 (TRUE) if ok, else zero    */
  337.  
  338. #alldone x x            /* end of file                */
  339. /
  340. #code OUTSTRING "AT Q1 S0=1 E0 S2=255 S5=130