📄 ckuins.doc
字号:
UNIX MAKEFILEThe makefile is quite long, and at least two versions of UNIX, SCO Xenix/286and 2.x BSD, cannot cope with its length. An attempt to "make sco286" givesthe message "Make: Cannot alloc mem for env.. Stop". Solution: edit awaysome or all of the nonrelevant material from the makefile. (A separateversion of the makefile is provided for BSD 2.x: ckubs2.mak.)Some make programs reportedly cannot handle continued lines (lines endingin backslash (\)). If you have a problem with the makefile, try editing themakefile to join the continued lines (remove the backslashes and the followinglinefeed).Other makefile troubles may occur because tabs in the makefile have somehowbeen converted to spaces. Spaces and tabs are distinct in UNIX makefiles.Similarly, carriage returns might have been added to the end of each line,which also proves confusing to most UNIX versions of make.INSTALLING UNIX C-KERMIT FROM DOS-FORMAT DISKETTESIf you received a DOS-format diskette containing a binary executable C-Kermitprogram plus supporting text files, be sure to chmod +x the executable beforeattempting to run it.In version 5A(190) and later, all the text files on the C-Kermit DOS-formatdiskettes are in UNIX format: LF at the end of each line rather than CRLF.This means that no conversions are necessary when copying to your UNIX filesystem, and that all the files on the diskette, text and binary, can be copiedtogether. The following comments apply to the DOS-format diskettes furnishedwith version 5A(189) and earlier or to other DOS-format diskettes you mighthave obtained from other sources.If you have received C-Kermit on MS-DOS format diskettes (such as thosedistributed by Columbia University), you should make sure that yourDOS-to-UNIX conversion utility (such as "dosread") both: (1) changes lineterminators in all files from carriage-return linefeed (CRLF) to just linefeed(LF) (such as "dosread -a") and remove any Ctrl-Z's, and (2) that allfilenames are converted from uppercase to lowercase. If these conversionswere not done, you can use the following shell script on your UNIX system todo them:---(cut here)---#!/bin/sh## Shell script to convert C-Kermit DOS-format files into UNIX format.# Lowercases the filenames, strips out carriage returns and Ctrl-Z's.#x=$1 # the name of the source directoryy=$2 # the name of the target directory if [ $# -lt 2 ]; then echo "usage: $0 source-directory target-directory" exit 1fiif cd $1 ; then echo "Converting files from $1 to $2"else echo "$0: cannot cd to $1" exit 1fifor i in *; do j=`echo $i | tr 'A-Z' 'a-z'` echo $x/$i =\> $y/$j tr -d '\015\032' < $i > $y/$jdone---(cut here)---Cut out this shell script, save it as "convert.sh" (or any other name youprefer), then "chmod +x convert.sh". Then, create a new, empty directoryto put the converted files in, and then "convert.sh /xxx /yyy" where /xxxis the name of the directory where the PC-format files are, and /yyy is thename of the new, empty directory. The converted files will appear in thenew directory.CHECKING THE RESULTSHere are several quick checks you can run to tell whether your version ofC-Kermit was built correctly for your UNIX system. 0. Start C-Kermit (usually by typing "./wermit" in the directory where you ran the makefile). Do you see the C-Kermit> prompt? If not, C-Kermit incorrectly deduced that it was running in the background. The test is in conbgt() in ckutio.c. If you can fix it for your system, please send in the fix (Hint: read about "PID_T" below). Otherwise, you can force C-Kermit to foreground mode by starting it with the -z command line option, as in "kermit -z", or giving the interactive command SET BACKGROUND OFF. 1. When you type characters at the C-Kermit prompt, do they echo immediately? If not, something is wrong with concb() and probably the other terminal mode settings routines in ckutio.c. Be sure you have used the most appropriate make entry. 2. At the C-Kermit> prompt, type "send *?". C-Kermit should list all the files in the current directory. If not, it was built for the wrong type of UNIX file system. Details below. In the meantime, try SET WILDCARD-EXPANSION SHELL as a workaround. 3. Create a file with a long name in your current directory, e.g.: % touch thisisafilewithaveryveryveryveryveryveryveryverylooooooooongname Check with ls to see if your version of UNIX truncated the name. Now start C-Kermit and type "send thisis<ESC>". Does Kermit complete the name, showing the same name as ls did? If not, wrong filesystem. Read on. 3.5 - Make sure that Kermit has the maximum path length right. Just type SHOW FILE and see what it says about this. If it is too short, there could be some problems at runtime. To correct, look in ckcdeb.h to see how the symbol CKMAXPATH is set and make any needed adjustments. 4. Type Ctrl-C (or whatever your UNIX interrupt character is) at the prompt. Do you get "^C..." and a new prompt? If instead, you get a core dump (this shouldn't happen any more) "rm core" and then rebuild with -DNOCCTRAP added to your CFLAGS. If it did work, then type another Ctrl-C. If this does the same thing as the first one, then Ctrl-C handling is OK. Otherwise, the SIGINT signal is either not getting re-armed (shouldn't happen) or is being masked off after the first time it is caught, in which case, if your UNIX is POSIX-based, try rebuilding C-Kermit with -DCK_POSIX_SIG. 5. Type Ctrl-Z (or whatever your UNIX suspend character is) to put C-Kermit in the background. Did it work? If nothing happened, then (a) your version of UNIX does not support job control, or (b) your version of C-Kermit was probably built with -DNOJC. If your session became totally frozen, then you are probably running C-Kermit on a UNIX version that supports job control, but under a shell that doesn't. If that's not the case, look in the congm() and psuspend() routines in ckutio.c and see if you can figure out what's wrong. If you can't, rebuild with -DNOJC. 6. Try dialing out: SET MODEM TYPE <whatever>, SET LINE <whatever>, SET SPEED <whatever>, DIAL <phone-number>. If it doesn't work, keep reading. After dialing, can you REDIAL? 7. If your version was built with TCP/IP network support, try the TELNET command. 8. Transfer some files in remote mode on incoming asynchronous serial (direct or modem) connections, and on incoming network (telnet, rlogin, terminal server) connections. 9. Establish a serial connection from C-Kermit to another computer (direct or dialed) and transfer some files. If you have network support, do the same with a network connection.10. If your version was built with fullscreen file transfer display support, check that it works during local-mode file transfer. Also, check C-Kermit's operation afterwards: is the echoing funny? etc etc. If there are problems, see the section THE FULLSCREEN FILE TRANSFER DISPLAY below.11. If your version was built with script programming language support, TAKE the ckedemo.ksc file to give it a workout.12. Does C-Kermit interlock correctly with UUCP-family programs (cu, tip, uucp, etc)? If not, read the section DIALING OUT AND COORDINATING WITH UUCP below.13. Modem signals... Give a SET LINE command to a serial device and then type the SHOW MODEM command. If it says "Modem signals unavailable in this version of Kermit", then you might want to look at the ttgmdm() routine in ckutio.c and add the needed code -- if indeed your version of UNIX provides a way to get modem signals (many don't). If it says "Modem signals unavailable", then it is likely that the API for getting modem signals is provided, but it doesn't actually do anything (e.g. ioctl(ttyfd,TIOCMGET,&x) returns EINVAL). In any case, it still should be able to manipulate the DTR signal. To test, SET LINE <name-of-dialout-device>, SET MODEM NONE, and HANGUP. The DTR light should go out momentarily. If it doesn't, see if you can add the needed code for your system to the tthang() routine in ckutio.c. If your version of Kermit has the SET FLOW RTS/CTS command, check to see if it works: give Kermit this command, set your modem for RTS/CTS, transfer some files (using big packet and window sizes) and watch the RTS and CTS lights on the modem. If they go on and off (and Kermit does not get packet errors), then it works. If your version of Kermit does not have this command, but your version of UNIX does support hardware flow control, take a look at the tthflow() command in ckutio.c and see if you can add the needed code (see the section on HARDWARE FLOW CONTROL below). (And please send back any added code to the author, so that others can benefit from it and it can be carried forward into future releases.)REDUCING THE SIZE OF THE EXECUTABLE PROGRAM IMAGE1. Many of C-Kermit's options and features can be deselected at compile time. The greatest savings at the least sacrifice in functionality is to disable the logging of debug information by defining NODEBUG during compilation. See the ckccfg.doc file for further information.2. Use shared libraries rather than static linking. This is the default on many UNIX systems anyway. However, executables built for dynamic linking with shared libraries are generally not portable away from the machine they were built on.3. Most UNIX systems have a "strip" command to remove symbol table information from an executable program image. "man strip" for further information. The same effect can be achieved by including "-s" among the link flags when building C-Kermit.4. SCO, Interactive, and some other UNIX versions have an "mcs" command. "mcs -d wermit" can be used to delete the contents of the ".comment" section from the executable program image.5. Many modern optimizers can be instructed to optimize for space rather than execution efficiency. Check the CFLAGS in the makefile entry, adjust as desired.DYNAMIC MEMORY ALLOCATIONIf the makefile entry for your version of C-Kermit does not include -DDYNAMIC,try adding it. This should make the program image smaller, and it willallow you to use much longer packets and bigger window sizes. If this workson your system, please notify the author at the address above. In general,there is no reason not to use this feature if it works.TCP/IP NETWORKINGIf the makefile entry for your version of C-Kermit does not include TCP/IPsupport, but your UNIX system does support TCP/IP using the Berkeley socketslibrary, or some variation of it, try adding -DTCPSOCKET to your makefileentry. If it "almost works", there are some other switches you can add toforce recognition of the various slightly-incompatible TCP/IP implementations(-DWOLLONGONG, -DEXCELAN, -DINTERLAN, etc).Reportedly, even some of these are not consistent within themselves. Forexample, Wollongong reportedly puts header files in different directories fordifferent UNIX versions: in.h can be in either /usr/include/sys or /user/include/netinet. telnet.h can be in either /usr/include/arpa or /user/include/netinet. inet.h can be in either /usr/include/arpa or /user/include/sys.In cases like this, it's better to make links in the file system than itis to hack up the C-Kermit source code. Suppose, for example, Kermit islooking for telnet.h in /usr/include/arpa, but on your system it is in/usr/include/netinet. Do this (as root, or get the system manager to do it): cd /usr/include/arpa ln /usr/include/netinet/telnet.h telnet.h("man ln" for details about links.)THE FULLSCREEN FILE TRANSFER DISPLAYFor fullscreen file transfer display support, add -DCK_CURSES to your makefileentry (if necessary; many entries already have it, generally the ones endingin "c", for example "make sunos41c"). The screen handling is accomplished inUNIX using the curses library. If you are creating a new makefile entry toinclude the fullscreen display, you must add one of the following to your UNIXmakefile entry (whatever works): "LIBS= -lcurses -ltermcap" "LIBS= -lcurses -ltermlib" "LIBS= -lcurses" "LIBS= -ltermlib"to pull in the required libraries. "man curses" for further information, andsearch through the makefile for "CK_CURSES" to see many examples.In System V, there might be a complication. Apparently System V curses (or atleast some implementations of it) reserve the right to alter the buffering onthe output file without restoring it afterwards, which can leave Kermit'scommand processing in a mess when the prompt comes back after a fullscreenfile transfer display. If you experience problems such as these, try adding -DCK_NEWTERMto your makefile entry (see comments in screenc() in ckuusx.c for anexplanation).In SCO Xenix and SCO UNIX, there are two separate curses libraries, one basedon termcap and the other based on terminfo. The default library, usuallyterminfo, is established when the development system is installed. Tomanually select terminfo (at compile time): compile -DM_TERMINFO and link -ltinfo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -