Installing the software tools on the CDROM that accompanies the book

  • Install DJGPP on your computer.

  •  

     
     
     

    Parts of the following instructions are excerpted from the file readme.1st in the CDROM directory DJGPP. This information is also contained in Appendix A of your book

    1. Create a new folder on your computer for DJGPP, say c:\djgpp
    2. Unzip all the files from the cdrom directory djgpp/binary into the folder created in the previous step.
    3. After unzipping all the zip files, set the DJGPP environment variable to point to the file DJGPP.ENV in the main DJGPP installation directory and add its BIN subdirectory to your PATH.

    4. The exact way how these variables should be set depends on your operating system:

      *For Windows 2000 systems:
                  1.Select Start/Settings/Control Panel
                  2.Double click on the System icon
                  3.Click on the advanced tab
                  4.Click on the Environment Variables Button
                  5.Look under System Variables for DJGPP and select new (or edit if it is already there).
                  6.The variable name is DJGPP
                  7.The variable value  is: C:\DJGPP\DJGPP.ENV

      The PATH can be set using a similar procedure to the value C:\DJGPP\BIN;%PATH%

      *For Windows ME systems:

               Setting the DJGPP variable in Windows ME
                  1.Select Start/run
                  2.Type in msconfig and hit enter
                  3.Select the Environment tab and continue on as in the instructions for Windows 2000.
                    msconfig screen shot.

         *For Windows 98 systems:

           - Click START;
           - Choose Programs->Accessories->System Tools->System Information;
           - Click Tools in the menu-bar, then choose "System Confuguration";
           - Use the tab provided there for editing your AUTOEXEC.BAT as
             explained below.

         * For Windows NT systems:

           - Right-click "My Computer", then select "Properties";
           - Click the "Environment" tab;
           - Edit the PATH system variable to add the DJGPP bin subdirectory;
           - Add a new variable DJGPP and set its value to the full path
             name of the DJGPP.ENV file as explained below.

         * For all other systems (DOS, Windows 3.X and Windows 95): use any
           text editor, e.g. the standard EDIT, to edit the file
           AUTOEXEC.BAT in the root directory of the boot drive (usually,
           C:).
       

           No matter which method you use, assuming your DJGPP installation is
           rooted at C:\DJGPP, the values of the two environment variables
           DJGPP and PATH must correspond to the following settings:
         
           set DJGPP=C:\DJGPP\DJGPP.ENV
           set PATH=C:\DJGPP\BIN;%PATH%
           
    5.  Reboot.  This makes sure the two lines you added to autoexec.bat will take effect.  (On Windows NT, the changes take effect immediately, so you you don't need to reboot there.)

    6.  
    7. Run the go32-v2.exe program without arguments:

    8.  

       
       
       
       
       

       go32-v2

         It should report how much DPMI memory and swap space can DJGPP use
         on you system, like this:

       DPMI memory available: 8020 Kb
       DPMI swap space available: 39413 Kb

         The actual numbers will vary according to amount of RAM installed
         on your system, the available disk space and the DPMI server.  If
         the sum of the two numbers reported by go32-v2 is less than 4MB (4000 Kb),
         read section 3.9 of the FAQ, "How to configure your system for
         DJGPP".

  • Copy the programs and examples folders from the CDROM to your computer. These contain program examples from the book and material related to programming assignments.
  • Create a folder named, say, csc241. Copy the file ldscript.exe from the ldscript folder on the CDROM to this folder. At the DOS prompt issue the command
  • ldscript   > link.cmd

    which creates the script named link.cmd which is used to link your C programs. See Linking Your Embedded Application on page 226 of your text book.

  • Copy the files libepc.h and libepc.a from the libepc folder on the CDROM to the csc241 folder that you created in the previous step. These files will be needed for your programming assignments.
  • Test your installation. Copy the file programs/program1/program1.c to the csc241 directory. The csc241 folder will now contain program1.c, link.cmd, libepc.h, and libepc.a. At the DOS prompt, compile and link program1.c in the following manner:
  • gcc -c     -Wall    program1.c
  • ld   program1.o -Tlink.cmd   -u   start   -Map   link.map
  • Verify that the csc241 directory now contains a file named embedded.bin