Next: Debug versus Optimized Up: Configuring a Kernel Previous: Specifying a Protocol

Build Procedure

A given instance of the x-kernel is built in a working directory. Each working directory can support one x-kernel configuration at a time. Working directories may be organized within the x-kernel source tree (e.g., as subdirectories of xkernel/build) or outside of the source tree (e.g., in an x-kernel user's home directory.)

For the purpose of the following discussion, we assume the user is configuring a kernel so as to implement and evaluate protocol YAP (yet another protocol.) A user configuring a kernel that contains only existing protocols should ignore all references to YAP.

  1. Put xkernel/bin/BINTYPE and xkernel/bin in your search path, where BINTYPE is one of sunos-sparc, mach3-mips, mach3-intelx86, irix-mips, or scout-alpha. These must be before /bin and /usr/bin. This will allow use of the version of make distributed with the x-kernel (GNU make v. 3.66) rather than the standard Unix make.

  2. Create a new working directory to hold your kernel.

  3. Change to your new working directory.

  4. Copy the appropriate Makefile for your platform from xkernel/build/Template into your working directory under the name Makefile:

    cp xkernel/build/Template/Makefile.sunos Makefile

  5. Make the Makefile writable:
    chmod u+w Makefile

  6. Edit the Makefile. Select an appropriate HOWTOCOMPILE. Generally, you want DEBUG until you are ready to run serious performance tests, then change it to OPTIMIZE. (See Section 8.)

    Check to see that the variable XRT in your Makefile is a path to the root of the xkernel source tree.

  7. If you are including a new protocol in your kernel, then create (at least) a shell for that protocol; e.g., create a shell version of yap.c. The protocol shell should define an initialization routine; e.g., yap_init. You will also need to put an entry for your protocol in one of the protocol tables referenced by your graph.comp (see section 13.1.) If you are configuring a kernel that contains only existing protocols, then this step is not necessary.

  8. Create a graph.comp in your build directory, as discussed in section 12.1, to specify the protocol graph for your kernel. Example graph.comps are located in the xkernel/build/Template directory.

    In steps 9, 10, and 11, you may see one or more compiler warning messages of the form:

    
             make[n]: fopen: [filename]: No such file or directory

    These messages are expected and can be ignored. The files referenced by these messages will be created in steps 10 and 11.

    The following two steps must be redone if graph.comp is later modified:

  9. make compose

  10. make depend

  11. If you are the first person building a kernel of this configuration at your site (i.e., if you are building a kernel as part of the installation procedure), you will need to run an initialization target for the system areas:
    make system
    This will run the targets allCompose, allDepend, and libs for the configuration and platform indicated by your Makefile, building configuration files, dependency files, and object files for most of the x-kernel system. Again, you will get error messages about missing dependency files, but the allDepend target will generate the missing files. This will take a long time to run. The installer of the x-kernel should run this target for all configurations (DEBUG,OPTIMIZE) and platforms that will be used at the site.

  12. make
    Object files will be placed in a subdirectory whose name reflects your configuration and platform (DEBUGsunos-sparc, OPTIMIZEmach3-mips, etc.) This is the same way in which object files are stored throughout the x-kernel hierarchy. The final x-kernel executable (xkernel) will be placed in your build directory.

Scout (Alpha Standalone)

As a standalone kernel, the Scout-based x-kernel can't read protocol tables or ROM files at boot time, so the information in these files must be loaded into the kernel during configuration.

Protocol table information is contained in the file ptblData.c in your build directory. By default, this file contains the contents of xkernel/etc/prottbl.std. To generate data from other protocol tables, use the ptbldump command:


        ptbldump file1 [ file2 ... ] > ptblData.c

To load ROM information into your kernel, specify the name of your ROM file in the third section of graph.comp (see the example in section 12.1.) The compose program will read the rom file and dump its data to the file compose_rom.c in your build directory.



Next: Debug versus Optimized Up: Configuring a Kernel Previous: Specifying a Protocol


Tue Nov 29 16:28:56 MST 1994