Utilizing MBARI s Software Infrastructure and Application for MOOS (SIAM) for NOAA s Real-time Environmental Coastal Observing Network (RECON) Devin A Bonnie, Hope College Mentors: Tom O Reilly, Kent Headley Summer 2009 INTRODUCTION The Monterey Bay Aquarium Research Institute (MBARI) has developed the Software Infrastructure and Applications for MOOS (SIAM). Similarly, the Great Lakes Environmental Research Laboratory (GLERL), a NOAA research facility, has developed the Real-time Environmental Coastal Observing Network (RECON). GLERL has expressed interest to integrate SIAM as the backbone for RECON in an effort to standardize observing systems and to reduce complexity of their current implementation. The goal of this project is to evaluate SIAM with the existing RECON hardware configuration and to integrate a Ysi Conductivity, Temperature, and Depth sensor (CTD) into SIAM s codebase. MATERIALS AND METHODS The two main components of this project were the hardware and software requirements. These were decided early in the project by GLERL as they wished to use a Technological Systems embedded Arm computer, specifically the TS- 7260. This PC104 board features low power consumption, the ability to run a Linux operating system, and can be highly expandable through its PC104 bus. The software requirements were then dependent on this hardware choice, namely the Linux distribution and the Java Virtual Machine (JVM). 1
Technological Systems currently offers the 2.4 Linux kernel as the default configuration for the TS-7260. They also provide sources, binaries, and crosscompilers for the 2.6 kernel. However, they do not officially offer support for this newer kernel version. The Linux distribution Debian Sarge and Debian Etch are also offered for this board but Debian Etch required minor modifications for use. Both kernels and distributions were evaluated for this project. The Linux 2.4 kernel was used with Debian Sarge. Since the 2.4 kernel is extremely outdated finding a suitable Java Virtual Machine was a key issue. The JVMs under consideration were IBM s j9, JamVM, Open JDK, and Sun s embedded Java. IBM s j9 is currently in use at MBARI under similar requirements but is a much older JVM. JamVM is an open source JVM that utilizes the GNU-classpath libraries. These libraries are dependent on the kernel and Linux distribution, so an older version of JamVM (v1.2.2) could only be used. When installed JamVM was able to run simple Java applications. However, when running complex tests it was found that JamVM could not instantiate static class members and would result in segmentation faults. Open JDK and Sun s embedded Java have higher hardware and software requirements respectively and were unable to be implemented in the current environment. It was then decided to upgrade the Linux kernel to make use of different JVMs. The kernel chosen was the 2.6.21 Linux kernel. This kernel featured the udev device manager and the embedded-application binary interface (EABI). EABI defines standard conventions for the Arm processors, which make them highly efficient. However, when using an EABI kernel it was found that the only possible EABI root file system choice was Debian Sid. This was not feasible as Sid is currently in the experimental phase and many functions are not ported yet. The 2.6.21 kernel featured an old application binary interface (OABI) that allowed the TS-7260 to run an EABI kernel with an OABI file system. This is not optimal but the easiest choice to implement newer software for this specific platform. 2
After successfully compiling the 2.6 kernel and running Debian Etch the choices of JVMs grew considerably larger. Out of all the previous choices only JamVM and Open JDK were viable due to hardware constraints. Sun s embedded Java would have been the optimal choice but required a higher Arm processor than the TS-7260 provided. The only feasible way to implement Open JDK was to crosscompile the source rather than build natively. This was due to the large amounts of memory needed to build all of Open JDK s components. However, it was not required to build JamVm natively as binary packages existed in Debian s software repository. The Ysi CTD driver was implemented using many of the existing libraries in SIAM. This 6-Series instrument was classified as a streaming instrument, thus utilized the SIAM Streaming Instrument Service class. The Ysi instrument service was difficult due to its menu driven nature. Once the proper command order was determined, their timing, and the proper parsing of the output data stream the service could be implemented into the SIAM codebase. The open source Java package Data Turbine was used with the SIAM and Java environment on the TS-7260. Modifications were made to the Base Instrument Service and the Instrument Service Attributes class to construct a turbinator when the publisherhost attribute is defined for the instrument. The turbinator utilized the processsample method, from the instrument, and published the parsed data to a Data Turbine server. This ring buffer server could then be queried by the open source Real-time Data Viewer to analyze real-time data visually. CONCLUSIONS/RECOMMENDATIONS In order to fully realize a JVM with a higher standard than j9, the Linux 2.6 kernel must be used with the TS-7260. The optimal choice, Sun s embedded java, can only be used with an Arm v5 or higher, which is only provided with the newer models produced by Technologic Systems. JamVM ran far too sluggish when multiple services were called by SIAM. One theory is that the JamVM packages were not optimized for an Arm processor and to test this the sources would need to be compiled natively. A similar JVM that could be used is CacaoVM, which is 3
also based upon the GNU-classpath. Open JDK could possibly be used as well but the cross-compilers provided by Technologic Systems did not have a high success rate. To run SIAM feasibly the recommendation is to find another hardware platform. The manufacturer does not provide adequate support for their product. This leaves the user limited to older software unless the user themselves is willing to sacrifice the time and effort to update and troubleshoot hardware. The Ysi instrument driver was implemented successfully. The driver follows the SIAM protocols and provides a high level of configuration for its sensors and data output stream. This class can also serve as a starting point to develop other Ysi 6- Series and may possibly serve as a base class, similar to the Seabird Base class. To prepare this test bed for a demo, a branch of SIAM was used to incorporate a WetLabs fluorometer. The use of branched software from the main development tree resulted in many extra hours of debugging and rebuilding SIAM components. This illustrated the importance of code conformity and the dangers of deviating from the working source. For more information concerning the setup and configuration of the TS-7260 note the appendices following this paper. ACKNOWLEDGEMENTS I would like to thank Tom O Reilly, Steve Ruberg, Ken Johnson, George Matsumoto, Kent Headley, and the MBARI staff for their help and contributions during this project. 4
APPENDICIES Configuring the TS-7260 2.6.21 kernel The following sources are needed from the Technological Systems FTP site. - tskernel-2.6.21-ts-src.tar.gz - crosstool-linux26-3.4.4-2005q3-2.tar.gz The kernel is EABI as well as the cross compiler. To compile the kernel, the toplevel makefile from the kernel source needs to be edited. Edit the CROSS_COMPILE variable to point to the folder defined, e.g. - CROSS_COMPILE?= /path/to./crosscompiler/folder/arm-none-linux- gnueabi/bin/arm-none-linux-gnueabi- To now compile the kernel, issue the following commands: - make ts72xx_defconfig - make menuconfig - make The kernel options needed, when issuing make menuconfig, are: - Kernel features ->Use Arm EABI to compile, Allow Old ABI binaries to run - Kernel features -> File Systems -> EXT2 - Device drivers -> SCSI device support, SCSI disk support - Device drivers -> USB support -> USB files system, OHCI HCD Root File System, USB flash The distribution used should be a Linux OS that is OABI and uses the udev device manager. Debian Etch is a viable choice for this board. To use Etch on a USB flash stick the following steps should be completed, without mounting: - fdisk <path to usb stick> - d (delete existing partitions) 5
- n (new partition) - p (primary partition) - 1 - default starting cylinder - default last cylinder - p (print out partition table) - if the first partition is not bootable (does not have a * in the boot field), enter a - w (write changes to disk) - mkfs.ext2 <path top usb stick> - mount <path to usb stick> <path to mount destination> - untar Linux distrobution to <path to mount destination> Now certain changes need to be made to the distribution files. Edit /etc/fstab to contain /dev/scsi/host0/bus0/target0/lun0/part1 / ext2 defaults 0 0. Edit /etc/hostname to the hostname you wish to use (very useful for ssh). Edit /etc/inetd.conf to contain ssh stream tcp nowait root /usr/sbin/tcpd /usr/sbin/sshd i. Edit /etc/network/interfaces to contain iface eth0 inet dhcp as the default is set to static ip. Edit /etc/resolv.conf to contain your appropriate name servers. Lastly, /etc/inittab contains the getty for ttyam0, which is the main serial communications port. This is useful for initial configuration, but once ssh is running the getty ttyam0 line can be commented out to use the port. Booting the 2.6 kernel The bootloader used on the TS-7260 is redboot. The only boot options for redboot are loading kernels from the onboard flash memory, nfs server, or ftp server. The way described is using the bootloader module provided by Technological Systems. However, the downside of this option is one must first boot the 2.4 kernel into the provided distribution TS-Linux. Once booted into TS-Linux 6
and after loading the module, a module command can be passed a kernel (that you have transferred into the TS-Linux file system ) and kernel command boot options. The following script illustrates this: ################ #!/bin/sh insmod f bootloader.o sleep 2 bootload c console=ttyam0, 115200 rootdelay=8 root=/dev/sda1 zimage ############### where zimage is the compiled kernel. The console option is helpful for debugging the kernel boot sequence and the rootdelay option is crucial, as the kernel needs time to load the usb drivers. SIAM and RXTX Build SIAM on a target host with a suitable JVM. It was found that JamVM 1.4.2 had JSE 5.0 compatibility, as SIAM was built on a separate machine and then transferred via secure copy protocol (SCP) to the TS-7260. Following the instructions given by MBARI are more than adequate to complete this task. The RXTX binaries used reside in the ToyBox repository, found on the RXTX wiki. Specifically, use librxtxserial.so found in /ToyBox/2.1-7- build1/linux/glibc-2.3.5/arm-uknown-linux-gnu. The RXTXcomm.jar can be found in /ToyBox/2.1-7-build1/. Once placed on the TS-7260 the environment variable LD_LIBRARY_PATH needs to point at librxtxserial.so and SIAM_CLASSPATH needs RXTXcomm.jar. 7