home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / C++-7 / DISK7 / SOURCE / STARTUP / README.TX$ / README
Encoding:
Text File  |  1992-01-18  |  6.1 KB  |  200 lines

  1. =================================
  2. C Runtime Library Startup Sources
  3. =================================
  4.  
  5. The directory \startup and its subdirectories contain the files
  6. necessary for building the startup portion of the C runtime library.
  7. The \startup directory contains the startup source files, the include
  8. files, the batch file, and the make files used to build the startup
  9. object files.  The subdirectories of \startup contain OS specific
  10. sources.
  11.  
  12. The startup object files can be built by invoking cstartup.bat (DOS/WIN)
  13. from within the \startup directory.  This batch file assumes the following:
  14.  
  15.       * Nmake.exe, link.exe, the C compiler, and the assembler must
  16.     be in the execution path.  MASM 6.0 and C 7.0 or later are
  17.     required to build the startup sources.
  18.  
  19.       * Environment variable INCLUDE must be set to the directory that
  20.     contains your C include files.
  21.  
  22.       * Environment variable LIB must be set to the directory that
  23.     contains your C library files.    The library files for your OS
  24.     target must exist in that directory (e.g., ?libcer.lib for DOS,
  25.     ?libcewq.lib for WIN, etc.).
  26.  
  27.       * For WIN, libw.lib must be in the directory specified by the LIB
  28.     environment variable and windows.h must be in the directory specified
  29.     by the INCLUDE environment variable.
  30.  
  31. Cstartup will create memory model specific subdirectories and place the
  32. appropriate object files there.  Under each memory model subdirectory,
  33. cstartup creates additional subdirectories where OS specific objects reside.
  34.  
  35.     OBJ Directories     Contents
  36.     ---------------     --------
  37.  
  38.         S, M, C, L              Small, medium, compact, large model
  39.                                 directories which contain OS specifc
  40.                                 objects
  41.  
  42.         S/DOS, M/DOS, etc.      MS-DOS startup objects
  43.  
  44.         S/WIN, M/WIN, etc.      Windows EXE startup objects
  45.  
  46.         S/DLL, M/DLL, etc.      Windows DLL startup objects
  47.  
  48. The message "<cEnd - nogen>" is generated when some of the assembly language 
  49. source files are assembled.  This message is expected and is totally benign.
  50.  
  51.  
  52. Running C Startup
  53. -----------------
  54.  
  55. Use the cstartup batch file to build the various C runtime startup objects.
  56. The cstartup batch file allows you to select various combinations of
  57. OS platforms and models.  The interface is:
  58.  
  59.     Usage:    cstartup [?] [os] [models]
  60.  
  61.         [?] displays this help message.
  62.  
  63.         [os] is an optional list of one or more OS designators
  64.         seperated by spaces (DOS, WIN); default is all.
  65.  
  66.         [model] is an optional list of memory model designators
  67.         seperated by spaces (S, M, C, L); default is all.
  68.  
  69. Examples:
  70.  
  71.     cstartup dos s        /* build small model DOS objects */
  72.  
  73.     cstartup win s l    /* build small and large model WIN objects */
  74.  
  75.     cstartup        /* build all startup objects */
  76.  
  77.     cstartup ?        /*** display a help message ***/
  78.  
  79.  
  80. [Note:    You may need to delete old objects from previous startup builds
  81. if you alter build options, startup sources, etc.]
  82.  
  83.  
  84. Startup Files
  85. -------------
  86.  
  87. The following files are contained in the \startup directory:
  88.  
  89. Startup source files:
  90.  
  91.     CHKSTK.ASM
  92.     CHKSUM.ASM
  93.     CRT0FP.ASM
  94.     FILE.ASM
  95.     FMSGHDR.ASM
  96.     RCHKSTK.ASM
  97.     SETARGV.ASM
  98.     WILD.C
  99.     _FILE.C
  100.  
  101.     DOS\CRT0.ASM
  102.     DOS\CRT0DAT.ASM
  103.     DOS\CRT0MSG.ASM
  104.     DOS\EXECMSG.ASM
  105.     DOS\NMSGHDR.ASM
  106.     DOS\STDALLOC.ASM
  107.     DOS\STDARGV.ASM
  108.     DOS\STDENVP.ASM
  109.  
  110.     WIN\CRT0.ASM
  111.     WIN\FATAL.ASM
  112.     WIN\NOQWIN.ASM
  113.     WIN\QWCINIT.ASM
  114.     WIN\STUBMAIN.ASM
  115.     WIN\STUBWEP.ASM
  116.     WIN\WCHKSTK.ASM
  117.     WIN\WEP.ASM
  118.     WIN\WFILE.ASM
  119.     WIN\WINDGRP.ASM
  120.     WIN\WINDGRPX.C
  121.     WIN\WNULL.ASM
  122.  
  123. Include files:
  124.  
  125.     CMACROS.INC
  126.     CMSGS.INC
  127.     DEFSEGS.INC
  128.     FCNTL.INC
  129.     HEAP.INC
  130.     MSDOS.INC
  131.     RTERR.INC
  132.     STDLIB.INC
  133.     STDIO.INC
  134.     VERSION.INC
  135.  
  136.     FILE2.H
  137.     INTERNAL.H
  138.     MSDOS.H
  139.     REGISTER.H
  140.  
  141. Build files:
  142.  
  143.     CSTARTUP.BAT    ;builds objs and links null program on DOS and WIN
  144.     CSUB.BAT    ;(used by cstartup)
  145.  
  146.     MAKEFILE.DOS    ;makefile used in DOS build
  147.     MAKEFILE.WIN    ;makefile used in WIN build
  148.     WINDLL.MKF    ;makefile used in WIN DLL build
  149.     WINEXE.MKF    ;makefile used in WIN EXE build
  150.  
  151.     NULBODY.C    ;null C program
  152.     DOS\NULBODY.LNK ;DOS link script for null program
  153.     WIN\NULBODY.DEF ;WIN def file for null program
  154.     WIN\NULBODY.LNK ;WIN link script for null program
  155.  
  156. Documentation:
  157.  
  158.     README.TXT    ;information about \startup directory structure
  159.             ;and contents
  160.  
  161. [Note:    Startup sources written in assembly language have been edited with
  162. tab stops set to 8.  Startup sources written in C have been edited with
  163. tab stops set to 4.]
  164.  
  165.  
  166. Placing the Stack outside of DGROUP
  167. -----------------------------------
  168.  
  169. If your program requires a large amount of stack space, the run time
  170. library can be configured to place the stack in a seperate segment
  171. outside of DGROUP.  By doing this, the stack can be up to 64K in size
  172. without reducing the amount of storage available in DGROUP for near
  173. data.  In order to do this your program must be either compact, large,
  174. or huge model.    You must also direct the compiler to assume that
  175. that SS != DS.    Thus, your memory model specification should be -ACw,
  176. -ALw, or -AHw.    See the compiler documentation for more information
  177. about these options.
  178.  
  179. To use a far stack, you must assemble the startup sources provided
  180. with C 7.0.  In the startup sources directory is a file called "makefile.dos"
  181. which controls the startup module build process for the run time library.
  182. To enable a far stack, you need to edit the makefile.  Near the top of
  183. the file are two lines which begin "CFLAGS=" and "ASMFLAGS=".  You should
  184. add the text " -DFARSTACK" to the end of these two lines.  Then build
  185. the startup modules according to instructions given previously in this
  186. file.  You should then use the LIB utility to replace the startup modules
  187. in your library with the new modules you have built.  When linking, the
  188. size of the stack can be controlled with the /STACK command line option.
  189.  
  190. If you are creating DOS programs, the size of your .EXE file will be
  191. increased by the size of your stack.  This is a consequence of the DOS
  192. .EXE format.  To reduce the size of your .EXE file, link with the
  193. /EXEPACK option.
  194.  
  195. [Note:    The far stack option is not supported in the Windows
  196. startup files.]
  197.  
  198.  
  199.                 --- End ---
  200.