ChorusOS 4.0 Production Guide

Building an IOM Component

The make process occurs in three phases

  1. Build source files (this phase is only present in the NUCLEUS component).

  2. Compile source files and create dependency files.

  3. Link object files.

When make runs, it launches mkmake. The mkmake tool uses the all.dp dependency file to determine in which directories make will run. Only the directories accessed are displayed.

host% make
...
<bin_dir>/tools/host/bin/mkmake 
<work_dir>/build-NUCLEUS/ sources +l +b -- sources
>> In src/os/iom/sys sources
<< In src/os/iom/sys sources done
<bin_dir>/tools/host/bin/mkmake 
<work_dir>/build-NUCLEUS/ prod +l +m +b -- local_prod
>> In src/os/iom/sys prod
<< In src/os/iom/sys prod done
<bin_dir>/tools/host/bin/mkmake 
<work_dir>/build-NUCLEUS/ link +b -- local_link
>> In src/os/iom/sys/bsd/kern/disk link
<< In src/os/iom/sys/bsd/kern/disk link done
...

Relink of the IOM Actor

To relink the IOM actor, remove it and then run the make command to regenerate the component.

host% rm <work_dir>/build-IOM/src/os/iom/sys/N_iom.r
host% make

The output you get displays the regeneration of the N_iom.r actor.

Recompilation of a Source File

Recompile a source file, for example pathName.C, by removing the object file, <work_dir>/build-IOM/src/os/iom/sys/sys/lib/mem/pathName.o and running the make command. You get a very long output which includes the following:

host% rm <work_dir>/build-IOM/src/os/iom/sys/sys/lib/mem/pathName.o
host% make
>> In src/os/iom/sys/sys/lib/mem prod
    	...
     CC pathName.C
    	...
     ar -> mem.a
     ...
     sh <bin_dir>/tools/host/bin//../../tgt-make/genLink \
     <work_dir>/build-NUCLEUS/ <work_dir> -r -c -e _start -o N_iom.r -B \
     ...<work_dir>/build-NUCLEUS/lib/classix/libsys.s.a
     
     <bin_dir>/tools/host/bin/configurator \
     -c <work_dir>/conf/ChorusOS.xml -action configure
       
     <bin_dir>/tools/powerpc/solaris/5.00/powerpc-elf/bin/gcc \
     ...
     bsd/kern/vfs/vfs_vnops.o \
     ...
     <bin_dir>/tools/host/bin/mkctors -T <work_dir>/obj/os/iom/sys/tunables.k \
     <work_dir>/obj/os/iom/sys/N_iom.r.xpO > <work_dir>/obj/os/iom/sys/N_iom.r.CT.s
     <bin_dir>/tools/powerpc/solaris/5.00/powerpc-elf/bin/gcc
     ...
     <work_dir>/obj/os/iom/sys/N_iom.r.CT.o
     ...
     <bin_dir>/tools/powerpc/solaris/5.00/powerpc-elf/bin/gcc
     ...
     <work_dir>/obj/os/iom/sys/N_iom.r.CT.o
     ...

Look at this output as occurring in several steps.

  1. For step 1:

        ...
         >> In src/os/iom/sys/sys/lib/mem prod
        	...
         CC pathName.C
        	...
         ar -> mem.a
         ...

    The <work_dir>/build-IOM/src/os/iom/sys/sys/lib/mem directory builds a library used during the IOM link. The object file is generated, the library is updated, and the mkmake command continues.

  2. For step 2:

          ...
          sh <bin_dir>/tools/host/bin//../../tgt-make/genLink \
          <work_dir>/build-NUCLEUS/ <work_dir> -r -c -e _start -o N_iom.r -B \
          ...<work_dir>/build-NUCLEUS/lib/classix/libsys.s.a
    

    The linked actor is copied back to the source directory.

  3. Step 3 calls the configurator command:

         <bin_dir>/tools/host/bin/configurator \
         -c <work_dir>/conf/ChorusOS.xml -action configure
    

    This gets the IOM configuration settings from the XML configuration file.

  4. The last step is the link itself.

     <bin_dir>/tools/powerpc/solaris/5.00/powerpc-elf/bin/gcc    ...
     bsd/kern/vfs/vfs_vnops.o \...
     <bin_dir>/tools/host/bin/mkctors -T <work_dir>/obj/os/iom/sys/tunables.k \
     <work_dir>/obj/os/iom/sys/N_iom.r.xpO > <work_dir>/obj/os/iom/sys/N_iom.r.CT.s
     <bin_dir>/tools/powerpc/solaris/5.00/powerpc-elf/bin/gcc
     ...
     <work_dir>/obj/os/iom/sys/N_iom.r.CT.o
     ...
     <bin_dir>/tools/powerpc/solaris/5.00/powerpc-elf/bin/gcc
     ...
     <work_dir>/obj/os/iom/sys/N_iom.r.CT.o
     ...
    

    This is done after several loops of gcc, and a call to mkctors, in order to set the values of the tunable parameters.

Link of Configurable Actors

Steps 2 to 4 comprise the link of a configurable actor; in this instance, N_iom.r. The link of a configurable actor is unusual, as instead of linking the actor in the current work directory, object files are copied into the obj directory, located in build-IOM. The actor is linked to your work directory and then copied back to the source tree.

The first step is to call genLink, which will:

Verbose Mode

See how the mkmake command is called for each phase by running the make command in verbose mode as follows:

host% make SILENT=
 /<bin_dir>/tools/host/bin/mkmake \
   /<work_dir>/build-NUCLEUS/ sources +l +b -- sources
   >> In <bin_dir>/bin/tools/host/bin/mkmake \
   <work_dir>/build-NUCLEUS/ prod +l +m +b -- local_prod
   <bin_dir>/tools/host/bin/mkmake \
   <work_dir>/build-NUCLEUS/ link +b -- local_link
   >> In src/os/iom/sys/sys/lib/mem link
   << In src/os/iom/sys/sys/lib/mem link done
  

depend and all

The make depend command rebuilds dependencies. This make target is used when the list of header files in a source file is changed. As seen earlier, if the Makefile content changes, dependencies are reconstructed. In the <work_dir>/build-IOM/src/os/iom/sys/sys/lib/gen directory, use the make depend command.

host% make depend
     >> In src/os/iom/sys/sys/lib/gen depend
    ...
    Makefile -> all.dp
    << In src/os/iom/sys/sys/lib/gen depend done

Note -

In this directory, there are object files that are used in linking the IOM component. In this case, the -export lines in all.dp are not empty.


#	automatically generated file
    # -export ALL :   insremque.o ovbcopy.o memstat.o iomRqTask.o util.o
    # -export SUP :   insremque.o ovbcopy.o memstat.o iomRqTask.o util.o                                  
    # -export USR :   insremque.o ovbcopy.o memstat.o iomRqTask.o util.o 

This information is used by getExport, which reads all the all.dp files in the source tree to determine which object files to use.