home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume21 / ecu / part29 < prev    next >
Encoding:
Text File  |  1991-08-05  |  53.4 KB  |  1,494 lines

  1. Newsgroups: comp.sources.misc
  2. From: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
  3. Subject:  v21i081:  ecu - ECU async comm package rev 3.10, Part29/37
  4. Message-ID: <1991Aug5.211853.8161@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: ad7a457ff42f3918ef1866462a053278
  6. Date: Mon, 5 Aug 1991 21:18:53 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
  10. Posting-number: Volume 21, Issue 81
  11. Archive-name: ecu/part29
  12. Environment: SCO, XENIX, ISC
  13. Supersedes: ecu3: Volume 16, Issue 25-59
  14.  
  15. ---- Cut Here and feed the following to sh ----
  16. #!/bin/sh
  17. # this is ecu310.29 (part 29 of ecu310)
  18. # do not concatenate these parts, unpack them in order with /bin/sh
  19. # file fasi/README.FASI continued
  20. #
  21. if touch 2>&1 | fgrep 'amc' > /dev/null
  22.  then TOUCH=touch
  23.  else TOUCH=true
  24. fi
  25. if test ! -r _shar_seq_.tmp; then
  26.     echo 'Please unpack part 1 first!'
  27.     exit 1
  28. fi
  29. (read Scheck
  30.  if test "$Scheck" != 29; then
  31.     echo Please unpack part "$Scheck" next!
  32.     exit 1
  33.  else
  34.     exit 0
  35.  fi
  36. ) < _shar_seq_.tmp || exit 1
  37. if test ! -f _shar_wnt_.tmp; then
  38.     echo 'x - still skipping fasi/README.FASI'
  39. else
  40. echo 'x - continuing file fasi/README.FASI'
  41. sed 's/^X//' << 'SHAR_EOF' >> 'fasi/README.FASI' &&
  42. X
  43. XReasons to use:
  44. X
  45. X1. You get cumulative statistics on such things as receievd and
  46. Xtransmitted characters, modem signals and device errors.  As an
  47. Xexample of the information available, the ecu interactive 'fasi'
  48. Xcommand produces:
  49. X
  50. Xbase address: 0218 irq=3 device is 16550
  51. XMSR=*CTS*DSR*   MCR=*DTR*RTS*OUT2*
  52. XLCR=*8db*1sb*NOPAR*   IER=*RDAV*TBMT*LS*MS*
  53. Xrecv ring cnt=0  xmit ring cnt=0  xmit fifo size=16
  54. Xcharacters received    =        3097
  55. Xcharacters transmitted =       22407
  56. Xmodem status events    =         137
  57. Xoverrun errors=0  framing errors=0  parity errors=0
  58. Xrings detected=0  breaks detected=0
  59. Xxmtr flow off XON/XOFF=0  RTS/CTS=31
  60. Xrcvr flow off XON/XOFF=0  RTS/CTS=0
  61. Xdriver:  'FAS/i 2.08.0'
  62. Xspace.c: 'FAS/i 2.08:{1,4,03f8-03ff,COM1},{8,3,0210-024f,DIGI-PC8}'
  63. X
  64. X2. There are no other reasons to use.
  65. X
  66. XReasons NOT to use:
  67. X
  68. X1.  It is not supported. It is released configured for one COM1 (irq 4)
  69. Xand one 8-port Digiboard PC-8.  I will help with any issue that I can,
  70. Xbut I will be very uninterested in answering questions like "How do I
  71. Xget FAS/i to work with my PacificRim ModemBlaster 4800?"
  72. X
  73. X2. It is less efficient than FAS.  Statistics take CPU cycles to accumulate.
  74. XAlso, Uwe has done an indescribably superb job of optimizing the driver
  75. Xfor efficiency.  I have not analyzed the effect my changes have made to
  76. Xthe micromanagment of emitted code Uwe did, but it cannot have but harmed.
  77. X
  78. X3. The driver is non-standard.  It barks in the face of most of
  79. Xwhat I look for in well-produced software.
  80. X
  81. X4. Uwe will continue to work magic and this driver is unlikely to
  82. Xinherit it.
  83. X
  84. X5. FAS nor FAS/i appear to support DOS access to communications
  85. Xdevices through MERGE.
  86. X
  87. XNow, you say, why does that Tucker kid want to turn my tty driver
  88. Xinto a newt ("Well, [it] got better.")?  Because it can be very useful
  89. Xif you are developing asychronous communications systems.  I find
  90. Xit very useful to know how many times CTS fluctuated during a test
  91. Xsession.  Like the 'ecufriend,' it isn't for everyone, but if you
  92. Xneed it, there it is.
  93. X
  94. X>Message-Id: <m0jXaOF-0000ElC@geminix.in-berlin.de>
  95. X>From: emory!geminix.in-berlin.de!gemini (Uwe Doering)
  96. X>Subject: Re: [Request permission to distribute FAS 2.08 instrumented version]
  97. X>To: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
  98. X>Date: Mon, 29 Apr 91 17:43:51 MES
  99. X>
  100. X>Hello Warren,
  101. X>
  102. X>>...I am writing is to ask your permission ...
  103. X>>to include with ecu a modified FAS 2.08 I am calling FAS/i (for
  104. X>>instrumentation) so you can have access to statistics 
  105. X>> [some stuff deleted]
  106. X>
  107. X>You sent me the necessary patches some time ago. Since then I tried to
  108. X>make up my mind about this issue. I decided now that I won't have the
  109. X>patches in the official FAS release. There is a reason for that. I want
  110. X>to keep FAS as clean as possible from the application program standpoint.
  111. X>
  112. X[some stuff deleted]
  113. X>
  114. X>You have my permission to release your special FAS version, but please
  115. X>make it clear in the docs that _you_ do the support for it, and
  116. X>that it is no official FAS release.
  117. X>
  118. X>      Uwe
  119. X>-- 
  120. X>Uwe Doering  |  INET : gemini@geminix.in-berlin.de
  121. X>Berlin       |----------------------------------------------------------------
  122. X>Germany      |  UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  123. X
  124. XThe strength of my earlier comments is driven in part by Uwe's comments.
  125. XI will be very disasppointed and red-faced if Uwe gets ONE query or
  126. Xrequest in regard to this hack.  I will be similarly dismayed if he
  127. Xgets one comment pro or con about folding these features into the
  128. Xofficial FAS.
  129. X
  130. XThis is a dead-end, special-purpose junkbox addition that just happens
  131. Xto be potentially useful.
  132. X
  133. XNow, with all that out of the way, here are a few useful tidbits:
  134. X
  135. X1. Configuration and installation are for the most part similar to
  136. Xthe standard FAS as of this writing.
  137. X
  138. X2. You will need to manually create a /usr/include/local directory
  139. Xbefore you begin any makes.
  140. X
  141. X3. The original FAS 2.08 functionality may be restored by turning
  142. Xoff #define FASI in several places.
  143. X
  144. X4. It has been used only on SCO.
  145. X
  146. X5. To use with ECU, you'll need to hack -DFASI_IN_USE into the
  147. Xecu Makefile.  The other programs in ecu don't need to know about it.
  148. X(Hint: ecufriends can make good use of the features.)
  149. X
  150. X6. If you turn on FAS/i support in ecu, you get the undocumented
  151. Xfasi interactive and procedure commands and these %functions:
  152. X
  153. XInteger functions:
  154. X%fasi       defined for all ecu versions; returns 1 if FAS/i
  155. X            support included, else 0 if not. The other functions
  156. X            will cause procedure termination with undefined function
  157. X            errors "ifi %fasi==0".
  158. X%msr        MSR current value
  159. X%lnerr      accumulated FE+OE+PE count
  160. X%ridet      accumulated RI count
  161. X%brdet      accumulated BREAK count
  162. X
  163. XString functions:
  164. X%msrtext    MSR current value in string form for easier (less efficient)
  165. X            MSR inspecition.  You can do something like
  166. X
  167. X     $s20 = %msrtext
  168. X     ifi %instr($s20,'CTS')
  169. X         echo 'CTS present'
  170. X     ifi %instr($s0,'RING')
  171. X         echo 'We are receiving a RING this very instant')
  172. XThe returned string is one or more substrings separated by asterisks.
  173. XSo, you might get 'CTS*DSR*RING*'.  The list of substrings, one for each
  174. Xbit in the canonized 8250 MSR:
  175. X
  176. XdCTS        delta CTS   <---+
  177. XdDSR        delta DSR       | you are unlikely to see these
  178. XdRI         delta RI        | since the driver catches interrupts
  179. XdDCD        delta DCD   <----
  180. XCTS     
  181. XDSR     
  182. XRING        
  183. XDCD     
  184. X
  185. X7. The fasiintf.c modules contains examples of each FAS/i-specific
  186. Xioctl.  These are also the only 'documentation' ever likely to be
  187. Xproduced for them other than this list:
  188. X
  189. XFASIC_SIP                  get entire fas_info struct
  190. XFASIC_MSR                  get various registers
  191. XFASIC_LCR     
  192. XFASIC_IER    
  193. XFASIC_MCR   
  194. XFASIC_DVR_IDENT            get driver revision
  195. XFASIC_SPACE_IDENT          get space.c revision
  196. XFASIC_RESET_STAT           reset statistics
  197. X
  198. X8. This hacked 'release' is in the style of a purpose-specific
  199. Xdriver.  If you have an SCO UNIX 3.2.x system with a standard COM1
  200. Xport and a Digiboard PC-8 on COM2, man are you in luck.  Otherwise,
  201. X
  202. X   while(!bored && !fed_up && !success)
  203. X   {
  204. X     adopt();
  205. X     adapt();
  206. X     improve();
  207. X   } /* "... I always say." -- thanks to John Cleese */
  208. X   exit(!success);
  209. X
  210. SHAR_EOF
  211. echo 'File fasi/README.FASI is complete' &&
  212. $TOUCH -am 0709233191 'fasi/README.FASI' &&
  213. chmod 0644 fasi/README.FASI ||
  214. echo 'restore of fasi/README.FASI failed'
  215. Wc_c="`wc -c < 'fasi/README.FASI'`"
  216. test 6394 -eq "$Wc_c" ||
  217.     echo 'fasi/README.FASI: original size 6394, current size' "$Wc_c"
  218. rm -f _shar_wnt_.tmp
  219. fi
  220. # ============= fasi/RELEASENOTES ==============
  221. if test -f 'fasi/RELEASENOTES' -a X"$1" != X"-c"; then
  222.     echo 'x - skipping fasi/RELEASENOTES (File already exists)'
  223.     rm -f _shar_wnt_.tmp
  224. else
  225. > _shar_wnt_.tmp
  226. echo 'x - extracting fasi/RELEASENOTES (Text)'
  227. sed 's/^X//' << 'SHAR_EOF' > 'fasi/RELEASENOTES' &&
  228. XThis is the original RELEASENOTES from FAS 2.08 for reference only.
  229. XRead README.FASI. DO NOT CONTACT UWE DOERING REGARDING THIS HACKED VERSION
  230. X                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  231. X
  232. X     release 1.1a Sat Nov 11, 1989
  233. X
  234. X     This is an unofficial release as I'm not the original author
  235. X     of this async driver.
  236. X
  237. X     Uwe Doering             INET : gemini@geminix.in-berlin.de
  238. X     Billstedter Pfad 17 b   UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  239. X     1000 Berlin 20
  240. X     Germany
  241. X
  242. X     New Features:
  243. X
  244. X          Added a third minor tty device number for every physical
  245. X          port. See description preceding the asyopen function in
  246. X          asy.c. Changed the behavior of ttyxx, too.
  247. X
  248. X          Added output hardware handshake support for DSR. Now you
  249. X          can do handshake with CTS, DSR or both. Input hardware
  250. X          handshake is on if you use at least one of the output
  251. X          handshake signals.
  252. X
  253. X          More flexible support of additional interrupt registers
  254. X          on mux boards. This is fully configurable now.
  255. X
  256. X          Added support for the CREAD flag. If not set, receiver
  257. X          interrupts are still serviced, but the received characters
  258. X          are simply thrown away. This is not as elegant as disabeling
  259. X          the interrupts themselves, but with the already existing
  260. X          driver it was the easiest way, and the most new-bugs-preventing,
  261. X          too.
  262. X
  263. X          Added a lot of comments to the source so that the curious
  264. X          user can understand why and how things are done.
  265. X
  266. X
  267. X     Bug Fixes:
  268. X
  269. X          The hang-up-on-last-close flag (HUPCL) was ignored. DTR
  270. X          was asserted regardless of this flag.
  271. X
  272. X          Made the detection of CTS and DCD more bullet-proof.
  273. X          Especially because between a close and the next open of
  274. X          a line, where interrupts are ignored, the software copys of
  275. X          CTS and DCD must be set up propperly in the asyopen function
  276. X          or the tty line would be blocked under certain circum-
  277. X          stances. For similar reasons, there is also a setup in the
  278. X          asyparam function.
  279. X
  280. X          Rewrote the input character processing function to work
  281. X          according to the TERMIO(7) man page.
  282. X
  283. X          Changed the behavior of BREAK generation to let the
  284. X          transmitter drain before TX is set to low.
  285. X
  286. X          Changed line hangup procedure so that the closing
  287. X          process returns immediately and doesn't sleep during
  288. X          the hangup delay/time. Instead, if an other process tries
  289. X          to open the line while hangup is still in progress, this
  290. X          process will sleep until hangup is competed.
  291. X
  292. X          With DOS Merge, on MicroPort V/386 3.0e the linker was
  293. X          missing the function `init8250'. Reengineered this from
  294. X          a disassembler listing of MicroPort's original driver and
  295. X          modified it to work with the NS16550A 16-byte FIFO. This
  296. X          funktion was added simply to be able to link the kernel.
  297. X          DOS Merge's virtual COM ports are still unusable with this
  298. X          release, though. To include this function, add a `-DMERGE'
  299. X          to the CFLAGS line in your makefile.
  300. X
  301. X          Made a lot of other corrections and enhancements in both
  302. X          speed and functionallity. As a result of all my effords
  303. X          I think this driver is slightly faster, more versatile
  304. X          and much more stable than the original release.
  305. X
  306. X     ------------------------------------------------------------
  307. X          
  308. X     release 1.1b Sat Nov 25, 1989
  309. X
  310. X     New Features:
  311. X
  312. X          Changed the minor device number scheme again.
  313. X          There are now two main groups: The unblocked open
  314. X          and the blocked open. Every group has four sub-modes
  315. X          and an additional hardware handshake flag. All this
  316. X          is coded in the higher four bits of the minor device
  317. X          number. Because of this, the maximum of 32 ports was
  318. X          reduced to 16 ports so that the port number fits into
  319. X          the remaining lower four bits of the minor device number.
  320. X          32 dumb ports in a single machine would have been overkill
  321. X          anyway. For more details refer to the description in the
  322. X          README file.
  323. X
  324. X     ------------------------------------------------------------
  325. X          
  326. X     release 2.00 Mon Nov 27, 1989
  327. X
  328. X     As this release differs so much from the original version I got,
  329. X     I now declare this as independant from the original author
  330. X     Jim Murray. This allows me to introduce new release levels
  331. X     without wondering whether they will collide with Jim's releases.
  332. X     Of course many credits to Jim for writing this software in the
  333. X     first place. Without his driver as a base I never would have
  334. X     been able to do such kernel driver development.
  335. X
  336. X     Bug Fixes:
  337. X
  338. X          If there were glitches on the hardware handshake lines
  339. X          and the DCD line a getty on this port would sometimes
  340. X          hang and become an immortal process. I think this was
  341. X          because the output buffer wasn't flushed properly
  342. X          on carrier loss. I hope I fixed this now. We'll see.
  343. X
  344. X     ------------------------------------------------------------
  345. X          
  346. X     release 2.01 Tue Nov 28, 1989
  347. X
  348. X     Did some cleanup in the source code.
  349. X
  350. X     I splitted the driver into two parts: The driver itself and
  351. X     the file `space.c'.
  352. X     `space.c' contains all data structures necessary to configure
  353. X     the driver and is compiled at kernel link time. Therefore if you
  354. X     change your serial card configuration you simply change `space.c'
  355. X     directly in the link kit directory and relink the kernel. No
  356. X     driver recompilation or installation is necessary for this.
  357. X     But note that whenever you use `make install' your setup in
  358. X     the link kit directory is overwritten by the original `space.c'
  359. X     file. Therefore you should copy your new `space.c' back to
  360. X     the source directory when you are finished with the configuration.
  361. X
  362. X     Renamed the package to `FAS Final Async Solution'. The following
  363. X     files have been renamed:
  364. X          asy.c          -> fas.c
  365. X          asy.h          -> fas.h
  366. X          asy_conf-xxxxx -> space-xxxxx
  367. X
  368. X     ISC 386/ix is supported now. There are separate makefiles
  369. X     for uPort and ISC to cope with the differences in link kit
  370. X     installation.
  371. X
  372. X     Bug Fixes:
  373. X
  374. X          `getty' still hung sometimes on a line with hardware
  375. X          handshake. Tried to fix it this time.
  376. X
  377. X     ------------------------------------------------------------
  378. X          
  379. X     release 2.02 Thu Nov 30, 1989
  380. X
  381. X     Abandoned the distinction between space-xxxxx files with
  382. X     and without hardware flow control because this is selected
  383. X     by the minor device number now.
  384. X
  385. X     Bug Fixes:
  386. X
  387. X          Set the high and low water marks for hardware input flow
  388. X          control to higher values than software flow control. This
  389. X          gives precedence to software flow control if both methods
  390. X          are used. These marks are self-adjusting and don't need to
  391. X          be changed if some flavor of UNIX has a different buffer
  392. X          size than the standard 256 characters. Before this change
  393. X          concurrent use of both flow controls could cause trouble
  394. X          with some high-speed modems. This is fixed now.
  395. X
  396. X          A flush read or write buffer request now also clears the
  397. X          receiver or transmitter FIFO, respectively. An ioctl
  398. X          call with a TCSETA* command clears the FIFOs, too.
  399. X
  400. X     ------------------------------------------------------------
  401. X          
  402. X     release 2.03 Fri Dec 01, 1989
  403. X
  404. X     Wrote an installation guide. The driver should be quite
  405. X     easy to install now.
  406. X
  407. X     Added tty node configuration files for ISC.
  408. X
  409. X     Hardware input flow control is bound now to the level of the
  410. X     receiver ring buffer instead of the UNIX input buffer. This
  411. X     has the advantage that buffer size and trigger levels are
  412. X     defined in the driver and therefore can be varied as needed.
  413. X
  414. X     New Features:
  415. X
  416. X          Added a boot time status message that shows the init
  417. X          state of each port. This tells you immediately what
  418. X          ports are found and initted by the driver. Useful to
  419. X          determine hardware configuration problems. Look at
  420. X          the description in the README file. Thanks to
  421. X          Kritt Gierlewsen (kritt@einoed.UUCP) for this proposal.
  422. X
  423. X     ------------------------------------------------------------
  424. X          
  425. X     release 2.04 Thu Dec 07, 1989
  426. X
  427. X     Did some cleanup in the source.
  428. X
  429. X     Removed the FIFO clear from the ioctl function. We don't want
  430. X     to do things there that aren't in the book.
  431. X
  432. X     An ioctl call that switches off the CLOCAL flag will create
  433. X     a SIGHUP signal if the carrier is actually missing at this
  434. X     time.
  435. X
  436. X     Every device is tested now quite thoroughly during initialization.
  437. X     If the test fails the corresponding device keeps unconfigured.
  438. X
  439. X     ------------------------------------------------------------
  440. X          
  441. X     release 2.05 Sat Jan 13, 1990
  442. X
  443. X     This is the first public release of the FAS driver.
  444. X
  445. X     Special thanks to the sysops of my test sites, Axel Fischer
  446. X     (fischer@utower.UUCP) and Kritt Gierlewsen (kritt@einoed.UUCP).
  447. X
  448. X     FAS is now an independant driver with its own driver name (`fas'),
  449. X     major device number, link kit directory and other things necessary
  450. X     for a driver. The original asy driver may or may not be linked
  451. X     with the kernel. You only need it if you want to access some
  452. X     serial devices via the virtual COM ports of the DOS emulator
  453. X     (DosMerge or VP/ix) because the FAS driver doesn't have this
  454. X     (really vendor dependant) feature.
  455. X
  456. X     The default prefix for tty device node names is `ttyF' now.
  457. X     This prevents mix-ups with the device names of the original
  458. X     asy driver.
  459. X
  460. X     Dropped the SYSV/AT support. I couldn't test the driver
  461. X     for several release generations on uPort SYSV/AT, and because
  462. X     there are not very much systems left with that flavor of UNIX
  463. X     it doesn't make sense to try to maintain compatibility with it.
  464. X     If someone really wants to use this driver on a 286 he has
  465. X     to port it himself.
  466. X
  467. X     Improved the transmitter FIFO fill procedure. Now it will try
  468. X     harder to fill the FIFO as much as possible to cut down on
  469. X     transmitter interrupts.
  470. X
  471. X     Software input flow control (XON/XOFF) is controlled by the driver now.
  472. X     It is bound to the level of the receiver ring buffer (as is hardware
  473. X     flow control). As usual, it can be switched on and off by the
  474. X     IXOFF flag in the termio(7) structure.
  475. X
  476. X     Changed and speeded up the ring buffer -> unix buffer processing.
  477. X
  478. X     For ISC, the getty lines for the inittab file are installed
  479. X     by the makefile now.
  480. X
  481. X     The conditional compilation of the function `init8250' (for
  482. X     DosMerge) is now controlled by a define in `fas.h'. The compiler
  483. X     switch `-DMERGE' is not used any more.
  484. X
  485. X     Improved the documentation.
  486. X
  487. X     The signals used for modem control and hardware flow control are
  488. X     fully configurable in the `space.c' file now. Look at `fas.h' for
  489. X     possible macros and combinations.
  490. X
  491. X     There are some new modes for hardware flow control, for instance
  492. X     HO_CTS_ON_DSR. This means that CTS is only looked at if DSR is on.
  493. X     If DSR is off output is possible regardless of CTS. The underlying
  494. X     assumption here is that we can expect proper handshake handling
  495. X     only from devices that are in the ready state (indicated by DSR).
  496. X     As a spin-off the problem with the hanging getty on lines with
  497. X     turned-off terminals (mentioned in earlier releases) should be
  498. X     gone if you use this new mode.
  499. X
  500. X     If the XCLUDE-Flag is availabe (SYSV 3.2 because of Xenix
  501. X     compatibility) exclusive open of a device is possible.
  502. X
  503. X     The default size of the input ring buffer is now 5000 bytes.
  504. X     This makes streaming input more likely even on loaded systems.
  505. X
  506. X     Bug Fixes:
  507. X
  508. X          The task state busy flag wasn't reset in some rare cases.
  509. X          This could cause processes to become immortal while waiting
  510. X          for the busy flag.
  511. X
  512. X          Under some special conditions an ioctl call with a TCSETA?
  513. X          command could corrupt the last character in the transmitter
  514. X          shift register. This is fixed now.
  515. X
  516. X          More fixing of the busy flag handling was necessary.
  517. X          Co-ordinating several delayed tasks controlling this flag
  518. X          is kind of tricky.
  519. X
  520. X          After a TCSETA* ioctl command we disable the transmitter
  521. X          for 2 sec (measured from the last transmitted character)
  522. X          if the character format and/or speed has changed. This
  523. X          gives the receiving side some time to do the same changes.
  524. X          This is kind of experimental. There may be applications that
  525. X          suffer from this delay. You may change the #define ADAPT_TIME
  526. X          in `fas.h' to a smaller value.
  527. X
  528. X     ------------------------------------------------------------
  529. X          
  530. X     release 2.06 Fri Mar 16, 1990
  531. X
  532. X     This should have been patch #3 for release 2.05, but there are
  533. X     so many changes now that I decided to make it a new release.
  534. X     Therefor some of the changes are described in the 2.05 release
  535. X     notes above but were never released to the public.
  536. X
  537. X     New Features:
  538. X
  539. X          There is a transmitter ring buffer now to make the output
  540. X          less system load dependent. This really speeds things up
  541. X          because the transmitter FIFO gets filled with more characters
  542. X          at once. The buffer size depends on the actual baud rate to
  543. X          prevent long output buffer drains at low speeds.
  544. X
  545. X          There are also bigger input buffers to make FAS more competitive
  546. X          against "intelligent" cards.
  547. X
  548. X          Lots of speed improvements and many small changes.
  549. X
  550. X     Bug Fixes:
  551. X
  552. X          Fixed input/output buffer flush on carrier loss while close
  553. X          is waiting for the output to drain.
  554. X
  555. X     ------------------------------------------------------------
  556. X          
  557. X     release 2.07 Tue Sep 18, 1990
  558. X
  559. X     This is a major redesign of the previous release. I put most of the
  560. X     time consuming tasks in one function that is invoked asynchronously
  561. X     by timeout calls. Inside this function most of the code runs at
  562. X     a lower system priority level (spl5) than the interrupts. That
  563. X     means that during character processing tty interrupts are allowed.
  564. X     This is the main key to operation at 38400 bps on multiple ports
  565. X     at the same time which is possible now with this release.
  566. X
  567. X     New Features:
  568. X
  569. X          FAS supports the VP/ix DOS emulator!
  570. X          Now you can throw out the vendor's original driver even
  571. X          if you like to have a serial mouse or modem access in DOS.
  572. X          Read the paragraph about VP/ix in the README file.
  573. X
  574. X          The Intel i82510 port chip is supported. It has separate
  575. X          4-character FIFOs for input and output. Although the
  576. X          NS16550A is much better this chip is your second choice
  577. X          if you can't get your hands on the National chips.
  578. X          Thanks to Christian Seyb (cs@gold.UUCP) for sending me
  579. X          patches and the necessary documentation for the Intel
  580. X          chips.
  581. X
  582. X          There is an init sequence in `space.c'. You can put any
  583. X          number of address-data pairs in a null terminated array
  584. X          to program your serial card or other hardware before
  585. X          FAS makes the first access to the ports. AST 4-port cards,
  586. X          for instance, have an additional port that needs to be
  587. X          written to with a certain bit pattern to allow shared
  588. X          interrupts. If you need to read a port to achieve the
  589. X          setting or resetting of flags as a side effect, this
  590. X          is possible, too.
  591. X
  592. X          ESIX is officially supported now.
  593. X
  594. X          SCO UNIX is officially supported, too. FAS needs to be
  595. X          compiled with the command line flag `-DSCO'. The makefile
  596. X          for SCO takes care of that. Thanks to Walter Mecky
  597. X          (walter@mecky.systemware.de) and Frank Simon
  598. X          (terra@sol.north.de) for helping me in making the necessary
  599. X          changes for SCO UNIX.
  600. X
  601. X          SCO Xenix 386 is also officially supported. FAS needs to be
  602. X          compiled with the command line flag `-DXENIX'. The makefile
  603. X          for SCO Xenix takes care of that. Thanks to Andreas
  604. X          Steinmetzler (andreas@oil.UUCP) for doing the port.
  605. X
  606. X          If you have the RTSFLOW and CTSFLOW termio(7) flags,
  607. X          hardware handshake can be controlled by them.
  608. X          Note that enabling handware flow control via the
  609. X          minor device number overrides these flags. If you
  610. X          like to use them you need to create tty device nodes
  611. X          with minor device numbers in which the bit for hardware
  612. X          handshake is set to 0. Look at the description in the
  613. X          README file for more details.
  614. X          Note also that if you choose to use RTSFLOW and CTSFLOW
  615. X          all your programs that do initial access to tty devices
  616. X          (getty, uucico, cu, SLIP dialup program etc.) need to know
  617. X          about these flags or hardware handshake will not be used.
  618. X
  619. X          The `O_EXCL' flag for the open(2) call is honored now.
  620. X          This allowes exclusive access to an FAS device without
  621. X          suffering from race conditions which could occure with
  622. X          the termio(7) XCLUDE flag method.
  623. X
  624. X          The `fas_test_device' function returns a digit now that
  625. X          indicates at which phase the test exited due to an error.
  626. X          This error digit is displayed in the boot message. Thanks
  627. X          to Brian Beattie (beattie@visenix.UUCP) for sending me
  628. X          the necessary patches.
  629. X
  630. X     Bug Fixes:
  631. X
  632. X          Automatic input FIFO flush after unblocking the getty
  633. X          open by the carrier or the unblock signal. This makes sure
  634. X          that there is no chance that there are characters in the
  635. X          FIFO that were received before the open got unblocked.
  636. X
  637. X          The sdevice entry for the AST 4-port card had a wrong
  638. X          I/O address range (`s_fas-mux4'). This didn't affect FAS
  639. X          but is checked by the kernel config program.
  640. X
  641. X          The gcc (GNU cc) support was removed because gcc's object
  642. X          file wants to link in some "helpful" functions that aren't
  643. X          contained in the kernel. But anyway, FAS is tuned so carefully
  644. X          and depends on the optimization behaviour of the AT&T
  645. X          standard C compiler that gcc won't have any advantages.
  646. X
  647. X          I changed the method with which the `fas_test_device' function
  648. X          waits for certain events. The `delay' function was used
  649. X          for that purpose but it turned out that with some flavors
  650. X          of UNIX it is prohibited to use this function during the
  651. X          xxinit phase of the boot process. Now a simple timeout loop
  652. X          is used instead.
  653. X
  654. X          Removed the ADAPT_TIME mechanismn introduced in release 2.05.
  655. X
  656. X          The open() call now returns an `EBUSY' error number if the
  657. X          device is already open and can't be opened in the desired
  658. X          mode at this time.
  659. X
  660. X          The handling of the RING signal needed fixing. Unlike the other
  661. X          three modem status lines RING generates an interrupt only at
  662. X          the trailing edge.
  663. X
  664. X          No SIGHUP signal is sent any more if an ioctl call clears
  665. X          the CLOCAL termio(7) flag while there is no carrier present.
  666. X          SIGHUP is only sent if the actual DCD modem line drops.
  667. X
  668. X          The files *-mux4 were renamed to *-ast4 because this type of
  669. X          card was originally developed by AST (AST 4-port card).
  670. X
  671. X     ------------------------------------------------------------
  672. X          
  673. X     release 2.08 Sun Jan 13, 1991
  674. X
  675. X     New Features:
  676. X
  677. X          Bell Tech/Intel UNIX 3.2 is supported.
  678. X
  679. X          SCO Xenix 286 is also supported now. Thanks to Nickolay Saukh
  680. X          (nms@saukh.rd.jvd.su) for providing the patches.
  681. X
  682. X          The Bell Tech HUB-6 card can be used with FAS. Thanks to
  683. X          Keith Walker (kew@cims2.UUCP) for the patches.
  684. X
  685. X          For AT&T derived flavors of UNIX there is a line automatically
  686. X          added to the kernel description file that makes the adding
  687. X          and removing of FAS possible via the `kconfig' program. Thanks
  688. X          to John Adams (johna@grumpy.boston.ma.us) for this idea.
  689. X
  690. X          There is a mechanismn now that prevents excessive modem status
  691. X          interrupts caused by crosstalking between wires or by a loose
  692. X          cable.
  693. X
  694. X          You can disable the FIFOs in a UART by "oring" the macro
  695. X          `NO_FIFO' to the base port address of this device. This is
  696. X          useful for mouse devices where you need immediate response
  697. X          to the mouse movement.
  698. X
  699. X          The meaning of the bit mapped part of the minor device
  700. X          numbers has changed. Some rather useless functions were
  701. X          removed in favor of more control over the hardware handshake
  702. X          modes. Even systems where the SCO RTSFLOW/CTSFLOW termio(7)
  703. X          flags are not available can now use half duplex hardware
  704. X          flow control (selected via the minor device number).
  705. X
  706. X          The assignment of RS232C lines to certain FAS functions
  707. X          is even more flexible now. This allows to connect two
  708. X          UNIX systems (with FAS) via a null modem cable, running
  709. X          a getty at both ends. For more details, read the paragraph
  710. X          about CABLING in the README file.
  711. X
  712. X          A special handling of the NS16550A input FIFO was introduced.
  713. X          This causes multiple receiver interrupts (on the same IRQ
  714. X          line) to be synchronized so that only one interrupt is
  715. X          necessary to process all receiving ports. This reduces the
  716. X          interrupt handling overhead and therefor results in lower
  717. X          CPU load for concurrent serial input at high speeds.
  718. X
  719. X          The `fas_event' function processes all scheduled events
  720. X          for all units with one single call. Previously, every unit
  721. X          launched its own timeout() call if there was work to
  722. X          do. This could lead to up to 16 timeouts at the same time,
  723. X          resulting in some timeout handling overhead. This overhead
  724. X          is minimized now.
  725. X
  726. X     Bug Fixes:
  727. X
  728. X          There were two bugs that could cause a port to lock up,
  729. X          resulting in an immortal process.
  730. X
  731. X          Almost any kernel sleep is killable now (at least with one or
  732. X          two `kill -9'). Therefor, there should be no more immortal
  733. X          processes. Even killing a process that is hanging in a
  734. X          close-on-exit call is possible.
  735. X
  736. X          The meaning of the RTSFLOW/CTSFLOW termio(7) flags was converted
  737. X          to what SCO had in mind (half duplex flow control). This is for
  738. X          compatibility reasons. Full duplex RTS/CTS hardware flow control
  739. X          is still possible via the minor device number method. Thanks to
  740. X          Dmitry V. Volodin (dvv@hq.demos.su) for providing me with the
  741. X          necessary knowledge.
  742. X
  743. X          If a process is already sleeping in a getty open it will only
  744. X          unblock on DCD low->high. In particular, if in the meantime
  745. X          the device was open for dialout and DCD is still present if
  746. X          the getty open takes over again this won't unblock the getty
  747. X          open any more.
  748. X
  749. X          And there were, as usual, a number of other small bug fixes.
  750. SHAR_EOF
  751. $TOUCH -am 0709233291 'fasi/RELEASENOTES' &&
  752. chmod 0644 fasi/RELEASENOTES ||
  753. echo 'restore of fasi/RELEASENOTES failed'
  754. Wc_c="`wc -c < 'fasi/RELEASENOTES'`"
  755. test 23494 -eq "$Wc_c" ||
  756.     echo 'fasi/RELEASENOTES: original size 23494, current size' "$Wc_c"
  757. rm -f _shar_wnt_.tmp
  758. fi
  759. # ============= fasi/Space.c ==============
  760. if test -f 'fasi/Space.c' -a X"$1" != X"-c"; then
  761.     echo 'x - skipping fasi/Space.c (File already exists)'
  762.     rm -f _shar_wnt_.tmp
  763. else
  764. > _shar_wnt_.tmp
  765. echo 'x - extracting fasi/Space.c (Text)'
  766. sed 's/^X//' << 'SHAR_EOF' > 'fasi/Space.c' &&
  767. X/* Async device configuration file for the FAS async driver. */
  768. X
  769. X/* 
  770. X * COM1(STD) + COM2(DIGIBOARD PC-8)
  771. X */
  772. X/*+:EDITS:*/
  773. X/*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  774. X/*:01-20-1991-16:17-wht@n4hgf-add fas_names */
  775. X/*:01-20-1991-05:01-wht@n4hgf-changed buffer sizes */
  776. X/*:01-16-1991-22:13-wht@n4hgf-creation */
  777. X/* FAS was developed by ( ==> BUT DO NOT CONTACT HIM ABOUT THIS HACK )
  778. XUwe Doering             INET : gemini@geminix.in-berlin.de
  779. XBillstedter Pfad 17 b   UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  780. X1000 Berlin 20
  781. XGermany
  782. X*/
  783. X
  784. X/* Alas, SCO idinstall has no -z (Define) option like ISC does */
  785. X#if !defined(FASI)
  786. X#define FASI
  787. X#endif
  788. X#if !defined(SCO)
  789. X#define SCO
  790. X#endif
  791. X
  792. X#if defined(FASI)
  793. X/* {quan,irq,addr1-addr2,type} */
  794. Xchar *fasi_space_ident =
  795. X"FAS/i 2.08:{1,4,03f8-03ff,COM1},{8,3,0210-024f,DIGI-PC8}";
  796. X#endif /* FASI */
  797. X
  798. X#if !defined (M_I286) && !defined(__STDC__) && !defined(__GNUC__)
  799. X#ident    "@(#)space.c    2.08.0 COM1(STD) + COM2(DIGIBOARD PC-8)";
  800. X#endif
  801. X
  802. X#include <sys/param.h>
  803. X#include <sys/types.h>
  804. X#include <sys/signal.h>
  805. X#include <sys/buf.h>
  806. X#include <sys/dir.h>
  807. X#if defined (XENIX)
  808. X#include <sys/page.h>
  809. X#include <sys/seg.h>
  810. X#endif
  811. X#include <sys/user.h>
  812. X#include <sys/errno.h>
  813. X#include <sys/tty.h>
  814. X#include <sys/conf.h>
  815. X#include <sys/sysinfo.h>
  816. X#include <sys/file.h>
  817. X#if !defined (XENIX) && !defined(CBAUD)
  818. X#include <sys/termio.h>
  819. X#endif
  820. X#include <sys/ioctl.h>
  821. X#if !defined(FASI)
  822. X#include <macros.h>
  823. X#endif
  824. X#if defined (HAVE_VPIX)
  825. X#if !defined (XENIX)
  826. X#include <sys/tss.h>
  827. X#include <sys/immu.h>
  828. X#include <sys/region.h>
  829. X#endif
  830. X#include <sys/proc.h>
  831. X#include <sys/v86.h>
  832. X#endif
  833. X
  834. X#if defined (XENIX)
  835. X#include "fas.h"
  836. X#include "digi-pc8.h"
  837. X#else
  838. X#include <local/fas.h>
  839. X#include <local/digi-pc8.h>
  840. X#endif
  841. X
  842. X/* This is the number of devices to be handled by this driver.
  843. X   You may define up to 16 devices.  If this number is changed
  844. X   the arrays below must be filled in accordingly.
  845. X*/
  846. X#define NUM_PHYSICAL_UNITS    9
  847. X
  848. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  849. X#undef NUM_PHYSICAL_UNITS
  850. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  851. X#endif
  852. X
  853. X/* let the driver know the number of devices */
  854. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  855. X
  856. X/* array of base port addresses
  857. X   If you deliberately want to force off the FIFOs of a UART you have
  858. X   to "or" the NO_FIFO macro to its base port address. This is useful
  859. X   for mouse devices where you need immediate response to the mouse
  860. X   movement.
  861. X*/
  862. Xulong    fas_port [NUM_PHYSICAL_UNITS] =
  863. X{
  864. X    0x3f8,
  865. X    COM21, COM22, COM23, COM24,COM25, COM26, COM27, COM28
  866. X};
  867. X
  868. X/*
  869. X * array of port names
  870. X * Note this is a kludge to enable kmem seeking programs to
  871. X * determine which tty is associated with which tty struct
  872. X * and is <yetch> duplication of information appearing in
  873. X * the Node (/etc/node.d/fas) file
  874. X */
  875. X#if defined(FASI)
  876. Xstruct fas_name    fas_names[NUM_PHYSICAL_UNITS * 2] =
  877. X{
  878. X    {"1a"},
  879. X    {"2a"}, {"2b"},{"2c"},{"2d"},{"2e"},{"2f"},{"2g"},{"2h"},
  880. X    {"1A"},
  881. X    {"2A"}, {"2B"},{"2C"},{"2D"},{"2E"},{"2F"},{"2G"},{"2H"}
  882. X};
  883. X#endif
  884. X
  885. X/* array of interrupt vectors */
  886. Xuint    fas_vec [NUM_PHYSICAL_UNITS] =
  887. X{
  888. X    4,
  889. X    3,3,3,3,3,3,3,3
  890. X};
  891. X
  892. X/* initialization sequence for serial card
  893. X   This array contains pairs of values of the form:
  894. X
  895. X        portaddress, value,
  896. X              :
  897. X              :
  898. X        portaddress, value,
  899. X        0
  900. X
  901. X   For every line `value' will be written to `portaddress'. If
  902. X   `value' is replaced with the macro `READ_PORT' then a value
  903. X   is read from `portaddress' instead. The value itself will be
  904. X   discarded. Therefor this makes only sense if the read access
  905. X   to the port has a side effect like setting or resetting
  906. X   certain flags.
  907. X
  908. X   NOTE: This array *must* be terminated with a value of 0
  909. X         in the portaddress column!
  910. X*/
  911. Xuint    fas_init_seq [] =
  912. X{
  913. X    0
  914. X};
  915. X
  916. X/* initial modem control port info
  917. X   This value is ored into the modem control value for each UART. This is
  918. X   normaly used to force out2 which is used to enable the interrupts of
  919. X   the standard com1 and com2 ports. Several brands of cards have modes
  920. X   that allow them to work in compatible mode like com1 and com2 or as a
  921. X   shared interrupts card. One of these cards is the AST 4-port card. When
  922. X   this card is used in shared interrupts mode out2 must _not_ be set.
  923. X
  924. X   Note: This is one of the major trouble-spots with shared interrupts
  925. X   cards. Check your manual.
  926. X*/
  927. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  928. X{
  929. X    MC_SET_OUT2,
  930. X    MC_SET_OUT2, MC_SET_OUT2, MC_SET_OUT2, MC_SET_OUT2,
  931. X    MC_SET_OUT2, MC_SET_OUT2, MC_SET_OUT2, MC_SET_OUT2
  932. X};
  933. X
  934. X/* array of modem control flags
  935. X   You can choose which signals to use for modem control. See fas.h
  936. X   for possible names and values. Whether or not modem control is
  937. X   used is determined by the minor device number at open time.
  938. X*/
  939. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  940. X{
  941. X    EO_DTR | EI_DTR | CA_DCD,
  942. X    EO_DTR | EI_DTR | CA_DCD, EO_DTR | EI_DTR | CA_DCD,
  943. X    EO_DTR | EI_DTR | CA_DCD, EO_DTR | EI_DTR | CA_DCD,
  944. X    EO_DTR | EI_DTR | CA_DCD, EO_DTR | EI_DTR | CA_DCD,
  945. X    EO_DTR | EI_DTR | CA_DCD, EO_DTR | EI_DTR | CA_DCD
  946. X};
  947. X
  948. X/* array of hardware flow control flags
  949. X   You can choose which signals to use for hardware handshake. See fas.h
  950. X   for possible names and values. Whether or not hardware handshake is
  951. X   used is determined by the minor device number at open time and by the
  952. X   RTSFLOW/CTSFLOW termio(7) flags.
  953. X*/
  954. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  955. X{
  956. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  957. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  958. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  959. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  960. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  961. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  962. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  963. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  964. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  965. X};
  966. X
  967. X/* array of control register addresses
  968. X   There are serial boards available that have all serial ports
  969. X   multiplexed to one address location in order to save I/O address
  970. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  971. X   by a special register that needs to be written to before the actual
  972. X   port registers can be accessed. This array contains the addresses
  973. X   of these special registers.
  974. X   Enter the addresses on a per unit base. An address of zero
  975. X   disables this feature.
  976. X*/
  977. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  978. X{
  979. X    0,
  980. X    0,    0, 0, 0, 0, 0, 0, 0
  981. X};
  982. X
  983. X/* array of control register values
  984. X   These values are written to the corresponding control register
  985. X   before the first access to the actual port registers. If not only
  986. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  987. X   single registers of the UART chips need to be multiplexed to one
  988. X   address you have to "or" a bit mask (shifted 8 times to the left)
  989. X   to the control register value. This mask determines at which bit
  990. X   locations the UART chip register number is "xored" into the control
  991. X   register value at runtime. This implies that you can also use
  992. X   negative logic by setting the bits in the control register value
  993. X   to 1 at the locations corresponding to the bit mask.
  994. X*/
  995. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  996. X{
  997. X    0,
  998. X    0, 0, 0, 0, 0, 0, 0, 0
  999. X};
  1000. X
  1001. X/* additional configurations for shared interrupts boards
  1002. X   If you have a shared interrupts board, you may have to acknowledge
  1003. X   interrupts by writing to a special register. The following arrays
  1004. X   contain the special register addresses and the corresponding values
  1005. X   that are written to them in response to an interrupt.
  1006. X*/
  1007. X
  1008. X/* array of int ack register addresses
  1009. X   These registers are written to every time after all interrupt
  1010. X   sources in all of the UARTs that are tied to the corresponding
  1011. X   interrupt vector have been cleared.
  1012. X   Enter the addresses on a per vector base. An address of zero
  1013. X   disables this feature.
  1014. X*/
  1015. Xuint    fas_int_ack_port [NUM_INT_VECTORS] =
  1016. X{
  1017. X    0,    0,    0,    0,
  1018. X    0,    0,    0,    0,
  1019. X    0,    0,    0,    0,
  1020. X    0,    0,    0,    0,
  1021. X    0,    0,    0,    0,
  1022. X    0,    0,    0,    0,
  1023. X    0,    0,    0,    0,
  1024. X    0,    0,    0,    0
  1025. X};
  1026. X
  1027. X/* array of int ack values
  1028. X   These values are written to the corresponding int ack register
  1029. X   in response to an interrupt.
  1030. X*/
  1031. Xuint    fas_int_ack [NUM_INT_VECTORS] =
  1032. X{
  1033. X    0,    0,    0,    0,
  1034. X    0,    0,    0,    0,
  1035. X    0,    0,    0,    0,
  1036. X    0,    0,    0,    0,
  1037. X    0,    0,    0,    0,
  1038. X    0,    0,    0,    0,
  1039. X    0,    0,    0,    0,
  1040. X    0,    0,    0,    0
  1041. X};
  1042. X
  1043. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1044. X   ============================================
  1045. X*/
  1046. X
  1047. X/* array of structures to hold all info for a physical minor device */
  1048. Xstruct fas_info    fas_info [NUM_PHYSICAL_UNITS];
  1049. X
  1050. X/* array of ttys for logical minor devices */
  1051. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1052. X
  1053. X/* array of pointers to fas_info structures
  1054. X   this prevents time consuming multiplications for index calculation
  1055. X*/
  1056. Xstruct fas_info    *fas_info_ptr [NUM_PHYSICAL_UNITS];
  1057. X
  1058. X/* array of pointers to fas_tty structures
  1059. X   this prevents time consuming multiplications for index calculation
  1060. X*/
  1061. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1062. SHAR_EOF
  1063. $TOUCH -am 0725125791 'fasi/Space.c' &&
  1064. chmod 0644 fasi/Space.c ||
  1065. echo 'restore of fasi/Space.c failed'
  1066. Wc_c="`wc -c < 'fasi/Space.c'`"
  1067. test 8680 -eq "$Wc_c" ||
  1068.     echo 'fasi/Space.c: original size 8680, current size' "$Wc_c"
  1069. rm -f _shar_wnt_.tmp
  1070. fi
  1071. # ============= fasi/System ==============
  1072. if test -f 'fasi/System' -a X"$1" != X"-c"; then
  1073.     echo 'x - skipping fasi/System (File already exists)'
  1074.     rm -f _shar_wnt_.tmp
  1075. else
  1076. > _shar_wnt_.tmp
  1077. echo 'x - extracting fasi/System (Text)'
  1078. sed 's/^X//' << 'SHAR_EOF' > 'fasi/System' &&
  1079. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  1080. Xfas    Y    1    7    1    3    210    250    0    0
  1081. SHAR_EOF
  1082. $TOUCH -am 0604201191 'fasi/System' &&
  1083. chmod 0644 fasi/System ||
  1084. echo 'restore of fasi/System failed'
  1085. Wc_c="`wc -c < 'fasi/System'`"
  1086. test 52 -eq "$Wc_c" ||
  1087.     echo 'fasi/System: original size 52, current size' "$Wc_c"
  1088. rm -f _shar_wnt_.tmp
  1089. fi
  1090. # ============= fasi/digi-pc8.h ==============
  1091. if test -f 'fasi/digi-pc8.h' -a X"$1" != X"-c"; then
  1092.     echo 'x - skipping fasi/digi-pc8.h (File already exists)'
  1093.     rm -f _shar_wnt_.tmp
  1094. else
  1095. > _shar_wnt_.tmp
  1096. echo 'x - extracting fasi/digi-pc8.h (Text)'
  1097. sed 's/^X//' << 'SHAR_EOF' > 'fasi/digi-pc8.h' &&
  1098. X/*+-------------------------------------------------------------------------
  1099. X    digi-pc8.h - Digiboard PC-8 with SCO COM2 addressing conventions
  1100. X    wht@n4hgf.Mt-Park.GA.US
  1101. X--------------------------------------------------------------------------*/
  1102. X/*+:EDITS:*/
  1103. X/*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  1104. X/*:12-24-1991-03:23-wht@n4hgf-creation */
  1105. X
  1106. X#define COM21    0x210        /* digi board */
  1107. X#define COM22    0x218
  1108. X#define COM23    0x220
  1109. X#define COM24    0x228
  1110. X#define COM25    0x230
  1111. X#define COM26    0x238
  1112. X#define COM27    0x240
  1113. X#define COM28    0x248
  1114. X#define COM2S    0x250
  1115. X
  1116. X/* vi: set tabstop=4 shiftwidth=4: */
  1117. X/* end of digi-pc8.h */
  1118. SHAR_EOF
  1119. $TOUCH -am 0725125791 'fasi/digi-pc8.h' &&
  1120. chmod 0644 fasi/digi-pc8.h ||
  1121. echo 'restore of fasi/digi-pc8.h failed'
  1122. Wc_c="`wc -c < 'fasi/digi-pc8.h'`"
  1123. test 612 -eq "$Wc_c" ||
  1124.     echo 'fasi/digi-pc8.h: original size 612, current size' "$Wc_c"
  1125. rm -f _shar_wnt_.tmp
  1126. fi
  1127. # ============= fasi/fas.c ==============
  1128. if test -f 'fasi/fas.c' -a X"$1" != X"-c"; then
  1129.     echo 'x - skipping fasi/fas.c (File already exists)'
  1130.     rm -f _shar_wnt_.tmp
  1131. else
  1132. > _shar_wnt_.tmp
  1133. echo 'x - extracting fasi/fas.c (Text)'
  1134. sed 's/^X//' << 'SHAR_EOF' > 'fasi/fas.c' &&
  1135. X/* FAS Final Async Solution driver for 286/386 versions of system V UNIX */
  1136. X
  1137. X/* FAS was developed by
  1138. XUwe Doering             INET : gemini@geminix.in-berlin.de
  1139. XBillstedter Pfad 17 b   UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  1140. X1000 Berlin 20
  1141. XGermany
  1142. X*/
  1143. X/*+:EDITS:*/
  1144. X/*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  1145. X/*:06-04-1991-19:41-wht@n4hgf-add FASIC_SIP_CHANGE */
  1146. X/*:02-05-1991-12:13-wht@n4hgf-apply 2.08b2->2.08.0 diffs */
  1147. X/*:01-20-1991-05:01-wht@n4hgf-changed buffer sizes */
  1148. X
  1149. X#if defined(FASI)
  1150. Xchar *fasi_driver_ident = "FAS/i 2.08.01";
  1151. X#endif /* FASI */
  1152. X
  1153. X#if !defined (M_I286) && !defined(__STDC__)
  1154. X#ident    "@(#)fas.c    2.08"
  1155. X#endif
  1156. X
  1157. X/* Note: This source code was quite heavily optimized for speed. You
  1158. X         may wonder that register variables aren't used everywhere.
  1159. X         This is because there is an overhead in memory accesses
  1160. X         when using register variables. As you may know data accesses
  1161. X         usually need much more wait states on the memory bus than
  1162. X         code accesses (because of page or cache misses). Therefor,
  1163. X         saving some data accesses has higher priority than saving
  1164. X         code accesses.
  1165. X
  1166. X         You may also note some not very elegant constructions that
  1167. X         may be intentional because they are faster. If you want to
  1168. X         make style improvements you should check the assembler output
  1169. X         whether this wouldn't slow things down.
  1170. X
  1171. X         Decisions for speed optimization were based on assembler
  1172. X         listings produced by the standard UNIX V 3.X/386 C compiler.
  1173. X*/
  1174. X
  1175. X#include <sys/param.h>
  1176. X#include <sys/types.h>
  1177. X#include <sys/signal.h>
  1178. X#include <sys/buf.h>
  1179. X#include <sys/dir.h>
  1180. X#if defined (XENIX)
  1181. X#include <sys/page.h>
  1182. X#include <sys/seg.h>
  1183. X#endif
  1184. X#include <sys/user.h>
  1185. X#include <sys/errno.h>
  1186. X#include <sys/tty.h>
  1187. X#include <sys/conf.h>
  1188. X#include <sys/sysinfo.h>
  1189. X#include <sys/file.h>
  1190. X#if !defined (XENIX) && !defined(CBAUD)
  1191. X#include <sys/termio.h>
  1192. X#endif
  1193. X#include <sys/ioctl.h>
  1194. X#if !defined(FASI)
  1195. X#include <macros.h>
  1196. X#endif
  1197. X#if defined (HAVE_VPIX)
  1198. X#if !defined (XENIX)
  1199. X#include <sys/tss.h>
  1200. X#include <sys/immu.h>
  1201. X#include <sys/region.h>
  1202. X#endif
  1203. X#include <sys/proc.h>
  1204. X#include <sys/v86.h>
  1205. X#endif
  1206. X
  1207. X#if defined (XENIX)
  1208. X#include "fas.h"
  1209. X#else
  1210. X#include <local/fas.h>
  1211. X#if !defined (NO_ASM)
  1212. X#include <sys/inline.h>
  1213. X#endif
  1214. X#endif
  1215. X
  1216. X#if defined (SCO) || defined (XENIX)
  1217. X#define asyputchar sioputchar
  1218. X#define asygetchar siogetchar
  1219. X#endif
  1220. X
  1221. X#if defined (XENIX) || defined (NO_ASM)
  1222. X#define intr_disable()    old_level = SPLINT ()
  1223. X#define intr_restore()    (void) splx (old_level)
  1224. X#define REGVAR
  1225. X#else
  1226. X/* This is a terrible ugly kludge to speed up the `inb' and `outb'
  1227. X   functions. I.e., originally, the `outb' inline function had an
  1228. X   overhead of four data memory accesses for parameter passing. This
  1229. X   parameter passing actually consumed more clock cycles than the
  1230. X   assembler `outb' command itself. Although this solution can't
  1231. X   prevent unnessessary register moves it limits them at least to
  1232. X   register to register moves that are much faster. You need a
  1233. X   line like the following in the declaration part of every
  1234. X   function that uses `inb' or `outb' calls:
  1235. X
  1236. X    REGVAR;
  1237. X
  1238. X   This hack should work with every compiler that knows about the
  1239. X   UNIX V 3.X/386 standard compiler's inline assembler directives.
  1240. X*/
  1241. X
  1242. Xasm    void loadal (val)
  1243. X{
  1244. X%reg    val;
  1245. X    movl    val,%eax
  1246. X%mem    val;
  1247. X    movb    val,%al
  1248. X}
  1249. X
  1250. Xasm    void loaddx (val)
  1251. X{
  1252. X%reg    val;
  1253. X    movl    val,%edx
  1254. X%mem    val;
  1255. X    movw    val,%dx
  1256. X}
  1257. X
  1258. Xasm    int outbyte ()
  1259. X{
  1260. X    outb    (%dx)
  1261. X}
  1262. X
  1263. Xasm    int inbyte ()
  1264. X{
  1265. X    xorl    %eax,%eax
  1266. X    inb    (%dx)
  1267. X}
  1268. X
  1269. X/* The port parameter of the `outb' macro must be one of the predefined
  1270. X   port macros from `fas.h' or a simple uint variable (no indirection
  1271. X   is allowed). Additionally, `fip' must be a register variable in the
  1272. X   functions where `outb' is used. This prevents the destruction of the
  1273. X   `eax' CPU register while loading the `edx' register with the port
  1274. X   address. This is highly compiler implementation specific.
  1275. X*/
  1276. X#define outb(port,val) (regvar = (val), loadal (regvar), regvar = (port), loaddx (regvar), outbyte ())
  1277. X
  1278. X#define inb(port) (regvar = (port), loaddx (regvar), inbyte ())
  1279. X
  1280. X#define REGVAR register uint    regvar
  1281. X
  1282. X/* This function inserts the address optimization assembler pseudo-op
  1283. X   wherever called.
  1284. X*/
  1285. X
  1286. Xasm    void optim ()
  1287. X{
  1288. X    .optim
  1289. X}
  1290. X
  1291. X/* This dummy function has nothing to do but to call optim so that
  1292. X   the `.optim' assembler pseudo-op will be included in the assembler
  1293. X   file. This must be the first of all functions.
  1294. X*/
  1295. X
  1296. X#if defined (OPTIM)    /* Define for uPort, ISC doesn't know about */
  1297. Xstatic void        /* `.optim', but has turned on optimization by */
  1298. Xdummy ()        /* default, so we don't need it there anyway. */
  1299. X{
  1300. X    optim ();
  1301. X}
  1302. X#endif
  1303. X#endif    /* XENIX || NO_ASM */
  1304. X
  1305. X/* functions provided by this driver */
  1306. Xint        fasinit ();
  1307. Xint        fasopen ();
  1308. Xint        fasclose ();
  1309. Xint        fasread ();
  1310. Xint        faswrite ();
  1311. Xint        fasioctl ();
  1312. Xint        fasintr ();
  1313. X#if defined (NEED_PUT_GETCHAR)
  1314. Xint        asyputchar ();
  1315. Xint        asygetchar ();
  1316. X#endif
  1317. X#if defined (NEED_INIT8250)
  1318. Xint        init8250 ();
  1319. X#endif
  1320. Xstatic int    fas_proc ();
  1321. Xstatic void    fas_param ();
  1322. Xstatic void    fas_fproc ();
  1323. Xstatic void    fas_mproc ();
  1324. Xstatic uint    fas_rproc ();
  1325. Xstatic void    fas_xproc ();
  1326. Xstatic void    fas_event ();
  1327. X#if defined (HAVE_VPIX)
  1328. Xstatic int    fas_vpix_sr ();
  1329. X#endif
  1330. Xstatic void    fas_rxfer ();
  1331. Xstatic void    fas_xxfer ();
  1332. Xstatic void    fas_ihlw_check ();
  1333. Xstatic void    fas_hdx_check ();
  1334. Xstatic void    fas_hangup ();
  1335. Xstatic void    fas_timeout ();
  1336. Xstatic void    fas_cmd ();
  1337. Xstatic void    fas_open_device ();
  1338. Xstatic void    fas_close_device ();
  1339. Xstatic uint    fas_make_ctl_val ();
  1340. Xstatic int    fas_test_device ();
  1341. X
  1342. X/* external functions used by this driver */
  1343. Xextern int    ttinit ();
  1344. Xextern int    ttiocom ();
  1345. Xextern int    ttyflush ();
  1346. Xextern int    SPLINT ();
  1347. Xextern int    SPLWRK ();
  1348. Xextern int    splx ();
  1349. Xextern int    sleep ();
  1350. Xextern int    wakeup ();
  1351. Xextern void    longjmp ();
  1352. Xextern int    signal ();
  1353. Xextern int    timeout ();
  1354. Xextern int    untimeout ();
  1355. Xextern int    printf ();
  1356. X#if defined (SCO) || defined (XENIX)
  1357. Xextern int    printcfg ();
  1358. X#endif
  1359. X#if defined (HAVE_VPIX)
  1360. Xextern int    fubyte ();
  1361. Xextern int    subyte ();
  1362. Xextern int    v86setint ();
  1363. X#endif
  1364. X#if defined (XENIX)
  1365. Xextern int    inb ();
  1366. Xextern int    outb ();
  1367. X#endif
  1368. X
  1369. X/* external data objects used by this driver */
  1370. Xextern int    tthiwat [];
  1371. X
  1372. X/* the following stuff is defined in space.c */
  1373. Xextern uint    fas_physical_units;
  1374. Xextern ulong    fas_port [];
  1375. Xextern uint    fas_vec [];
  1376. Xextern uint    fas_init_seq [];
  1377. Xextern uint    fas_mcb [];
  1378. Xextern ulong    fas_modem [];
  1379. Xextern ulong    fas_flow [];
  1380. Xextern uint    fas_ctl_port [];
  1381. Xextern uint    fas_ctl_val [];
  1382. Xextern uint    fas_int_ack_port [];
  1383. Xextern uint    fas_int_ack [];
  1384. Xextern struct fas_info    fas_info [];
  1385. Xextern struct tty    fas_tty [];
  1386. Xextern struct fas_info    *fas_info_ptr [];
  1387. Xextern struct tty    *fas_tty_ptr [];
  1388. X/* end of space.c references */
  1389. X
  1390. X#if defined(FASI)
  1391. Xint fasiintr_entries = 0;
  1392. Xextern char *fasi_space_ident;
  1393. X#endif /* FASI */
  1394. X
  1395. X/* fas_is_initted
  1396. X   Flag to indicate that we have been thru init.
  1397. X   This is realy only necessary for systems that use asyputchar
  1398. X   and asygetchar but it doesn't hurt to have it anyway.
  1399. X*/
  1400. Xstatic int    fas_is_initted = FALSE;
  1401. X
  1402. X/* event_scheduled
  1403. X   Flag to indicate that the event handler has been scheduled
  1404. X   via the timeout() function.
  1405. X*/
  1406. Xstatic int    event_scheduled = FALSE;
  1407. X
  1408. X/* array of pointers to the first fas_info structure for each
  1409. X   interrupt vector
  1410. X*/
  1411. Xstatic struct fas_info    *fas_first_int_user [NUM_INT_VECTORS];
  1412. X
  1413. X/* the values for the various baud rates */
  1414. Xstatic uint    fas_speeds [CBAUD + 1] =
  1415. X{    1,            BAUD_BASE/50,
  1416. X    BAUD_BASE/75,        BAUD_BASE/110,
  1417. X    (2*BAUD_BASE+134)/269,    BAUD_BASE/150,
  1418. X    BAUD_BASE/200,        BAUD_BASE/300,
  1419. X    BAUD_BASE/600,        BAUD_BASE/1200,
  1420. X    BAUD_BASE/1800,        BAUD_BASE/2400,
  1421. X    BAUD_BASE/4800,        BAUD_BASE/9600,
  1422. X    BAUD_BASE/19200,    BAUD_BASE/38400
  1423. X};
  1424. X
  1425. X/* time for one character to completely leave the transmitter shift register */
  1426. Xstatic uint    fas_ctimes [CBAUD + 1] =
  1427. X{    1,        HZ*15/50+2,
  1428. X    HZ*15/75+2,    HZ*15/110+2,
  1429. X    HZ*30/269+2,    HZ*15/150+2,
  1430. X    HZ*15/200+2,    HZ*15/300+2,
  1431. X    HZ*15/600+2,    HZ*15/1200+2,
  1432. X    HZ*15/1800+2,    HZ*15/2400+2,
  1433. X    HZ*15/4800+2,    HZ*15/9600+2,
  1434. X    HZ*15/19200+2,    HZ*15/38400+2
  1435. X};
  1436. X
  1437. X/* dynamically adapt xmit buffer size to baud rate to prevent long buffer
  1438. X   drains at low speeds
  1439. X   These values are checked against boundaries and will be modified if
  1440. X   necessary before use. Checking is done in fas_param (). Drain time
  1441. X   is about 5 seconds with continuous character flow.
  1442. X*/
  1443. Xstatic uint    fas_xbuf_size [CBAUD + 1] =
  1444. X{    1,        50/2,
  1445. X    75/2,        110/2,
  1446. X    269/4,        150/2,
  1447. X    200/2,        300/2,
  1448. X    600/2,        1200/2,
  1449. X    1800/2,        2400/2,
  1450. X    4800/2,        9600/2,
  1451. X    19200/2,    38400/2
  1452. X};
  1453. X
  1454. X/* lookup table for minor device number -> open mode flags translation */
  1455. Xstatic uint    fas_open_modes [16] =
  1456. X{
  1457. X    OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_CLOCAL,
  1458. X    OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_CLOCAL | OS_HWO_HANDSHAKE
  1459. X                            | OS_HWI_HANDSHAKE,
  1460. X    OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_CLOCAL | OS_HWO_HANDSHAKE,
  1461. X    OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_CLOCAL | OS_HWO_HANDSHAKE
  1462. X                            | OS_HDX_HANDSHAKE,
  1463. X    OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON,
  1464. X    OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_HWO_HANDSHAKE
  1465. X                        | OS_HWI_HANDSHAKE,
  1466. X    OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_HWO_HANDSHAKE,
  1467. X    OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_HWO_HANDSHAKE
  1468. X                        | OS_HDX_HANDSHAKE,
  1469. X    OS_OPEN_FOR_GETTY | OS_WAIT_OPEN | OS_NO_DIALOUT,
  1470. X    OS_OPEN_FOR_GETTY | OS_WAIT_OPEN | OS_NO_DIALOUT | OS_HWO_HANDSHAKE
  1471. X                            | OS_HWI_HANDSHAKE,
  1472. X    OS_OPEN_FOR_GETTY | OS_WAIT_OPEN | OS_NO_DIALOUT | OS_HWO_HANDSHAKE,
  1473. X    OS_OPEN_FOR_GETTY | OS_WAIT_OPEN | OS_NO_DIALOUT | OS_HWO_HANDSHAKE
  1474. X                            | OS_HDX_HANDSHAKE,
  1475. X    OS_OPEN_FOR_GETTY | OS_WAIT_OPEN,
  1476. SHAR_EOF
  1477. true || echo 'restore of fasi/fas.c failed'
  1478. fi
  1479. echo 'End of ecu310 part 29'
  1480. echo 'File fasi/fas.c is continued in part 30'
  1481. echo 30 > _shar_seq_.tmp
  1482. exit 0
  1483. --------------------------------------------------------------------
  1484. Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
  1485. Hacker Extraordinaire  d' async PADs,  pods,  proteins and protocols
  1486.  
  1487. exit 0 # Just in case...
  1488. -- 
  1489. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1490. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1491. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1492. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1493.