75XX initrd

From embeddedTS Manuals
Revision as of 15:56, 8 August 2011 by Mark (talk | contribs)

After the board is first booted you will be at this shell:

Finished booting in 2.65 seconds
Type 'tshelp' for help
#

This is a busybox shell which presents you with a very minimalistic system. This filesystem is loaded into memory, so none of the changes will be saved unless you type 'save', or mount a filesystem as read write. This can also provide a simple mechanism for running your application in an entirely read only environment. The linuxrc script will be the first thing executed as soon as the kernel is loaded. This sets the default IP address, loads a reloadable FPGA bitstream if one is present, starts the userspace ctl applications, and more. Read the linuxrc for more information.

While busybox itself doesn't contain much functionality, it does mount the Debian partition under /mnt/root/. It will also add common paths and load libraries from the Debian system. Many of the Debian applications will work by default. If an application relies on certain paths being in certain places, or running services, you should instead boot to Debian to run them.

This shell when started on the COM port is what is blocking a Debian boot. If you close it by typing 'exit', the boot process will continue. If you are connected through telnet, this will instead open up its own instance of the shell so typing 'exit' will only end that session. Through any connection method you can run the following to always boot to the debian installation:

rm linuxrc; ln -sf /linuxrc-sdroot /linuxrc; save
reboot

The small default initrd is only 2Mbyte but there is space for approximately 800 Kbyte of additional user applications. The binaries on the initrd are dynamically linked against embedded Linux's "uclibc" library instead of the more common Linux C library "glibc". "uclibc" is a smaller version of the standard C library optimized for embedded systems and requires a different set of GCC compiler tools which are available here.

The compiled instance of busybox includes several internal commands listed below:

  # /bin/busybox --help
  BusyBox v1.14.2 (2009-08-07 14:43:48 MST) multi-call binary
  Copyright (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko
  and others. Licensed under GPLv2.
  See source distribution for full notice.
  
  Usage: busybox [function] [arguments]...
     or: function [arguments]...
  
          BusyBox is a multi-call binary that combines many common Unix
          utilities into a single executable.  Most people will create a
          link to busybox for each function they wish to use and BusyBox
          will act like whatever it was invoked as!
  
  Currently defined functions:
          [, [[, ash, basename, cat, chgrp, chmod, chown, chroot, cmp, cp,
          cpio, cttyhack, cut, date, dd, depmod, devmem, df, dirname, dmesg,
          du, echo, egrep, env, expr, false, fdisk, fgrep, find, grep, gunzip,
          gzip, halt, head, hostname, hush, ifconfig, insmod, kill, killall,
          ln, login, ls, lsmod, md5sum, mdev, mkdir, mknod, modprobe, more,
          mount, msh, mv, netstat, ping, pivot_root, poweroff, printf, ps,
          pwd, reboot, rm, rmdir, rmmod, route, rx, sed, setconsole, setsid,
          sh, sleep, stty, sync, tail, tar, telnetd, test, tftp, top, tr,
          true, udhcpc, umount, unzip, usleep, uudecode, uuencode, vi, wget,
          xargs, yes, zcat

Also on the initrd are the TS specific applications: sdctl, spiflashctl, ts7500ctl, canctl, and xuartctl. We also provide the ts7500.subr which provides the following functions:

 cvtime()
 usbload()
 sdsave()
 spiflashsave()
 save()
 sd2spiflash()
 spiflash2sd()
 setdiopin()
 getdiopin()
 setrelay()
 setout()
 getin()
 tshelp()
 gettemp()

By default, linuxrc will not insert the necessary modules into the kernel to mount and use USB devices within the initrd/busybox environment if there is no USB device present upon bootup (USB support is enabled by default within the Debian environment). The quickest way to get a USB device (like a USB thumb drive) to mount in the initrd/busybox environment is to ensure that it is plugged in before the TS-7500 is powered up. In order to get hot-swappable USB devices regardless of device presence at bootup time, you must "modprobe" the necessary modules. This has been done for you in the ts7500.subr file with the usbload() function.