After you have received your password, but before running the self-extracting archive, carefully read the instructions below.
1/19/97 Dear Reader, The code in the file CPGSCPWD.EXE is for the Second Edition of C Programmer's Guide to Serial Communications. This code also works for the First Edition. A few functions have changed and I've taken a few new approaches. In general, the 2nd edition contains chapters and code for advanced interrupts, facsimile, and protocol modems. The last changes I made to the code was in early 1995, so you'll probably discover minor undocumented discrepancies between the book's code and the code in this file. You'll also discover that I've left in place many of my debugging aids that were removed for publication. Lines containing the odd-looking comment "/*//*/" or lines beginning with "//" identify debugging lines. Now, here's how you use the self-extracting archive CPGSCPWD.EXE: 1. You'll need about 1.2M to hold the source; 2.1+M to hold the source, obj's, and libraries. I developed under Microsoft 6.00A, but have verified (quickly) under 7.0. All source compiles at Warning Level 3 with no warnings. The NMAKE files assume that LIB.EXE, LINK.EXE, and MASM.EXE are in the path, but I've included the assembly language .LIB and OBJ files just in case you don't own MASM. 2. Choose the drive where you wish to install the code. Type: CPGSCPWD -spassword -d x: where x is the drive where you want to install it, and password is the password you received by email. DON'T FORGET THE "-d"! 3. De-archiving creates a copy of my development directory structure on the specified drive: x:\ <------------------your drive id |--!PG | +--SIO | | +--ASM | | +--OBJS | | +--BUOS | | +--OBJS | | +--CRC | | +--OBJS | | +--FAX | | +--OBJS | | +--IBMPC | | +--OBJS | | +--MISC | | +--OBJS | | +--MODEM | | +--OBJS | | +--PROGS | | | | +--TERMFUNC | | +--OBJS | | +--U16X50 | | +--OBJS | | +--XMODEM | | +--OBJS | | +--_SIO | | +--OBJS +--COMPILER +--INCLUDE +--SIO 4. The directory \COMPILER\INCLUDE\SIO contains the INCLUDE files for my code. Create a new directory named SIO under your compiler's INCLUDE directory. Copy these .H files to it. After this copy you may erase the entire \COMPILER subdirectory. 5. In each directory you will see DIRNAME.NMK. These are input files for Microsoft's NMAKE utility. 6. Included are batch files REBUILD.BAT (builds the entire library from scratch) and BUILD.BAT, which just runs the make file in each subdirectory. 7. If you've changed any of the path names from those shown on the tree above, CD to the PROGS directory and edit the paths in PROGS.RSP, the linker response file. 8. The NMAKE files require the following variables in your environment: LIB This is the variable used by your compiler for libraries. INCLUDE This is the variable used by your compiler for include files. (I assume this one's already present.) SIO_BASE The base subdirectory for the C source: x:\!PG\SIO where 'x' is the drive you want to install on. SIO_INC_PATH This is the subdirectory for this project's includes. The source code assumes that the includes are under INCLUDE, but I've provided a NMAKE variable for future flexibility. CL Environment arguments for the compiler: /AS Desired Model /W NMAKE quits on compiler warnings You may wish to use the /Zid (Add Codeview information and line numbers), but be aware that this may cause the compiler to die with the message "Compiler out of far heap space." In other words, you need to have lots of memory available at the DOS prompt. 9. Assuming you've got all the environment variables installed, CD to \!pg\sio and type REBUILD 10. The batch file compiles all the source, creates the libraries, and links the TERM7 program from the book. TERM7 will be about 70K. It will be a whopper if compiled with the /Zid option and linked with the /CO option. If you wish to remove Codeview info from your OBJ's, just delete the /CO from TERM7.RSP. 11. Now that you've carefully read everything in this file and BEFORE running the batch file: DEL \!PG\TRAPDOOR.BAT 12. To compile Large MODEL: A. Change /AS to /AL in the CL environment variable. B. Change the model defined in ASM.NMK. In case you don't have MASM, both LIBs are provided, ASMS.LIB (Small) and ASML.LIB (Large). Copy the desired model library to ASM.LIB. 13. By default, the files BUILD.BAT and REBUILD.BAT have the NMAKE commands for the ASM directory REM'ed out. If you own MASM and wish to modify the assembler, remove the REM statements. Model control is via the /DSMALLMODEL to /DLARGEMODEL directives in ASM.NMK. 14. The TERM7 program defaults to COM3. To override, enter the ordinal number of the port you desire (i.e., COM1 is 0). 15. If you're developing applications that must run in a Windows 3.x DOS box, you won't be able to use the 16550 ISR shown in the book. Although Windows does not support the 16550, many software packages provide serial drivers that do. Alas, all I have seen treat the 16550 TIMEOUT interrupt correctly. For this reason, you'll find that s_open doesn't not use the 16550 ISR. 16. Read the file NEWSIO.DOC in the IBMPC directory for instructions on how to automate changes to the COMxSIO.C files.