home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume32 / ecu / part35 < prev    next >
Text File  |  1992-09-15  |  58KB  |  1,874 lines

  1. Newsgroups: comp.sources.misc
  2. From: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
  3. Subject:  v32i070:  ecu - ECU Asynchronous Communications v3.20, Part35/40
  4. Message-ID: <1992Sep15.153603.20749@sparky.imd.sterling.com>
  5. X-Md4-Signature: bdb203a34c895c23071d16e94de17008
  6. Date: Tue, 15 Sep 1992 15:36:03 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
  10. Posting-number: Volume 32, Issue 70
  11. Archive-name: ecu/part35
  12. Environment: SCO,XENIX,ISC,SUNOS,SYSVR4,HDB,Curses
  13. Supersedes: ecu: Volume 21, Issue 53-89
  14.  
  15. ---- Cut Here and feed the following to sh ----
  16. #!/bin/sh
  17. # this is ecu320.35 (part 35 of ecu320)
  18. # do not concatenate these parts, unpack them in order with /bin/sh
  19. # file xsel386/select.txt continued
  20. #
  21. if test ! -r _shar_seq_.tmp; then
  22.     echo 'Please unpack part 1 first!'
  23.     exit 1
  24. fi
  25. (read Scheck
  26.  if test "$Scheck" != 35; then
  27.     echo Please unpack part "$Scheck" next!
  28.     exit 1
  29.  else
  30.     exit 0
  31.  fi
  32. ) < _shar_seq_.tmp || exit 1
  33. if test ! -f _shar_wnt_.tmp; then
  34.     echo 'x - still skipping xsel386/select.txt'
  35. else
  36. echo 'x - continuing file xsel386/select.txt'
  37. sed 's/^X//' << 'SHAR_EOF' >> 'xsel386/select.txt' &&
  38. X    17     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 3 5 | _msgget
  39. X    18     | 00 | 05 | 04 | 03 | 0 0 0 0 3 3 1 3 | _msgsnd
  40. X    19     | 06 | 07 | 05 | 03 | 0 0 0 3 5 3 1 3 | _msgrcv
  41. X    1a     | 00 | 05 | 04 | 03 | 0 0 0 0 7 3 4 3 | _semctl
  42. X    1b     | 00 | 04 | 03 | 03 | 0 0 0 0 0 3 3 5 | _semget
  43. X    1c     | 00 | 04 | 03 | 03 | 0 0 0 0 0 4 1 3 | _semop
  44. X    1d     | 00 | 04 | 03 | 03 | 0 0 0 0 0 1 3 3 | _shmctl
  45. X    1e     | 00 | 04 | 03 | 03 | 0 0 0 0 0 3 4 5 | _shmget
  46. X    1f     | 00 | 04 | 03 | 06 | 0 0 0 0 0 3 7 3 | _shmat
  47. X    20     | 00 | 04 | 03 | 03 | 0 0 0 0 0 1 3 3 | _proctl
  48. X    21     | 00 | 03 | 00 | 06 | 0 0 0 0 0 0 3 7 | _execseg
  49. X    22     | 00 | 02 | 00 | 03 | 0 0 0 0 0 0 0 7 | _unexecseg
  50. X    23     | 00 | 00 | 03 | 03 | 0 0 0 0 0 5 5 1 | _swapon
  51. X    24     | 00 | 09 | 05 | 03 | 0 0 0 1 1 1 1 3 | _select
  52. X
  53. XI couldn't really figure out how uadmin() was accessed.  libc's
  54. Xuadmin.o links in a routine that calls system call 0x37.  Hmmm...
  55. X
  56. XThe _cxentry is accessed by (documented in the programmer's reference
  57. Xunder System Calls) setting a bit in the system call number.  It seems
  58. Xas though it actually shifts the system call number up half a word and
  59. Xputs 0x28 in the low order halfword.
  60. X
  61. XNow we see that select() exists as a cxenix function (number 0x24),
  62. X
  63. XThere is also poll(), putmsg(), and getmsg() -- streams stuff.
  64. XSince the tty device is not a streams device (actually it looks as if
  65. Xthe streams stuff has been nulled out -- look at the master file for
  66. Xmore information) it is highly unlikely that these routines will do
  67. Xanything useful.  Infact, they don't.  Change the SYSNUM (and symbols)
  68. Xin the example open.s above to their appropriate values to try out the
  69. Xstreams routines.
  70. X
  71. Xselect.s looks something like:
  72. X
  73. X; select
  74. X;
  75. X;
  76. X;
  77. X
  78. X    title    select
  79. X
  80. X    .386
  81. X
  82. XSYSNUM    equ     2428h
  83. X
  84. Xextrn    _errno:dword
  85. X
  86. Xpublic  _select
  87. X
  88. X_TEXT    segment  dword use32 public 'CODE'
  89. X    assume   cs: _TEXT
  90. X_select    proc near
  91. X    mov    eax, SYSNUM        ; Get system call number.
  92. X
  93. X    ;
  94. X    ; I don't even pretend to understand masm syntax.  I tried
  95. X    ; the following line (and variations) without any success.
  96. X    ;
  97. X
  98. X;    call    far 7:0            ; Switch to kernel and call SYSNUM.
  99. X
  100. X    ;
  101. X    ; Don't laugh, it works.
  102. X    ;
  103. X
  104. X    db 9ah
  105. X    dw 0,0
  106. X    dw 7
  107. X
  108. X    jb    short _cerror        ; below == error.
  109. X
  110. X    xor    eax, eax        ; zero return value (no error).
  111. X    ret                ; done.
  112. X
  113. X_cerror:
  114. X    mov    _errno, eax        ; Save error code in _errno.
  115. X    mov    eax, -1            ; Return -1 (as error).
  116. X    ret                ; done.
  117. X
  118. X_select    endp
  119. X
  120. X_TEXT    ends
  121. X
  122. X    end
  123. X
  124. XThere is a header file you'll need in <sys/select.h> which has some
  125. Xinformation in it.
  126. X
  127. XA Synopsis of the SCO XENIX implementation:
  128. X
  129. X    #include <sys/select.h>
  130. X
  131. X    nfds = select(width readfds, writefds, exceptfds, timeout)
  132. X    int width, *readfds, *writefds, *exceptfds;
  133. X    struct timeval *timeout;  /* timeval is a pointer to a structure */
  134. X
  135. XI tested select() and found it to be half way implemented.  It seems
  136. Xas if there must be some extra field in struct cdevsw <sys/conf.h>.
  137. X
  138. XSo, I guess I wait 'til 3.2.
  139. X
  140. XPax, Keith
  141. X
  142. XPs, FYI.
  143. X
  144. XPps, if I made a mistake in my description of system call handling on
  145. XSCO XENIX or what not, please correct me.
  146. X
  147. XPpps, `call far 7:0' seems really reasonable to me.
  148. X-- 
  149. Xag@elgar.CTS.COM         Keith Gabryelski          ...!{ucsd, crash}!elgar!ag
  150. X
  151. X
  152. SHAR_EOF
  153. echo 'File xsel386/select.txt is complete' &&
  154. chmod 0644 xsel386/select.txt ||
  155. echo 'restore of xsel386/select.txt failed'
  156. Wc_c="`wc -c < 'xsel386/select.txt'`"
  157. test 21402 -eq "$Wc_c" ||
  158.     echo 'xsel386/select.txt: original size 21402, current size' "$Wc_c"
  159. rm -f _shar_wnt_.tmp
  160. fi
  161. # ============= xsel386/ttiocom.c ==============
  162. if test -f 'xsel386/ttiocom.c' -a X"$1" != X"-c"; then
  163.     echo 'x - skipping xsel386/ttiocom.c (File already exists)'
  164.     rm -f _shar_wnt_.tmp
  165. else
  166. > _shar_wnt_.tmp
  167. echo 'x - extracting xsel386/ttiocom.c (Text)'
  168. sed 's/^X//' << 'SHAR_EOF' > 'xsel386/ttiocom.c' &&
  169. X
  170. X#include <sys/types.h>
  171. X#include <sys/tty.h>
  172. X#include <sys/select.h>
  173. X
  174. Xttiocom(ttyp, com, arg, flag)
  175. Xstruct tty *ttyp;
  176. Xint com, arg, flag;     /* there should be better types for this :-) */
  177. X{
  178. X        if (com == IOC_SELECT)
  179. X        {
  180. X                ttselect(ttyp, flag);
  181. X                return(0);      /*** THIS IS IMPORTANT ***/
  182. X        }
  183. X        return(Ttiocom(ttyp, com ,arg, flag));
  184. X}
  185. X
  186. SHAR_EOF
  187. chmod 0644 xsel386/ttiocom.c ||
  188. echo 'restore of xsel386/ttiocom.c failed'
  189. Wc_c="`wc -c < 'xsel386/ttiocom.c'`"
  190. test 391 -eq "$Wc_c" ||
  191.     echo 'xsel386/ttiocom.c: original size 391, current size' "$Wc_c"
  192. rm -f _shar_wnt_.tmp
  193. fi
  194. # ============= memmove/README ==============
  195. if test ! -d 'memmove'; then
  196.     echo 'x - creating directory memmove'
  197.     mkdir 'memmove'
  198. fi
  199. if test -f 'memmove/README' -a X"$1" != X"-c"; then
  200.     echo 'x - skipping memmove/README (File already exists)'
  201.     rm -f _shar_wnt_.tmp
  202. else
  203. > _shar_wnt_.tmp
  204. echo 'x - extracting memmove/README (Text)'
  205. sed 's/^X//' << 'SHAR_EOF' > 'memmove/README' &&
  206. Xmemmove() is a very, very fast non-overlapping memory copy, but
  207. Xsince it does not save certain registers it uses, calling from
  208. XGCC can be tricky.  GCC does a fabulous job of grinding all it
  209. Xcan out of the available registers; MSC doesn't make very good
  210. Xuse of registers, er, I mean keeps a lot of registers for scratch
  211. Xuse.  I've never seen 386 MSC use dx except as a side effect of
  212. Xmultiply.  I guess that's what somebody (Gates?) meant by "tuning"
  213. Xone compiler to meet many needs being adequate. Enough philosophy,
  214. Xthough.
  215. X
  216. XI am using -fcall-used-{ax,bx,cx,dx} since in at least one
  217. Xcase (ecufkey.c display_keyset()), rigorous optimization and
  218. Xreally righteous register usage caused a call to strlen() to
  219. Xscrew up since cx is not preserved by strlen.
  220. X
  221. Xstrlen:         push    edi
  222. Xstrlen+0x1:     mov     edi,[esp+0x8]
  223. Xstrlen+0x5:     xor     eax,eax               <-- goodbye ax 
  224. Xstrlen+0x7:     mov     ecx,0xffffffff        <-- goodbye cx
  225. Xstrlen+0xc:     repne   scasb
  226. Xstrlen+0xe:     inc     ecx     
  227. Xstrlen+0xf:     mov     eax,ecx 
  228. Xstrlen+0x11:    not     eax
  229. Xstrlen+0x13:    pop     edi
  230. Xstrlen+0x14:    ret
  231. X
  232. Xmemmove:        push    ebp
  233. Xmemmove+0x1:    mov     ebp,esp
  234. Xmemmove+0x3:    mov     edx,edi               <-- move rather than push
  235. Xmemmove+0x5:    mov     ebx,esi               <-- move rather than push
  236. Xmemmove+0x7:    mov     esi,[ebp+0xc]
  237. Xmemmove+0xa:    mov     edi,[ebp+0x8]
  238. Xmemmove+0xd:    mov     eax,edi               <-- goodbye ax 
  239. Xmemmove+0xf:    mov     ecx,[ebp+0x10]        <-- goodbye cx (OK w/MSC)
  240. Xmemmove+0x12:   jcxz    memmove+0x43
  241. Xmemmove+0x14:   cmp     edi,esi
  242. Xmemmove+0x16:   jbe     memmove+0x2e
  243. Xmemmove+0x18:   mov     eax,esi
  244. Xmemmove+0x1a:   add     eax,ecx
  245. Xmemmove+0x1c:   cmp     edi,eax
  246. Xmemmove+0x1e:   jae     memmove+0x2e
  247. Xmemmove+0x20:   mov     eax,edi
  248. Xmemmove+0x22:   add     esi,ecx
  249. Xmemmove+0x24:   add     edi,ecx
  250. Xmemmove+0x26:   dec     esi
  251. Xmemmove+0x27:   dec     edi
  252. Xmemmove+0x28:   std
  253. Xmemmove+0x29:   rep     movsb
  254. Xmemmove+0x2b:   cld
  255. Xmemmove+0x2c:   jmp     near memmove+0x43
  256. Xmemmove+0x2e:   mov     eax,edi
  257. Xmemmove+0x30:   test    Byte Ptr 0x1f:0x1,al
  258. Xmemmove+0x36:   je      memmove+0x3a
  259. Xmemmove+0x38:   movsb
  260. Xmemmove+0x39:   dec     ecx
  261. Xmemmove+0x3a:   shr     ecx,1
  262. Xmemmove+0x3c:   rep     movsw
  263. Xmemmove+0x3f:   adc     ecx,ecx
  264. Xmemmove+0x41:   rep     movsb
  265. Xmemmove+0x43:   mov     esi,ebx
  266. Xmemmove+0x45:   mov     edi,edx
  267. Xmemmove+0x47:   pop     ebp
  268. Xmemmove+0x48:   ret
  269. Xmemmove+0x49:   nop
  270. Xmemmove+0x4a:   nop
  271. Xmemmove+0x4b:   nop
  272. X
  273. X---------------------------------------------------------------------
  274. X
  275. XThe memmove in theis directory is written in x86 assembler
  276. Xand is courtesy of Chip Salzenberg with some help from
  277. XRoger Cornelius.  I hacked out the .asm versions.
  278. X
  279. XChip Salzenberg:
  280. X> SCO's memmove() function in the 3.2v2 development system libc.a
  281. X> library has an insidious bug: it trashes the EBX register.  This
  282. X> register is used to hold register variables.  I suspect the bug crept
  283. X> in due to a simple-minded translation of a '286 routine, because on
  284. X> the '286, BX need not be preserved.
  285. X> 
  286. X> The fix is to replace memmove.o in /lib/libc.a with the version
  287. X> included below.  Note that if you use profiling, you must also put a
  288. X> profiling version of memmove() in /usr/lib/libp/libc.a.
  289. X> 
  290. X> To assemble the non-profiling version:
  291. X> 
  292. X>     as -m -o memmove.o memmove.s
  293. X
  294. X(How strange that this bug has gone unnoticed for so long...)
  295. X
  296. XRoger Cornelius <rac@sherpa.UUCP> :
  297. X> The following will build the profiling memmove.o correctly:
  298. X> 
  299. X> m4 profile.s memmove.s > memmove_p.s    # order is important!
  300. X> as -o memmove_p.o memmove_p.s
  301. X> 
  302. X> Note also that manually running memmove.s through m4 (instead of
  303. X> using as -m) before assembling will also save 100 or so bytes in the
  304. X> .o file for the non-profiling version.
  305. SHAR_EOF
  306. chmod 0644 memmove/README ||
  307. echo 'restore of memmove/README failed'
  308. Wc_c="`wc -c < 'memmove/README'`"
  309. test 3781 -eq "$Wc_c" ||
  310.     echo 'memmove/README: original size 3781, current size' "$Wc_c"
  311. rm -f _shar_wnt_.tmp
  312. fi
  313. # ============= memmove/memmove.s ==============
  314. if test -f 'memmove/memmove.s' -a X"$1" != X"-c"; then
  315.     echo 'x - skipping memmove/memmove.s (File already exists)'
  316.     rm -f _shar_wnt_.tmp
  317. else
  318. > _shar_wnt_.tmp
  319. echo 'x - extracting memmove/memmove.s (Text)'
  320. sed 's/^X//' << 'SHAR_EOF' > 'memmove/memmove.s' &&
  321. X/+------------------------------------------------------------------
  322. X/ memmove.s
  323. X/
  324. X/ $Id: memmove.s,v 1.3 1991/06/05 19:15:44 chip Exp $
  325. X/
  326. X/ Implementation of memmove(), which is inexplicably missing
  327. X/ from the SCO Unix C library.
  328. X/
  329. X/ for profiling version,
  330. X/ m4 profile.s memmove.s > memmove_p.s  # order is important!
  331. X/ as -o memmove_p.o memmove_p.s
  332. X/ 
  333. X/ Note also that manually running memmove.s through m4 (instead of
  334. X/ using as -m) before assembling will also save 100 or so bytes in
  335. X/ the .o file for the non-profiling version.
  336. X/ 
  337. X/-------------------------------------------------------------------
  338. X
  339. X    .globl    memmove
  340. Xmemmove:
  341. Xifdef(`PROFILE',`
  342. X    .bss
  343. X.L1:    .=.+4
  344. X    .text
  345. X    mov    $.L1,%edx
  346. X    .globl    _mcount
  347. X    call    _mcount
  348. X')
  349. X    push    %edi
  350. X    push    %esi
  351. X    mov    12(%esp),%edi
  352. X    mov    16(%esp),%esi
  353. X    mov    20(%esp),%ecx
  354. X    mov    %edi,%eax        / return value: dest
  355. X    jcxz    mm_exit
  356. X
  357. X    mov    %edi,%edx
  358. X    sub    %esi,%edx
  359. X    jb    mm_simple
  360. X    cmp    %edx,%ecx
  361. X    jb    mm_simple
  362. X
  363. X    add    %ecx,%edi
  364. X    dec    %edi
  365. X    add    %ecx,%esi
  366. X    dec    %esi
  367. X    std
  368. X    rep; movsb
  369. X    cld
  370. X    jmp    mm_exit
  371. X
  372. Xmm_simple:
  373. X    cld
  374. X    mov    %ecx,%edx
  375. X    shr    $2,%ecx
  376. X    rep; movs
  377. X    mov    %edx,%ecx
  378. X    and    $3,%ecx
  379. X    rep; movsb
  380. X
  381. Xmm_exit:
  382. X    pop    %esi
  383. X    pop    %edi
  384. X    ret
  385. SHAR_EOF
  386. chmod 0644 memmove/memmove.s ||
  387. echo 'restore of memmove/memmove.s failed'
  388. Wc_c="`wc -c < 'memmove/memmove.s'`"
  389. test 1143 -eq "$Wc_c" ||
  390.     echo 'memmove/memmove.s: original size 1143, current size' "$Wc_c"
  391. rm -f _shar_wnt_.tmp
  392. fi
  393. # ============= memmove/memmove386.asm ==============
  394. if test -f 'memmove/memmove386.asm' -a X"$1" != X"-c"; then
  395.     echo 'x - skipping memmove/memmove386.asm (File already exists)'
  396.     rm -f _shar_wnt_.tmp
  397. else
  398. > _shar_wnt_.tmp
  399. echo 'x - extracting memmove/memmove386.asm (Text)'
  400. sed 's/^X//' << 'SHAR_EOF' > 'memmove/memmove386.asm' &&
  401. X;+------------------------------------------------------------------
  402. X; memmove386.asm
  403. X;
  404. X; Name
  405. X;      memmove - Copies characters between objects.
  406. X;
  407. X; Syntax
  408. X;
  409. X;      void *memmove(dest, src, count)
  410. X;      void *dest;
  411. X;      const void *src;
  412. X;      size_t count;
  413. X;
  414. X; Description
  415. X;      The memmove function copies count characters from src to
  416. X;      dest.  If some regions of src and dest overlap, memmove
  417. X;      ensures that the original src bytes in the overlapping
  418. X;      region are copied before being overwritten.
  419. X;
  420. X; Return Value
  421. X;      The value of dest, the destination object.
  422. X;
  423. X;-------------------------------------------------------------------
  424. X;+:EDITS:
  425. X;:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
  426. X;:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
  427. X;:09-01-1991-23:15-wht@n4hgf-convert Chip's memmove.s
  428. X
  429. X    TITLE    $memmove
  430. X
  431. X    .386
  432. XDGROUP    GROUP    CONST, _BSS, _DATA
  433. X_DATA    SEGMENT  DWORD USE32 PUBLIC 'DATA'
  434. X_DATA      ENDS
  435. X_BSS    SEGMENT  DWORD USE32 PUBLIC 'BSS'
  436. X_BSS      ENDS
  437. XCONST    SEGMENT  DWORD USE32 PUBLIC 'CONST'
  438. XCONST      ENDS
  439. X    ASSUME   CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
  440. X
  441. X    PUBLIC  _memmove
  442. X    PUBLIC  memmove
  443. X
  444. X_TEXT    SEGMENT  DWORD USE32 PUBLIC 'CODE'
  445. X_memmove PROC NEAR
  446. Xmemmove:
  447. X    push    edi
  448. X    push    esi
  449. X    mov    edi,[esp+12]
  450. X    mov    esi,[esp+16]
  451. X    mov    ecx,[esp+20]
  452. X    mov    eax,edi        ; return value: dest
  453. X    jcxz    mm_exit
  454. X
  455. X    mov    edx,edi
  456. X    sub    edx,esi
  457. X    jb    short mm_left_to_right
  458. X    cmp    ecx,edx
  459. X    jb    short mm_left_to_right
  460. X
  461. Xmm_right_to_left:
  462. X    add    edi,ecx
  463. X    dec    edi
  464. X    add    esi,ecx
  465. X    dec    esi
  466. X    std
  467. X    rep movsb
  468. X    cld
  469. X    jmp    short mm_exit
  470. X
  471. Xmm_left_to_right:
  472. X    cld
  473. X    mov    edx,ecx
  474. X    shr    ecx,2
  475. X    rep movsw
  476. X    mov    ecx,edx
  477. X    and    ecx,3
  478. X    rep movsb
  479. X
  480. Xmm_exit:
  481. X    pop    esi
  482. X    pop    edi
  483. X    ret
  484. X_memmove  ENDP
  485. X_TEXT    ENDES
  486. X    end
  487. SHAR_EOF
  488. chmod 0644 memmove/memmove386.asm ||
  489. echo 'restore of memmove/memmove386.asm failed'
  490. Wc_c="`wc -c < 'memmove/memmove386.asm'`"
  491. test 1684 -eq "$Wc_c" ||
  492.     echo 'memmove/memmove386.asm: original size 1684, current size' "$Wc_c"
  493. rm -f _shar_wnt_.tmp
  494. fi
  495. # ============= memmove/memmove286.asm ==============
  496. if test -f 'memmove/memmove286.asm' -a X"$1" != X"-c"; then
  497.     echo 'x - skipping memmove/memmove286.asm (File already exists)'
  498.     rm -f _shar_wnt_.tmp
  499. else
  500. > _shar_wnt_.tmp
  501. echo 'x - extracting memmove/memmove286.asm (Text)'
  502. sed 's/^X//' << 'SHAR_EOF' > 'memmove/memmove286.asm' &&
  503. X;+------------------------------------------------------------------
  504. X; memmove386.asm
  505. X;
  506. X; Name
  507. X;      memmove - Copies characters between objects.
  508. X;
  509. X; Syntax
  510. X;
  511. X;      void *memmove(dest, src, count)
  512. X;      void *dest;
  513. X;      const void *src;
  514. X;      size_t count;
  515. X;
  516. X; Description
  517. X;      The memmove function copies count characters from src to
  518. X;      dest.  If some regions of src and dest overlap, memmove
  519. X;      ensures that the original src bytes in the overlapping
  520. X;      region are copied before being overwritten.
  521. X;
  522. X; Return Value
  523. X;      The value of dest, the destination object.
  524. X;
  525. X;-------------------------------------------------------------------
  526. X;+:EDITS:
  527. X;:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
  528. X;:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
  529. X;:09-01-1991-23:15-wht@n4hgf-convert Chip's memmove.s
  530. X
  531. X    TITLE   memmove286.asm
  532. X    .286p
  533. X    .287
  534. XMEMMOVE_TEXT    SEGMENT  WORD PUBLIC 'CODE'
  535. XMEMMOVE_TEXT    ENDS
  536. X_DATA    SEGMENT  WORD PUBLIC 'DATA'
  537. X_DATA    ENDS
  538. XCONST    SEGMENT  WORD PUBLIC 'CONST'
  539. XCONST    ENDS
  540. X_BSS    SEGMENT  WORD PUBLIC 'BSS'
  541. X_BSS    ENDS
  542. XDGROUP    GROUP    CONST, _BSS, _DATA
  543. X    ASSUME  CS: MEMMOVE_TEXT, DS: DGROUP, SS: DGROUP
  544. XEXTRN    __chkstk:FAR
  545. XMEMMOVE_TEXT      SEGMENT
  546. X    ASSUME    CS: MEMMOVE_TEXT
  547. X
  548. Xdest    equ    6
  549. Xsrc    equ    10
  550. Xlen    equ    14
  551. X
  552. X    PUBLIC    _memmove
  553. X_memmove    PROC FAR
  554. X    push    bp
  555. X    mov    bp,sp
  556. X    mov    ax,0
  557. X    call    FAR PTR __chkstk
  558. X    push    di
  559. X    push    si
  560. X    push    ds
  561. X
  562. X    mov    ax,WORD PTR [bp+src]
  563. X    mov    dx,WORD PTR [bp+src+2]
  564. X    mov    cx,WORD PTR [bp+len]
  565. X    mov    si,ax
  566. X    mov    ds,dx
  567. X    les    di,DWORD PTR [bp+dest]
  568. X    mov    dx,es
  569. X
  570. X; which way should the copy go?
  571. X    mov    ax,di
  572. X    sub    ax,si
  573. X    jb    short mm_ascend
  574. X    cmp    cx,ax
  575. X    jb    short mm_ascend
  576. X
  577. X; descending
  578. X    add    si,cx
  579. X    dec    si
  580. X    add    di,cx
  581. X    dec    di
  582. X    std
  583. X    rep    movsb
  584. X    cld
  585. X    jmp    short mm_exit
  586. X
  587. X; ascending
  588. Xmm_ascend:
  589. X    cld
  590. X    shr    cx,1
  591. X    rep    movsw
  592. X    adc    cx,cx
  593. X    rep    movsb
  594. X
  595. Xmm_exit:
  596. X    pop    ds
  597. X    pop    si
  598. X    pop    di
  599. X    leave    
  600. X    ret    
  601. X
  602. X_memmove  ENDP
  603. X_TEXT    ENDS
  604. X    end
  605. SHAR_EOF
  606. chmod 0644 memmove/memmove286.asm ||
  607. echo 'restore of memmove/memmove286.asm failed'
  608. Wc_c="`wc -c < 'memmove/memmove286.asm'`"
  609. test 1842 -eq "$Wc_c" ||
  610.     echo 'memmove/memmove286.asm: original size 1842, current size' "$Wc_c"
  611. rm -f _shar_wnt_.tmp
  612. fi
  613. # ============= timetest/Makefile ==============
  614. if test ! -d 'timetest'; then
  615.     echo 'x - creating directory timetest'
  616.     mkdir 'timetest'
  617. fi
  618. if test -f 'timetest/Makefile' -a X"$1" != X"-c"; then
  619.     echo 'x - skipping timetest/Makefile (File already exists)'
  620.     rm -f _shar_wnt_.tmp
  621. else
  622. > _shar_wnt_.tmp
  623. echo 'x - extracting timetest/Makefile (Text)'
  624. sed 's/^X//' << 'SHAR_EOF' > 'timetest/Makefile' &&
  625. X
  626. XPROGS = seltest naptest naptest2 naptest3
  627. X
  628. XLIB = -lx # -linet # needed on ISC
  629. X
  630. Xall: $(PROGS)
  631. X
  632. X# -linet needed on ISC
  633. Xseltest: seltest.c
  634. X    cc -o $@ $@.c
  635. X
  636. Xnaptest: seltest.c
  637. X    cc -o $@ $@.c $(LIB)
  638. X
  639. Xnaptest2: seltest.c
  640. X    cc -o $@ $@.c $(LIB)
  641. X
  642. Xnaptest3: seltest.c
  643. X    cc -o $@ $@.c $(LIB)
  644. X
  645. Xclean:
  646. X    rm -f $(PROGS)
  647. SHAR_EOF
  648. chmod 0644 timetest/Makefile ||
  649. echo 'restore of timetest/Makefile failed'
  650. Wc_c="`wc -c < 'timetest/Makefile'`"
  651. test 304 -eq "$Wc_c" ||
  652.     echo 'timetest/Makefile: original size 304, current size' "$Wc_c"
  653. rm -f _shar_wnt_.tmp
  654. fi
  655. # ============= timetest/naptest.c ==============
  656. if test -f 'timetest/naptest.c' -a X"$1" != X"-c"; then
  657.     echo 'x - skipping timetest/naptest.c (File already exists)'
  658.     rm -f _shar_wnt_.tmp
  659. else
  660. > _shar_wnt_.tmp
  661. echo 'x - extracting timetest/naptest.c (Text)'
  662. sed 's/^X//' << 'SHAR_EOF' > 'timetest/naptest.c' &&
  663. X/* CHK=0x88E6 */
  664. X/*+-------------------------------------------------------------------------
  665. X    naptest.c - nap test suite
  666. X    wht@n4hgf.Mt-Park.GA.US
  667. X
  668. XThis little program is derived from my first nap program from XENIX days.
  669. XThe M_XENIX code shows how predictable nap() behaves under XENIX 286
  670. Xand 386.  It assumes HZ is 50.  It surely was nice when UNIX came out
  671. Xwith 100 HZ for 10 msec clock ticks.  60 HZ 16.6666666666666666666667
  672. Xmsec clock ticks are a bit nauseating.
  673. X--------------------------------------------------------------------------*/
  674. X/*+:EDITS:*/
  675. X/*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
  676. X/*:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA */
  677. X/*:06-26-1988-14:05-wht-creation */
  678. X
  679. X#include <stdio.h>
  680. X#ifdef M_UNIX
  681. X#undef M_XENIX
  682. X#endif
  683. X
  684. X#ifndef M_XENIX
  685. X#include <sys/param.h>
  686. X#endif
  687. X
  688. Xmain(argc,argv,envp)
  689. Xint argc;
  690. Xchar    **argv;
  691. Xchar    **envp;
  692. X{
  693. X    register int itmp;
  694. X    long nap(),ms;
  695. X    int cnt[8];
  696. X
  697. X    for(itmp = 0; itmp < 8; itmp++)
  698. X        cnt[itmp] = 0;
  699. X
  700. X#ifdef M_XENIX
  701. X    printf("making 1000 nap(20L) calls\n");
  702. X    for(itmp = 0; itmp < 1000; itmp++)
  703. X    {
  704. X        switch(nap((long)20))
  705. X        {
  706. X        case 0L:    cnt[0]++; break;
  707. X        case 20L:    cnt[1]++; break;
  708. X        case 40L:    cnt[2]++; break;
  709. X        case 60L:    cnt[3]++; break;
  710. X        case 80L:    cnt[4]++; break;
  711. X        case 100L:    cnt[5]++; break;
  712. X        case 120L:    cnt[6]++; break;
  713. X        default:    cnt[7]++; break;
  714. X        }
  715. X    }
  716. X    printf("return value buckets:\n");
  717. X    printf("0:%d 20:%d 40:%d 60:%d 80:%d 100:%d 120:%d other:%d\n",
  718. X        cnt[0],cnt[1],cnt[2],cnt[3],cnt[4],cnt[5],cnt[6],cnt[7]);
  719. X#else
  720. X    printf("making 1000 nap(%ldL) calls\n",(1000 / HZ) + 1);
  721. X    for(itmp = 0; itmp < 1000; itmp++)
  722. X    {
  723. X        switch(ms = nap((long)(1000 / HZ) + 1))
  724. X        {
  725. X        case 0L:
  726. X            cnt[0]++; break;
  727. X        case (((1000 / HZ)    )  * 1):
  728. X        case (((1000 / HZ) + 1)  * 1):
  729. X            cnt[1]++; break;
  730. X        case (((1000 / HZ)    )  * 2):
  731. X        case (((1000 / HZ) + 1)  * 2):
  732. X            cnt[2]++; break;
  733. X        case (((1000 / HZ)    )  * 3):
  734. X        case (((1000 / HZ) + 1)  * 3):
  735. X            cnt[3]++; break;
  736. X        case (((1000 / HZ)    )  * 4):
  737. X        case (((1000 / HZ) + 1)  * 4):
  738. X            cnt[4]++; break;
  739. X        case (((1000 / HZ)    )  * 5):
  740. X        case (((1000 / HZ) + 1)  * 5):
  741. X            cnt[5]++; break;
  742. X        case (((1000 / HZ)    )  * 6):
  743. X        case (((1000 / HZ) + 1)  * 6):
  744. X            cnt[6]++; break;
  745. X        default:
  746. X            cnt[7]++; break;
  747. X        }
  748. X    }
  749. X
  750. X    printf("return value buckets:\n");
  751. X    for(itmp = 0; itmp < 7; itmp++)
  752. X        printf("%d:%d ",(1000/HZ)*itmp,cnt[itmp]);
  753. X    printf("other:%d\n",cnt[7]);
  754. X#endif
  755. X    exit(0);
  756. X
  757. X}    /* end of main */
  758. X
  759. X/* vi: set tabstop=4 shiftwidth=4: */
  760. SHAR_EOF
  761. chmod 0644 timetest/naptest.c ||
  762. echo 'restore of timetest/naptest.c failed'
  763. Wc_c="`wc -c < 'timetest/naptest.c'`"
  764. test 2447 -eq "$Wc_c" ||
  765.     echo 'timetest/naptest.c: original size 2447, current size' "$Wc_c"
  766. rm -f _shar_wnt_.tmp
  767. fi
  768. # ============= timetest/naptest2.c ==============
  769. if test -f 'timetest/naptest2.c' -a X"$1" != X"-c"; then
  770.     echo 'x - skipping timetest/naptest2.c (File already exists)'
  771.     rm -f _shar_wnt_.tmp
  772. else
  773. > _shar_wnt_.tmp
  774. echo 'x - extracting timetest/naptest2.c (Text)'
  775. sed 's/^X//' << 'SHAR_EOF' > 'timetest/naptest2.c' &&
  776. X/* CHK=0xD254 */
  777. X/*+-------------------------------------------------------------------------
  778. X    naptest2.c - nap test suite
  779. X    wht@n4hgf.Mt-Park.GA.US
  780. X
  781. XThis test checks a number of nap features.
  782. X
  783. X1.  Does nap correctly nap a reasonable interval of time over
  784. X    a range of selected periods?
  785. X2.  Does nap correctly return the period of time it napped?
  786. X--------------------------------------------------------------------------*/
  787. X/*+:EDITS:*/
  788. X/*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
  789. X/*:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA */
  790. X/*:09-03-1991-21:04-wht@n4hgf-make part of suite */
  791. X/*:06-26-1988-14:05-wht-creation */
  792. X
  793. X#include <stdio.h>
  794. X#include <sys/param.h>
  795. X
  796. X/*+-------------------------------------------------------------------------
  797. X    nap_test(period) - make repeated nap test for 'period'
  798. X--------------------------------------------------------------------------*/
  799. Xvoid
  800. Xnap_test(period)
  801. Xlong period;
  802. X{
  803. Xint itmp,zero_nap_count = 0;
  804. Xlong total = 0L,msec,then,now,nap();
  805. Xchar s64[64],*ctime();
  806. X#define CNT 500
  807. X
  808. X    printf("testing nap(%ldL) should take about %.2lf sec\n",
  809. X        period,(double)period * CNT / 1000.0);
  810. X    time(&then);
  811. X    printf("  started at %s",ctime(&then));
  812. X    itmp = CNT;
  813. X    while(itmp--)
  814. X    {
  815. X        msec = nap(period);
  816. X        total += msec;
  817. X        if(!msec)
  818. X            zero_nap_count++;
  819. X    }
  820. X    time(&now);
  821. X    strcpy(s64,ctime(&now));
  822. X    s64[strlen(s64) - 1] = 0;
  823. X    printf("  ended   at %s  (%ld secs)\n",s64,now - then);
  824. X    printf("  average nap return value = %.2lf msec\n",(double)total / CNT);
  825. X    printf("  reported zero length nap %d out of %d times\n\n",
  826. X        zero_nap_count,CNT);
  827. X
  828. X}   /* end of nap_test */
  829. X
  830. X/*+-------------------------------------------------------------------------
  831. X    main(argc,argv,envp)
  832. X--------------------------------------------------------------------------*/
  833. Xmain(argc,argv,envp)
  834. Xint argc;
  835. Xchar    **argv;
  836. Xchar    **envp;
  837. X{
  838. X    int hz;
  839. X    long hzmsec;
  840. X
  841. X    setbuf(stdout,NULL);
  842. X
  843. X/*
  844. X * learn tick rate for various timers
  845. X */
  846. X    if(getenv("HZ"))
  847. X        hz = atoi(getenv("HZ"));
  848. X    else
  849. X        hz = HZ;
  850. X    hzmsec = (1000 / hz) + 1; /* prevent damaged nap from not napping */
  851. X
  852. X    nap_test(5L);       /* this never naps at all unless accidental
  853. X                         * scheduling causes a delay
  854. X                         */
  855. X
  856. X    nap_test(hzmsec);
  857. X    nap_test(50L);
  858. X    exit(0);
  859. X
  860. X}   /* end of main */
  861. X
  862. X/* vi: set tabstop=4 shiftwidth=4: */
  863. SHAR_EOF
  864. chmod 0644 timetest/naptest2.c ||
  865. echo 'restore of timetest/naptest2.c failed'
  866. Wc_c="`wc -c < 'timetest/naptest2.c'`"
  867. test 2417 -eq "$Wc_c" ||
  868.     echo 'timetest/naptest2.c: original size 2417, current size' "$Wc_c"
  869. rm -f _shar_wnt_.tmp
  870. fi
  871. # ============= timetest/naptest3.c ==============
  872. if test -f 'timetest/naptest3.c' -a X"$1" != X"-c"; then
  873.     echo 'x - skipping timetest/naptest3.c (File already exists)'
  874.     rm -f _shar_wnt_.tmp
  875. else
  876. > _shar_wnt_.tmp
  877. echo 'x - extracting timetest/naptest3.c (Text)'
  878. sed 's/^X//' << 'SHAR_EOF' > 'timetest/naptest3.c' &&
  879. X/* CHK=0x83DE */
  880. X/*+-------------------------------------------------------------------------
  881. X    naptest3.c - nap test suite
  882. X    wht@n4hgf.Mt-Park.GA.US
  883. X
  884. XThis test attempts to see if small naps nap even though return value is 0,
  885. Xthus partially complying with the man page:
  886. X"The current process is suspended from execution for at least
  887. Xthe number of milliseconds specified by period ...." ^^^^^^^^
  888. X
  889. X--------------------------------------------------------------------------*/
  890. X/*+:EDITS:*/
  891. X/*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
  892. X/*:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA */
  893. X/*:09-03-1991-20:30-wht@n4hgf-creation */
  894. X
  895. X#include <stdio.h>
  896. X#include <sys/param.h>
  897. X
  898. Xmain(argc,argv)
  899. Xint argc;
  900. Xchar **argv;
  901. X{
  902. X    int itmp,hz,expected;
  903. X    char *cptr,*getenv(),*ctime();
  904. X    long hzmsec,then,now,actual;
  905. X
  906. X    /* learn tick period */
  907. X    if((cptr = getenv("HZ")) && *cptr)
  908. X        hz = atoi(cptr);
  909. X    else
  910. X        hz = HZ;
  911. X    hzmsec = (1000 / hz) + 1; /* prevent damaged nap from not napping */
  912. X
  913. X    itmp = 1000;
  914. X    expected = (int)(hzmsec * itmp / 1000L);
  915. X    printf("This should sleep about %d seconds, %ld+ msec at a time\n",
  916. X        expected, hzmsec - 1);
  917. X    time(&then);
  918. X    printf("Nap started at %s",ctime(&then));
  919. X    while(itmp--)
  920. X        nap(hzmsec - 1);
  921. X    time(&now);
  922. X    printf("Nap ended   at %s",ctime(&now));
  923. X    printf("Napped about %ld second(s)",actual = now - then);
  924. X    if(!actual)
  925. X        printf(", not at all!");
  926. X    else if(actual == 1)
  927. X        printf(". Must be a lucky epoch tick.  Try it again!");
  928. X    printf("\n",stdout);
  929. X
  930. X    exit(0);
  931. X}   /* end of main */
  932. SHAR_EOF
  933. chmod 0644 timetest/naptest3.c ||
  934. echo 'restore of timetest/naptest3.c failed'
  935. Wc_c="`wc -c < 'timetest/naptest3.c'`"
  936. test 1574 -eq "$Wc_c" ||
  937.     echo 'timetest/naptest3.c: original size 1574, current size' "$Wc_c"
  938. rm -f _shar_wnt_.tmp
  939. fi
  940. # ============= timetest/seltest.c ==============
  941. if test -f 'timetest/seltest.c' -a X"$1" != X"-c"; then
  942.     echo 'x - skipping timetest/seltest.c (File already exists)'
  943.     rm -f _shar_wnt_.tmp
  944. else
  945. > _shar_wnt_.tmp
  946. echo 'x - extracting timetest/seltest.c (Text)'
  947. sed 's/^X//' << 'SHAR_EOF' > 'timetest/seltest.c' &&
  948. X/* CHK=0xF551 */
  949. X/*+-------------------------------------------------------------------------
  950. X    testsel.c - test timeout interval of select()
  951. X    wht@n4hgf.Mt-Park.GA.US
  952. X--------------------------------------------------------------------------*/
  953. X/*+:EDITS:*/
  954. X/*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
  955. X/*:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA */
  956. X/*:09-03-1991-19:57-wht@n4hgf-creation */
  957. X
  958. X#include <stdio.h>
  959. X#ifdef M_SYSV /* SCO */
  960. X#include <sys/select.h>
  961. X#else
  962. X#include <sys/time.h>
  963. X#endif
  964. X
  965. X/*+-------------------------------------------------------------------------
  966. X    main(argc,argv)
  967. X--------------------------------------------------------------------------*/
  968. Xmain(argc,argv)
  969. Xint argc;
  970. Xchar **argv;
  971. X{
  972. Xstruct timeval tv;
  973. X
  974. X    setbuf(stdout,NULL);
  975. X
  976. X    while(1)
  977. X    {
  978. X        tv.tv_sec = 0;
  979. X        tv.tv_usec = 100*1000L;
  980. X        select(0,0,0,0,&tv);
  981. X        fputs("100 msec?\n",stdout);
  982. X    }
  983. X
  984. X    exit(0);
  985. X}    /* end of main */
  986. X
  987. X/* vi: set tabstop=4 shiftwidth=4: */
  988. X/* end of testsel.c */
  989. SHAR_EOF
  990. chmod 0644 timetest/seltest.c ||
  991. echo 'restore of timetest/seltest.c failed'
  992. Wc_c="`wc -c < 'timetest/seltest.c'`"
  993. test 968 -eq "$Wc_c" ||
  994.     echo 'timetest/seltest.c: original size 968, current size' "$Wc_c"
  995. rm -f _shar_wnt_.tmp
  996. fi
  997. # ============= doc/README ==============
  998. if test ! -d 'doc'; then
  999.     echo 'x - creating directory doc'
  1000.     mkdir 'doc'
  1001. fi
  1002. if test -f 'doc/README' -a X"$1" != X"-c"; then
  1003.     echo 'x - skipping doc/README (File already exists)'
  1004.     rm -f _shar_wnt_.tmp
  1005. else
  1006. > _shar_wnt_.tmp
  1007. echo 'x - extracting doc/README (Text)'
  1008. sed 's/^X//' << 'SHAR_EOF' > 'doc/README' &&
  1009. XUnusual characters and excessively long lines in news articles
  1010. Xcan cause problems on some installations.  While ECU is guaranteed
  1011. Xunuseful on such systems, news will travel through them to
  1012. Xreach some ECU customers.
  1013. XThe distributed manuals have been fed through the "col -b" filter
  1014. Xto reduce difficulties.
  1015. X
  1016. XWhen a patch requires manual changes, the patch set will contain
  1017. Xchanges for the nroff source.  However, it is quite, quite
  1018. Ximpractical to patch the nroff output itself.
  1019. X
  1020. XIf you do not have nroff and the mm macro set, I will be happy
  1021. Xto mail you a manual with the nroff underlining and bolding intact.
  1022. XI say happy.  If the demand grows too much, I'll make some
  1023. Xother arrangements.
  1024. X
  1025. XIf there is sufficient interest, I'll make a "nice and pretty"
  1026. Xlaser-printed manual available for a nominal charge.
  1027. SHAR_EOF
  1028. chmod 0644 doc/README ||
  1029. echo 'restore of doc/README failed'
  1030. Wc_c="`wc -c < 'doc/README'`"
  1031. test 804 -eq "$Wc_c" ||
  1032.     echo 'doc/README: original size 804, current size' "$Wc_c"
  1033. rm -f _shar_wnt_.tmp
  1034. fi
  1035. # ============= doc/Makefile ==============
  1036. if test -f 'doc/Makefile' -a X"$1" != X"-c"; then
  1037.     echo 'x - skipping doc/Makefile (File already exists)'
  1038.     rm -f _shar_wnt_.tmp
  1039. else
  1040. > _shar_wnt_.tmp
  1041. echo 'x - extracting doc/Makefile (Text)'
  1042. sed 's/^X//' << 'SHAR_EOF' > 'doc/Makefile' &&
  1043. X#+------------------------------------------------------
  1044. X# ECU manual Makefile
  1045. X#-------------------------------------------------------
  1046. X#+:EDITS:*/
  1047. X#:09-10-1992-13:58-wht@n4hgf-ECU release 3.20
  1048. X#:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA
  1049. X#:08-22-1992-15:07-wht@n4hgf-whoops - forgot -mm
  1050. X#:06-16-1992-02:05-wht@n4hgf-creation
  1051. X
  1052. XNROFF = nroff -mm
  1053. X
  1054. X#COL_PHRASE =
  1055. XCOL_PHRASE = | col
  1056. X#COL_PHRASE = | col -b
  1057. X
  1058. XECU_FILES = \
  1059. X    ecu.txt \
  1060. X    _top.txt \
  1061. X    _intro.txt \
  1062. X    _basic.txt \
  1063. X    _features.txt \
  1064. X    _startup.txt \
  1065. X    _icmd.txt \
  1066. X    _hdb.txt \
  1067. X    _exits.txt \
  1068. X    _end.txt
  1069. X
  1070. XPROC_FILES = \
  1071. X    proc.txt \
  1072. X    _p_param.txt \
  1073. X    _p_ifunc.txt \
  1074. X    _p_sfunc.txt \
  1075. X    _p_cmd.txt
  1076. X
  1077. Xall: ecu.man proc.man
  1078. X
  1079. Xecu.man: $(ECU_FILES)
  1080. X    $(NROFF) ecu.txt $(COL_PHRASE) > $@
  1081. X
  1082. Xproc.man: $(PROC_FILES)
  1083. X    $(NROFF) proc.txt $(COL_PHRASE) > $@
  1084. X
  1085. X# no funky characters in distribution shars
  1086. Xdist:
  1087. X    $(NROFF) ecu.txt | col -b > $@
  1088. X    $(NROFF) proc.txt | col -b > $@
  1089. X
  1090. SHAR_EOF
  1091. chmod 0644 doc/Makefile ||
  1092. echo 'restore of doc/Makefile failed'
  1093. Wc_c="`wc -c < 'doc/Makefile'`"
  1094. test 907 -eq "$Wc_c" ||
  1095.     echo 'doc/Makefile: original size 907, current size' "$Wc_c"
  1096. rm -f _shar_wnt_.tmp
  1097. fi
  1098. # ============= doc/_basic.txt ==============
  1099. if test -f 'doc/_basic.txt' -a X"$1" != X"-c"; then
  1100.     echo 'x - skipping doc/_basic.txt (File already exists)'
  1101.     rm -f _shar_wnt_.tmp
  1102. else
  1103. > _shar_wnt_.tmp
  1104. echo 'x - extracting doc/_basic.txt (Text)'
  1105. sed 's/^X//' << 'SHAR_EOF' > 'doc/_basic.txt' &&
  1106. X.*s 1 "Basic Organization"
  1107. X
  1108. XECU forks to run as two separate
  1109. Xprocesses, a transmitter (XMTR) and a receiver (RCVR).
  1110. XThe two processes
  1111. Xcommunicate via signals and a System V shared memory segment.
  1112. XXMTR controls RCVR and terminates it under certain circumstances,
  1113. Xcalled here auxiliary operations.  After an auxiliary operation
  1114. Xcompletes, XMTR forks again to recreate RCVR.
  1115. X
  1116. X.*s 2 "Transmitter Process (XMTR)"
  1117. X
  1118. XXMTR
  1119. Xaccepts user input from the computer keyboard; input is recognized
  1120. Xas belonging to one of two types: 1) transmit data and 2)
  1121. XECU commands.  Keyboard input
  1122. Xis passed to the serial line driver until an ECU command
  1123. Xis detected.  Commands are prefixed with a 
  1124. X.B HOME
  1125. Xkey which causes ECU to accept keyboard data up to the next ENTER
  1126. Xkey as command text.  After a command has been processed,
  1127. Xkeyed data is again routed to the serial line.
  1128. X
  1129. X.*s 3 "Keyboard Interface"
  1130. X
  1131. XThe keyboard driver is set into the raw mode.
  1132. XXMTR reads characters one at a time from the driver.
  1133. XNormally, characters read from the keyboard are passed directly to
  1134. Xthe serial line driver.  The
  1135. XASCII ESC ("escape") character is handled as a special case.
  1136. XWhen a function key is pressed, the keyboard generates
  1137. Xto XMTR an ESC character,
  1138. Xfollowed by more characters describing which function key has
  1139. Xbeen pressed.
  1140. XPressing the ESC key also causes XMTR to see an ESC character,
  1141. Xbut with no subsequent function key "suffix".
  1142. X
  1143. XWhen an ESC character is read, XMTR delays transmission of the
  1144. Xcharacter to the line for a short period to determine whether
  1145. Xthe ESC key has been pressed or a function key has been pressed.
  1146. XIf no "suffix" is detected, the ESC is passed to the line, having
  1147. Xsuffered an insignificant delay given human typing speeds.
  1148. X
  1149. XIf a function key "suffix" is detected, the function key type
  1150. Xis decoded.  The
  1151. X.B HOME
  1152. Xkey indicates an ECU command follows.  Any
  1153. Xother function key is passed to the function key mapping feature
  1154. X(described later).
  1155. X
  1156. X.*s 3 "ECU Command Assembly"
  1157. X
  1158. XAfter 
  1159. X.B HOME
  1160. Xhas been pressed, XMTR presents a reverse video prompt on the
  1161. Xdisplay, indicating its readiness to accept a command.  During
  1162. Xinput, the command may be edited using the same control keys
  1163. Xspecified with stty(C).  Additonal editing
  1164. Xusing the left and right arrow keys and the
  1165. XIns(ert) key are usually available.
  1166. XCommand input may be aborted by pressing ESC.
  1167. XWhen a command string has been assembled, it is passed to the
  1168. Xcommand processor, which breaks the command arguments into a token
  1169. Xarray similar to the argc/argv array.  When the command handler
  1170. Xreturns, XMTR returns to its normal mode of copying keyboard data to
  1171. Xthe serial line.
  1172. X
  1173. XFurther information on XMTR command line processing may be found in 
  1174. Xlater sections titled Line Editing and Interactive Command History.
  1175. X
  1176. X.*s 3 "Function Key Mapping"
  1177. X
  1178. XWhile in tty-to-line mode, function keys other than 
  1179. X.B HOME
  1180. Xare available to be mapped
  1181. Xto transmit short keystroke sequences on a connection by
  1182. Xconnection basis.  Under control of the dialing command ("Dial"
  1183. Xdescribed below)  or the function key control command ("FK"),
  1184. Xpredefined function key maps may be loaded.
  1185. X
  1186. XFunction keys which may be mapped are
  1187. X.B F1
  1188. Xthrough
  1189. X.B F12 ,
  1190. X.B PgUp ,
  1191. X.B PgDn ,
  1192. X.B End ,
  1193. X.B Ins ,
  1194. X.B Del ,
  1195. Xand
  1196. Xthe cursor control keys.
  1197. X
  1198. XThe unshifted keypad '5' key is permanently mapped to
  1199. Xproduce a screen snapshot when it is pressed and XMTR is
  1200. Xreading from the keyboard.
  1201. X
  1202. XThe BackTab (shift Tab) key is permanently mapped to a screen
  1203. Xredisplay feature.
  1204. X
  1205. X.*s 3 "Auxiliary Operation Control"
  1206. X
  1207. XCertain commands cause ECU to perform what is called an
  1208. Xauxiliary operation, requiring temporary termination of the
  1209. XRCVR process.  Such operations are not as useful
  1210. Xwith
  1211. X.B cu(C) ,
  1212. Xbecause cu does NOT kill its receiver process at any time.
  1213. XAs a result, it impossible to run a modern file transfer
  1214. Xprotocol since the cu receiver process eats some of the
  1215. Xcharacters sent by the remote protocol program.
  1216. X
  1217. XThere are two types of auxiliary operations:
  1218. X1) internal interactive command or procedure
  1219. Xexecution and 2) external program execution.
  1220. XCertain
  1221. X.B internal
  1222. X.B commands
  1223. Xrequire tight control over the serial line.
  1224. XFor instance, the
  1225. X.B dial
  1226. Xcommand requires transmitting modem command
  1227. Xstrings and receiving modem response codes.  Such functions
  1228. Xare best accomplished by single-process control of the line.
  1229. X.B External
  1230. X.B program
  1231. Xexecution is of two kinds, file transfer invocation
  1232. Xand local shell/command execution.
  1233. X
  1234. XThe RCVR process is terminated in any of these cases either to
  1235. Xavoid the RCVR swallowing characters intended for other
  1236. Xtargets (the modem handler in XMTR or the file transfer protocol)
  1237. Xor to avoid having remote data interspersed with the output of
  1238. Xlocal programs.
  1239. X
  1240. X.*s 2 "Receiver Process (RCVR)"
  1241. X
  1242. XThe receiver process reads the incoming serial data stream and
  1243. Xpasses it to the user terminal driver through a filter which
  1244. Xscans for events such as the occurrence of ASCII BEL (bell)
  1245. Xcharacters or terminal control sequences.  RCVR also handles
  1246. Xthe session logging and ANSI filter functions.
  1247. X
  1248. X.*s 3 "ANSI Filter"
  1249. X
  1250. XSince the term "ANSI" is used to describe
  1251. X.B many
  1252. Xvariations on the ANSI X3.64 recommendations for terminal control (read
  1253. X"IBM pseudo-ANSI"), the ECU receiver process has an "ANSI filter" which
  1254. Xattempts to translate incompatible (read "MSDOS") ANSI-like control
  1255. Xsequences to sequences acceptable to the console terminal in use.
  1256. XThis includes support for the MS-DOS "save cursor" and "restore cursor"
  1257. Xsequences.
  1258. XMore information may be found later in "Supported Terminals."
  1259. X
  1260. X.*s 3 "Session Logging"
  1261. X
  1262. XWhen directed by the user, the RCVR process logs incoming serial
  1263. Xdata to a file named on the log command line.  The default operation
  1264. Xis to filter unprintable characters (other than TAB and NL) from the
  1265. Xlog, but raw logging is available with a command option.  In a like
  1266. Xmanner, the default is for appending to an existing file, but a
  1267. Xcommand option may specify scratching any previous contents.
  1268. X
  1269. XLog files receive header lines each time the file is
  1270. Xopened, stating the logical system name, the telephone number
  1271. Xand the date/time.
  1272. X
  1273. SHAR_EOF
  1274. chmod 0644 doc/_basic.txt ||
  1275. echo 'restore of doc/_basic.txt failed'
  1276. Wc_c="`wc -c < 'doc/_basic.txt'`"
  1277. test 6050 -eq "$Wc_c" ||
  1278.     echo 'doc/_basic.txt: original size 6050, current size' "$Wc_c"
  1279. rm -f _shar_wnt_.tmp
  1280. fi
  1281. # ============= doc/_end.txt ==============
  1282. if test -f 'doc/_end.txt' -a X"$1" != X"-c"; then
  1283.     echo 'x - skipping doc/_end.txt (File already exists)'
  1284.     rm -f _shar_wnt_.tmp
  1285. else
  1286. > _shar_wnt_.tmp
  1287. echo 'x - extracting doc/_end.txt (Text)'
  1288. sed 's/^X//' << 'SHAR_EOF' > 'doc/_end.txt' &&
  1289. X
  1290. X.br
  1291. X.nr si 0n
  1292. X.af % i
  1293. X.ls 1
  1294. X.TC 1 1 3
  1295. SHAR_EOF
  1296. chmod 0644 doc/_end.txt ||
  1297. echo 'restore of doc/_end.txt failed'
  1298. Wc_c="`wc -c < 'doc/_end.txt'`"
  1299. test 39 -eq "$Wc_c" ||
  1300.     echo 'doc/_end.txt: original size 39, current size' "$Wc_c"
  1301. rm -f _shar_wnt_.tmp
  1302. fi
  1303. # ============= doc/_exits.txt ==============
  1304. if test -f 'doc/_exits.txt' -a X"$1" != X"-c"; then
  1305.     echo 'x - skipping doc/_exits.txt (File already exists)'
  1306.     rm -f _shar_wnt_.tmp
  1307. else
  1308. > _shar_wnt_.tmp
  1309. echo 'x - extracting doc/_exits.txt (Text)'
  1310. sed 's/^X//' << 'SHAR_EOF' > 'doc/_exits.txt' &&
  1311. X.*s 1 "Exit Codes"
  1312. X
  1313. XWhen ECU exits (terminates execution),
  1314. Xit uses a code from the following table:
  1315. X.DS L
  1316. XOK                   0    no error
  1317. XSIG1                 1    SIGHUP (signal 1)
  1318. XSIGN                 64   signal 64 - see below
  1319. XLINE_READ_ERROR      129  could not read from attached line
  1320. XXMTR_WRITE_ERROR     130  could not write to attached line
  1321. XXMTR_LOGIC_ERROR     131  software logic error
  1322. XBSD4_IOCTL           132  not currently used
  1323. XSHM_ABL              133  not currently used
  1324. XSHM_RTL              134  not currently used
  1325. XNO_FORK_FOR_RCVR     135  could not fork receiver process
  1326. XTTYIN_READ_ERROR     136  could not read from console
  1327. XLINE_OPEN_ERROR      137  could not attach (open) requested line
  1328. XPWENT_ERROR          138  error in /etc/passwd processing
  1329. XUSAGE                139  command line syntax error
  1330. XCONFIG_ERROR         140  missing or erroroenous configuration file
  1331. XCURSES_ERROR         141  error in curses use
  1332. XRCVR_FATAL_ERROR     142  receiver died unexpectedly
  1333. XMALLOC               143  critical memory allocation failure
  1334. XLOGIC_ERROR          144  internal logic error
  1335. XGEOMETRY             145  unsupported screen geometry
  1336. XINIT_PROC_ERROR      192  initial procedure terminated in error
  1337. XUSER1                193  exit procedure command called with 1
  1338. XUSERN                223  exit procedure command called with 31
  1339. X.DE
  1340. X
  1341. XThe logical names 'SIG1' and 'SIGN' refer to a range of error codes
  1342. Xsignifying ecu termination due to a signal.  A larger range (64) is
  1343. Xreserved than is necessary to handle reasonable expansion of
  1344. XSIG values in the OS. Not all signals will be reported
  1345. Xin this manner. ECU will never report status 9 (signal 9, SIGKILL),
  1346. Xfor instance.
  1347. X
  1348. XThe logical names 'USER1' and 'USERN' refer to a range of error
  1349. Xexits codes reserved for use by the 'exit' procedure command.
  1350. XSee the description of this command for more information.
  1351. X
  1352. XFor ecu friend code,
  1353. Xformal C #define identifiers for exit codes may be found in
  1354. Xtermecu.h and consist of the above logical names prefixed with 'TERMECU_'.
  1355. X
  1356. SHAR_EOF
  1357. chmod 0644 doc/_exits.txt ||
  1358. echo 'restore of doc/_exits.txt failed'
  1359. Wc_c="`wc -c < 'doc/_exits.txt'`"
  1360. test 2023 -eq "$Wc_c" ||
  1361.     echo 'doc/_exits.txt: original size 2023, current size' "$Wc_c"
  1362. rm -f _shar_wnt_.tmp
  1363. fi
  1364. # ============= doc/_features.txt ==============
  1365. if test -f 'doc/_features.txt' -a X"$1" != X"-c"; then
  1366.     echo 'x - skipping doc/_features.txt (File already exists)'
  1367.     rm -f _shar_wnt_.tmp
  1368. else
  1369. > _shar_wnt_.tmp
  1370. echo 'x - extracting doc/_features.txt (Text)'
  1371. sed 's/^X//' << 'SHAR_EOF' > 'doc/_features.txt' &&
  1372. X.*s 1 "Features"
  1373. X.*s 2 "Supported Terminals"
  1374. X
  1375. XECU supports many terminals with geometries between 20 and 43
  1376. Xlines, inclusive.  The column width must be 80.
  1377. XThe termcap entry for a console (user tty rather than the line)
  1378. XMUST contain a valid entry for the database entries listed below.
  1379. X
  1380. XECU does not attempt to support terminal emulation in the classic
  1381. Xsense of the word.  It presents to the remote host an "ANSI-like"
  1382. Xterminal type as described earlier in the introduction and in 
  1383. Xthe section titled "ANSI Filter."
  1384. XHowever, it does support, with limitations, any LOCAL terminal
  1385. X(console) for which a valid termcap description exists. You MAY
  1386. Xbe able to use ECU with a remote terminal (calling into UNIX/XENIX
  1387. Xover a network or modem), but you may get unfavorable results with
  1388. Xfunction key usage if your modem is a "packetizing" type, such as
  1389. Xa Telebit or if ethernet or other networking chops up your keystroke
  1390. Xsequences.  ECU allows approximately 100 milliseconds after receiving
  1391. Xan ASCII ESC character for later characters of a function key sequence
  1392. Xto arrive.  If at least one character of the sequence has not been
  1393. Xreceived in that time, ECU treats the key as an ESCape, not a function key.
  1394. XThis typical problem of detecting ESC vs. function key is unfortunate, but
  1395. Xwe must live with it until paradigms change (say, in about 2010?).
  1396. X
  1397. XThe termcap entry for a console
  1398. XMUST contain a valid entry for the following database entries:
  1399. X
  1400. X.DS L
  1401. Xcl      clear screen
  1402. Xkl      cursor left
  1403. Xkr      cursor right
  1404. Xdc      delete character
  1405. Xdl      delete line
  1406. Xcd      clear to end of display
  1407. Xce      clear to end of line
  1408. Xic      insert character
  1409. Xal      insert line ("add" a "line")
  1410. Xcm      cursor motion
  1411. Xso      stand out (terminal specific attention getter)
  1412. Xse      stand end
  1413. X.DE
  1414. X
  1415. XThe above sequences MUST be present, valid and reasonably
  1416. Xefficient.  ECU does not use curses during it's primary mode of
  1417. Xoperation (keyboard send-receive). Unlike curses, ECU makes no
  1418. Xattempt to emulate missing terminal functionality.  Failure to
  1419. Xprovide valid entries will result in strange behavior with no
  1420. Xwarning.
  1421. X
  1422. XNote that the formal termcap description of "kl" and "kr" 
  1423. Xstate these are sequences generated by the terminal
  1424. X.B keyboard ,
  1425. Xbut ECU expects that these sequences also cause the desired
  1426. Xeffects when
  1427. X.B sent
  1428. Xto the
  1429. X.B screen .
  1430. X
  1431. XAdditionally, the following, optional, sequences will be used if
  1432. Xthey are detected.
  1433. X
  1434. X.DS L
  1435. Xmb      bold on ("XENIX" extension)
  1436. Xme      bold off ("XENIX" extension)
  1437. Xus      underscrore on
  1438. Xue      underscrore off
  1439. Xvb      visual bell
  1440. X.DE
  1441. X
  1442. XOn SCO, termcap terminal contrtol is used.  Other
  1443. Xversions use terminfo.
  1444. XA future SCO version of ECU may use terminfo instead of termcap.
  1445. XProblems with terminfo prevent its use at the present time.
  1446. XIn addition, early versions of XENIX do not support terminfo.
  1447. X
  1448. XOn SCO multiscreens, SCO "extensions" to "ANSI" are supported
  1449. Xas described below in "Multiscreen Local Terminals."
  1450. X
  1451. X.*s 2 "Host Video Control Sequences"
  1452. X
  1453. X.*s 3 "All Local Consoles (Terminals)"
  1454. X
  1455. XThe following sequences are recieved over the line
  1456. Xby ECU and properly interpreted for all local terminal types
  1457. X(multiscreen, rlogin/xterm pseudotty, serial).
  1458. X
  1459. X.DS L
  1460. XSequence  | Description
  1461. X----------+-------------------------------
  1462. XESC [ @   | ICH
  1463. XESC [ A   | CUU
  1464. XESC [ B   | CUD
  1465. XESC [ C   | CUF
  1466. XESC [ D   | CUB
  1467. XESC [ E   | CNL       See ANSI X3.64,
  1468. XESC [ F   | CPL       screen(HW) and/or
  1469. XESC [ H   | CUP       MS-DOS Technical
  1470. XESC [ J   | ED        Reference Manual
  1471. XESC [ K   | EL
  1472. XESC [ L   | IL
  1473. XESC [ M   | DL
  1474. XESC [ P   | DCH
  1475. XESC [ S   | SU
  1476. XESC [ T   | SD
  1477. XESC [ X   | ECH
  1478. XESC [ `   | HPA
  1479. XESC [ a   | HPR
  1480. XESC [ d   | VPA
  1481. XESC [ e   | VPR
  1482. XESC [ f   | HVP
  1483. XESC [ ? m | SGR
  1484. XESC [ n   | DSR
  1485. XESC [ s   | save cursor MS-DOSism
  1486. XESC [ u   | restore cursor MS-DOSism
  1487. X.DE
  1488. X.DS L
  1489. XSGR Sequences for ALL TERMINALS
  1490. XSequence  | Description   |  Maps to termcap
  1491. X----------+---------------+-------------------------------
  1492. XESC [ 0 m | normal        |  "se"+"me"+"ue"
  1493. XESC [ 1 m | bold          |  "so"
  1494. XESC [ 4 m | underscore    |  "us"
  1495. XESC [ 5 m | blink         |  "mb" (XENIX extension)
  1496. XESC [ 7 m | reverse video |  "so"
  1497. X.DE
  1498. X
  1499. X.*s 3 "Multiscreen Local Terminals"
  1500. X
  1501. XIn addition to the above, if you are operating from an SCO color
  1502. Xmultiscreen, additional (SCO and MS-DOS/ANSI.SYS) sequences
  1503. Xare supported (see screen(HW)):
  1504. X
  1505. X.DS L
  1506. XAdditional Multiscreen SGR Sequences
  1507. XSequence    | Description  (no termcap mapping)
  1508. X------------+-----------------------------------------------
  1509. XESC [ 8 m   | non-display
  1510. XESC [ 1 0 m | select primary font
  1511. XESC [ 1 1 m | select first alternate font (0x00-0x1F)
  1512. XESC [ 1 2 m | select second alternate font (0x80-0xFF)
  1513. XESC [ 3 0 m | black foreground
  1514. XESC [ 3 1 m | red foreground
  1515. XESC [ 3 2 m | green foreground
  1516. XESC [ 3 3 m | brown foreground
  1517. XESC [ 3 4 m | blue foreground
  1518. XESC [ 3 5 m | magenta foreground
  1519. XESC [ 3 6 m | cyan foreground
  1520. XESC [ 3 7 m | white foreground
  1521. XESC [ 3 8 m | enables underline option
  1522. XESC [ 3 9 m | disables underline option
  1523. XESC [ 4 0 m | black background
  1524. XESC [ 4 1 m | red background
  1525. XESC [ 4 2 m | green background
  1526. XESC [ 4 3 m | brown background
  1527. XESC [ 4 4 m | blue background
  1528. XESC [ 4 5 m | magenta background
  1529. XESC [ 4 6 m | cyan background
  1530. XESC [ 4 7 m | white background
  1531. X.DE
  1532. X
  1533. X.s 3 "MS-DOS 'SGR Gaggles'"
  1534. X
  1535. XECU also does it's best to interpret MS-DOS "SGR gaggles" such as
  1536. X.DS I
  1537. XESC [ 5 ; 3 4 ; 4 7 m
  1538. X.DE
  1539. Xwhich means "set the terminal to white background with
  1540. Xblue blinking foreground."
  1541. X
  1542. X.*s 3 "Character Mapping"
  1543. X
  1544. XMost versions of ECU running on an AT style machine attempt to
  1545. Xuse the ruling characters in the video display adapter's ROM
  1546. Xper:
  1547. X.DS L
  1548. XMapped Characters (see pc_scr.h):
  1549. XHex  | Description
  1550. X-----+---------------------------
  1551. X0xDA | top left single rule
  1552. X0xBF | top right single rule
  1553. X0xC0 | bottom left single rule
  1554. X0xD9 | bottom right single rule
  1555. X0xC3 | left hand T
  1556. X0xB4 | right hand T
  1557. X0xB3 | vertical rule
  1558. X0xC4 | horizontal rule
  1559. X.DE
  1560. XOn non-AT machines (or in such environments as X11), the PC ROM
  1561. Xsingle ruling characters from the following table are mapped
  1562. Xafter the fashion of:
  1563. X.DS L
  1564. X       .-----+--------.
  1565. X       |     |        |
  1566. X       |     +--------+
  1567. X       |     |        |
  1568. X       +-----+        |
  1569. X       |     |        |
  1570. X       `-----+--------'
  1571. X.DE
  1572. X
  1573. X(Due to laziness on the part of the author, double
  1574. Xruling characters will appear as random druk, unless your terminal
  1575. Xhas joined the Church of the True-Blue ROM.
  1576. XOne day an X version of this program may appear and you can choose
  1577. Xto no longer accomplish real work, but may spend your days editing
  1578. X42Kb resource files which will give you TAC, Total Anal Control,
  1579. Xover all this.)
  1580. X
  1581. X.*s 2 "Function Key Mapping (Recognition)"
  1582. X
  1583. X(This section reflects the changes in keyboard management made
  1584. Xin version 3.20.)
  1585. X
  1586. XECU recognizes 23 function keys as having special significance
  1587. Xto its operation.
  1588. XThey are:
  1589. X.DS I
  1590. XName      Description 
  1591. X--------  ------------
  1592. XF1        F1         
  1593. XF2        F2        
  1594. XF3        F3          
  1595. XF4        F4          
  1596. XF5        F5          
  1597. XF6        F6          
  1598. XF7        F7          
  1599. XF8        F8          
  1600. XF9        F9          
  1601. XF10       F10         
  1602. XF11       F11         
  1603. XF12       F12         
  1604. XHome      Home        
  1605. XEnd       End         
  1606. XPgUp      Page up     
  1607. XPgDn      Page down   
  1608. XCUU       Up arrow    
  1609. XCUD       Down arrow  
  1610. XCUL       Left arrow  
  1611. XCUR       Right arrow 
  1612. XCU5       "Cursor 5"  
  1613. XIns       Insert      
  1614. XBkTab     Back Tab    
  1615. X.DE
  1616. X
  1617. XECU matches a function key sequence
  1618. Xto an internal function key representation
  1619. Xby testing all keystroke sequences against an internal table loaded
  1620. Xat the beginning of execution from the file ~/.ecu/funckeymap.
  1621. XA default funckeymap file placed in the ECU library directory
  1622. X(normally /usr/local/lib/ecu) by the software installation process.  
  1623. XIf there is no funckeys in the user's home directory, the default
  1624. Xfile is used.
  1625. X
  1626. XNOTE that supported terminals MUST employ function keys which generate
  1627. Xsequences less than 32 characters in length.
  1628. X
  1629. XX11 xterms and X terminals usually require special attention
  1630. Xwith VT100.Translations overrides.  Sometimes an xmodmap must also be
  1631. Xemployed.  Experimentation is the best teacher, but the supplied
  1632. Xfunckeymap file and various READMEs offer some hints.  In particular,
  1633. XREADME.KEYBRD contains information that is kept current.
  1634. X
  1635. XSeveral predefined entries are supplied with the program distribution
  1636. Xin models/funckeymap.
  1637. XIf you have a terminal or console with a keyboard not already
  1638. Xin this file, you must construct one using the terminal's reference
  1639. Xmanual or by direct discovery (typing the key and empricially noting
  1640. Xits generated sequence).
  1641. XThe program kbdtest3 (the source is provided in the distribution) can
  1642. Xassist you in building funckeymap entries.
  1643. Xcertain keys are pressed.  kbdtest.c is a more primitive version of
  1644. Xthe same program.
  1645. X
  1646. XNormally, the TERM environment variable is used to determine
  1647. Xthe funckeymap entry to be used.  Sometimes, the TERM variable
  1648. Xis not adequate for identifying your keyboard arrangement.  For
  1649. Xinstance, suppose you use an xterm on the console at times and
  1650. Xan X terminal at other times.  The choice of function keys
  1651. Xand the character sequences they emit are not likely to match.
  1652. XRather than make herculean efforts with xmodmap and translations,
  1653. Xyou can define two different funckeymap entries, say "xterm-sco"
  1654. Xand "xterm-ncd".
  1655. XThe environment variable ECUFUNCKEY, if found, overrides the
  1656. XTERM variable for funckeymap keyboard management only.  
  1657. XTERM is always used for identifying the display.
  1658. XThus, you can set TERM to "xterm" and ECUFUNCKEY to "xterm-sco"
  1659. XOR "xterm-ncd".
  1660. XAlso, the -F command line switch may be used (which overrides $ECUFUNCKEY).
  1661. X
  1662. XThe format of an file entry is shown below.
  1663. XLines beginning with '#' are comments.
  1664. X
  1665. X.DS I
  1666. X#+------------------------------
  1667. X# SCO
  1668. X#-------------------------------
  1669. Xansi
  1670. Xansi43
  1671. Xsco
  1672. X    F1:F1:          esc [ M 
  1673. X    F2:F2:          esc [ N 
  1674. X    F3:F3:          esc [ O 
  1675. X    F4:F4:          esc [ P 
  1676. X    F5:F5:          esc [ Q 
  1677. X    F6:F6:          esc [ R 
  1678. X    F7:F7:          esc [ S 
  1679. X    F8:F8:          esc [ T 
  1680. X    F9:F9:          esc [ U 
  1681. X    F10:F10:        esc [ V 
  1682. X    F11:F11:        esc [ W 
  1683. X    F12:F12:        esc [ X 
  1684. X    Home:Home:      esc [ H 
  1685. X    End:End:        esc [ F 
  1686. X    PgUp:PgUp:      esc [ I 
  1687. X    PgDn:PgDn:      esc [ G 
  1688. X    CUU:CUU:        esc [ A 
  1689. X    CUL:CUL:        esc [ D 
  1690. X    CU5:CU5:        esc [ E 
  1691. X    CUR:CUR:        esc [ C 
  1692. X    CUD:CUD:        esc [ B 
  1693. X    Ins:Ins:        esc [ L
  1694. X    BkTab:BackTab:  esc [ Z
  1695. X.DE
  1696. X
  1697. XThe first line(s) in a terminal keyboard description begin in
  1698. Xcolumn 1 and contain the terminal types (a la $TERM) for which
  1699. Xthe keyboard description are valid.  The example entry contains
  1700. Xseveral references to terminal types containing the substring
  1701. X'ansi'.  These are included only as an example of one keyboard
  1702. Xdescription servicing multiple terminal types.
  1703. X
  1704. XFollowing the "first lines" are key definition entries, each
  1705. Xpreceded by at least one tab or space.  Each entry is composed of
  1706. Xthree fields delimited by commas.  The first field of an entry is
  1707. Xthe internal ECU function key name and must be chosen from the
  1708. Xfollowing strings (with no regard to case): "F1", "F2", "F3",
  1709. X"F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "Home",
  1710. X"End", "PgUp", "PgDn", "CUU" (cursor up), "CUL" (cursor left),
  1711. X"CU5" (unshifted cursor pad 5), "CUR" (cursor right) and "CUD"
  1712. X(cursor down). The
  1713. Xsecond field contains the name of the key as it appears on the
  1714. Xkeyboard (such as "F16" for End on the Wyse 60).  The
  1715. Xthird field is a description of the character sequence generated
  1716. Xby the keyboard when the chosen key is pressed; it is a
  1717. Xstring of one or more tokens separated by spaces or tabs.
  1718. X
  1719. XIn addition, function key sequences may not 
  1720. Xexceed 31 characters in length.
  1721. X
  1722. XPLEASE NOTE: ECU does not have a reasonable way for you to terminate it
  1723. Xif there are no Home and End keys defined, so it refuses to proceed
  1724. Xif no definitions are found.  Even so, if you have incorrect definitions,
  1725. Xyou may not be able to get out of ECU without a kill -1 <pid> from
  1726. Xanother terminal or hanging up your connection with UNIX/XENIX
  1727. Xif using ECU from remote.
  1728. X
  1729. X.*s 2 "Function Key Actions"
  1730. X
  1731. XThis section deals with how ECU behaves
  1732. Xonce a function key has been recognized as having been entered
  1733. Xat the keyboard. 
  1734. X
  1735. X.*s 3 "Standard Function Keys"
  1736. X
  1737. XAll function keys with the exception of the 
  1738. X.B Home ,
  1739. X.B BkTab
  1740. X(shift TAB),
  1741. Xand keypad unshifted 5 key can be programmed to 
  1742. Xtransmit preselected character sequences when the key is pressed.
  1743. X
  1744. XThe default values for these sequences is shown below.
  1745. X
  1746. X.DS L
  1747. XIdentifier Description    Default Sequence
  1748. X--------   ------------   ----------------
  1749. XF1         F1                ESC [ M
  1750. XF2         F2                ESC [ N
  1751. XF3         F3                ESC [ O
  1752. XF4         F4                ESC [ P
  1753. XF5         F5                ESC [ Q
  1754. XF6         F6                ESC [ R
  1755. XF7         F7                ESC [ S
  1756. XF8         F8                ESC [ T
  1757. XF9         F9                ESC [ U
  1758. XF10        F10               ESC [ V
  1759. XF11        F11               ESC [ W
  1760. XF12        F12               ESC [ X
  1761. XHome       Home          <-- intercepted (not an input key)
  1762. XEnd        End               ESC [ F
  1763. XPgUp       Page up           ESC [ I
  1764. XPgDn       Page down         ESC [ G
  1765. XCUU        Up arrow          ESC [ A
  1766. XCUD        Down arrow        ESC [ B
  1767. XCUL        Left arrow        ESC [ D
  1768. XCUR        Right arrow       ESC [ C
  1769. XCU5        "Cursor 5"    <-- intercepted (not an input key)
  1770. XIns        Insert            ESC [ L
  1771. X.DE
  1772. XThis results in the following interactive "fkey" command display:
  1773. X.DS L
  1774. X F1   SCO F1    F2   SCO F2    Home  ecu cmd       PgUp  SCO PgUp
  1775. X F3   SCO F3    F4   SCO F4    End   SCO End       PgDn  SCO PgDn
  1776. X F5   SCO F5    F6   SCO F6    Ins   local shell   CUR5  screen dump
  1777. X F7   SCO F7    F8   SCO F8    BkTab redisplay  
  1778. X F9   SCO F9    F10  SCO F10   CUR^  SCO CUU       CUR>  SCO CUR
  1779. X F11  SCO F11   F12  SCO F12   CUR<  SCO CUL       CURv  SCO CUD
  1780. X.DE
  1781. X
  1782. XYou may override the default setting by using the interactive or
  1783. Xprocedure command "fkey" to specify a new keyset definition
  1784. Xfrom ~/.ecu/keys.
  1785. X
  1786. XFunction keyset definitions are appended one after another
  1787. Xto ~/.ecu/keys.  The keyset name appears on a line by itself
  1788. Xand the choices making up a set appear on subsequent lines
  1789. Xof a special format.  
  1790. X
  1791. XA keyset is loaded explicitly using "fkey" and implicitly when
  1792. Xconnecting to a remote system and a keyset name matches
  1793. Xthe dialing directory entry name.
  1794. X
  1795. XConsider the example:
  1796. X
  1797. X.DS L
  1798. Xstratus
  1799. X    F1:F1:esc O q
  1800. X    F2:F2:esc O r
  1801. X    F3:F3:esc O s
  1802. X    F4:F4:esc O t
  1803. X    F5:F5:esc O u
  1804. X    F6:F6:esc O v
  1805. X    F7:F7:esc O w
  1806. X    F8:status:dc4
  1807. X    F9:no status:nl
  1808. X    F10:redisp:esc O y
  1809. X    F11:redisp:syn
  1810. X    PGDN:cancel:esc O Q
  1811. X    END:enter:esc O M
  1812. X    PGUP:dispform:esc O R
  1813. X    CUU:^:dle
  1814. X    CUD:v:so
  1815. X    CUL:<:stx
  1816. X    CUR:>:ack
  1817. X.DE
  1818. X
  1819. XThe key definition lines are made up of three fields.  In addition,
  1820. Xthere must be a blank or a space in the first column of the line.
  1821. XThe first field is the ECU key identifier from the table above.
  1822. XThe second field is a 12-character max string to display when
  1823. Xthe display option of the fkey command is used.
  1824. XThe last field is a character sequence to be transmitted when
  1825. Xthe key is pressed.
  1826. X
  1827. XThe resulting fkey display for the stratus example looks similar to:
  1828. X
  1829. X.DS L
  1830. X F1  F1     F2  F2         Home ecu cmd     PgUp  dispform
  1831. X F3  F3     F4  F4         End  enter       PgDn  cancel
  1832. X F5  F5     F6  F6         Ins  local shell CUR5  Screen dump
  1833. X F7  status F8  no status  BkTab restore receiver display
  1834. X F9         F10 redisp     CUR^ ^           CUR>  >
  1835. X F11        F12            CUR< <           CURv  v
  1836. X.DE
  1837. X
  1838. XPressing F1, causes the three characters ESC, 'O' and 'q' to be
  1839. Xtransmitted.
  1840. X
  1841. X.*s 3 "SCO ALT-[a-z] Function Keys"
  1842. X
  1843. XIf you are on an SCO machine and you have installed the custom ECU mapkey file
  1844. X(as described in the release directory
  1845. Xin mapkeys/README), then ALT-a through ALT-z causes the "silent"
  1846. Xexecution of procedures 'alt_a.ep' for ALT-a, 'alt_b.ep' for ALT-b, etc.
  1847. XThe models subdirectory contains an example alt_h.ep which will home
  1848. Xthe cursor when ALT-h is pressed.  This facility allows the execution
  1849. Xof 26 procedures without ECU itself changing the video display at all.
  1850. XAny changes to the display (short of procedure errors) will result
  1851. Xsolely from the action of the invoked procedure.
  1852. XIf the procedure matching the ALT-[a-z] key pressed cannot be found,
  1853. Xa short error message is printed and the terminal bell is rung.
  1854. X(Using back tab may be used to refresh the display in this event.)
  1855. X
  1856. XNOTE: ECU 3.10 CHANGES TO THE SINGLE KEY PROCEDURE FUNCTIONALITY
  1857. XMAKE IT NECESSARY FOR YOU TO REVIEW mapkeys/README IF YOU HAVE USED
  1858. XTHIS FEATURE IN PREVIOUS REVISIONS.
  1859. X
  1860. XThe strings used to represent "non-printable" characters are identical
  1861. Xto the formal ASCII names given them (without regard to case), viz:
  1862. X.DS I
  1863. X      NUL may not appear in a function key definition
  1864. SHAR_EOF
  1865. true || echo 'restore of doc/_features.txt failed'
  1866. fi
  1867. echo 'End of ecu320 part 35'
  1868. echo 'File doc/_features.txt is continued in part 36'
  1869. echo 36 > _shar_seq_.tmp
  1870. exit 0
  1871.  
  1872. exit 0 # Just in case...
  1873.