Thursday, April 22, 2010

GHS: Mount a Remote NFS share

A little background to understand this post. We use Green Hills Software (GHS) Multi to compile code for GHS Integrity, their Real Time Operating System (RTOS) that can be used in embedded systems. If you want to know more about Green Hills Software, you can go to their site (, but here I am just going to be sharing some gotchas that I've gone through with GHS.

At one point, the amount of files that needed to be ftp'd to the 440GX eval board (simulates target hardware when unavailable) to the local filesystem for use by the application software exceeded the allowable space on the FFS. Therefore, we had to create an NFS share on the host Windows server and mount it when loading the kernel. The downside: The address of the NFS share is hard-coded into the kernel and you need to make 1 kernel per board. The upside: It doesn't effect the design of the waveform or test software. It is transparent. Also, it is only limited by the size of the server harddrive.

The first part is to start a project in Multi to create a kernel for the IBM 440GX. Include a File System. When it comes up, you will see an ivfserver_module.gpj. It is probably a good idea to go make a copy of this and put a local version in the diercotry where this kernel project is so that you dont directly change the GHS standard files. You will have to do this for each file directly under the gpj as well.

Next, modify your customized copy of ffs_mountable.c and change the section at the bottom to look like:

vfs_MountEntry vfs_MountTable[] = {
/* "", */
/* "", */
/* "", */
{NULL, NULL, NULL, NULL, 0, 0} /* Must end with NULL/0 entry */

This hardcodes a NFS share into the kernel, so you need a seperate kernel for each board. The example above shows a kernel for Board1 which mounts a NFS share from the Host ( called Board1. You can compile at this time, but do not load the kernel till you have created the specified NFS share on the host.

To create the share, use the Server for NFS built into Windows 2003 Server. You have to install it by going to Add/Remove Programs, selecting the Add additional components, and selecting it from there. You will need to put in the installation CD.

No comments:

Post a Comment