home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sources / misc / 3962 < prev    next >
Encoding:
Text File  |  1992-09-15  |  57.2 KB  |  1,880 lines

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