Next Previous Contents

6. Configuring Kernels for use with Coda

Currently, Coda clients and servers are supported under Red Hat Linux, FreeBSD and NetBSD.

The Coda servers may be run on unmodified kernels. The Coda srv process is user-level code that uses existing kernel services. The Venus client, however, requires some Coda-specific changes be made to the kernel. The kernel specific changes add Coda specific definitions to the Vnode layer in the kernel which are needed to satisfy the requirements of the Coda file system to the vfs layer in the kernel.

6.1 Vnode Interface

In Unix systems, the code which translates user-generated system calls into file system requests is called the VFS Interface. Coda satisfies the VFS Interface by providing the necessary Vnode definitions for systems calls such as creat(), open(), stat(), etc. (site Bach or Tannebaum) This in turn, allows communication between Venus and the queued Vnode requests to occur through the special Coda device /dev/cfs0 which provides Venus access to the vsf<->vnode kernel interface.

ADD COMMENT ABOUT MINI-CACHE

The device file /dev/cfs0 is created automatically by venus-setup. Please see <@@ref>ClientInstallInstalling and Configuring a Coda Client for the major and minor device numbers specific to a supported platform.

The rest of this chapter will focus on integrating the Coda code that satisfies the Vnode interface into the kernels of supported platforms.

6.2 Configuring A Kernel

Configuring a Linux kernel

Coda may be configured as a module or hard-coded in a ``monolithic'' kernel. However, modules are distributed that will work with the default kernels provided by current versions of Red Hat Linux. Compiling a module will only be necessary if you are not using a Red Hat distribution kernel.

PROCEEDURES TO BE ADDED

Configuring a FreeBSD kernel

At this time, loadable module support for Coda is not available, and thus, Venus support must compiled into the kernel.

The Coda Development Group also releases a pre-built GENERIC FreeBSD kernel with Coda Venus support built in. The only difference between the GENERIC kernel provided by the FreeBSD and the CODA kernel provided is the addition of Coda Filesystem information added to the Vnode layer and the enabling of the kernel debugger.

For those that wish to compile their own kernel, the following files need to be obtained from ftp://ftp.coda.cs.cmu.edu/pub/coda/freebsd/<OS-VERSION>/i386/

kernel-patch.FreeBSD-2.2.5-4.3.14.gz
coda-4.3.13.tgz
. You must also have the FreeBSD kernel sources installed and available as well.

Once these files have been obtained, you need to collect them into the same area, set this area up, unpack sources, patch the kernel source tree, and then make any changes to the configuration file CODA you need.

The following outline should work and is used by one of our CMU staff members: Collect the three Coda files above in to a common place such as /usr/src/coda/. Then make a sys/ directory to make a copy of the FreeBSD kernel tree. The Coda source directory will be created when the Coda sources are untar'red under /usr/src/coda/Of course, another location may be used if you desire. However, this example assumes /usr/src/coda as the base. To setup your work area and make a copy of the kernel source tree, do:

# mkdir /usr/src/coda                     # for collecting coda specific files
# mkdir /usr/src/coda/sys                 # for a copy of the kernel source
# cd /usr/src/sys
# tar cfv - . | (cd /usr/src/coda/sys; tar xfv -)  # makes a copy of the kernel
# mv kernel-patch.freebsd-<OS_RELEASE>-<coda_release>.gz /usr/src/coda
# mv coda-<coda_release>.tgz /usr/src/coda
Once all the necessary components are assembled, the following will unpack the Coda sources under /usr/src/coda:
# cd /usr/src/coda
# tar zxfv coda-<coda_release>.tgz
The last steps will copy the necessary files from the Coda source tree /usr/src/coda/coda-<coda_release>/ into the copy of the kernel source tree (/usr/src/coda/sys/) and patch the kernel source tree to be configurable for Coda Vnode support:
# mkdir /usr/src/coda/sys/cfs
# mkdir /usr/src/coda/sys/ufs/ifs
# cd /usr/coda/src/coda/coda-<coda_release>/kernel-src/vfs/bsd44/cfs
# cp -rp cfs /usr/src/coda/sys/cfs
# cd ../ufs/ifs
# cp -p ifs /usr/src/coda/sys/ufs/ifs
# cd /usr/src/coda
# gunzip kernel-patch.freebsd-<OS_RELEASE>-<coda_release>.gz
# patch -p5 < kernel-patch.freebsd-<OS_RELEASE>-<coda_release>
Once these steps have been completed successfully, you have a FreeBSD kernel patch with the Coda Venus extensions. In /usr/src/coda/sys/i386/conf you will find CODA which is identical to the FreeBSD provided GENERIC configuration file plus the Coda extensions which consist of:
options               CFS                     #Coda File System
pseudo-device vcfs    4       # coda minicache <-> venus comm.
You may change the kernel configuration file CODA as you would change the GENERIC file for local machine needs. Then follow the FreeBSD instructions for compiling a kernel. If you already have your own configuration file, please include the above lines from CODA to enable Venus support.

Don't forget to check INSTALL.freebsd and README.kernel for any last minute changes that may not have found their way into the Coda manual. Also, remember you only need a modified kernel for the client side of Coda, not the server side.

Configuring a NetBSD kernel

PROCEEDURES AND COMMENTS TO BE MODIFIED FROM FREEBSD SECTION


Next Previous Contents