Getting Started with TS-Linux X86

From Technologic Systems Manuals
Jump to: navigation, search

Contents

1 Connecting Serial Communications and Power

  • An ANSI terminal or a PC running a terminal emulator is required to communicate with your Embedded PC. The serial parameters are 9600 baud, 8 data, and no parity. If you are running Linux, the minicom program works well, Windows users can run the Hyperterm application.
  • Connect the DB9 fe male connector labeled COM2 to a null modem cable. Connect the other end of the null modem cable to a serial port on the host. Technologic Systems offers a null modem cable with both 25 pin and 9 pin connectors at each end as part number CB7-06.
  • Connect a regulated 5VDC, ( 1A minimum) power source using the included 2 screw terminal strip/ connector. Please note the polarity printed on the board.
  • NOTE: Use the "shutdown -h now" command to halt the Linux system. Power cycling with the file system mounted will cause "fsck.ext2" to repair the file system on the next reboot.

2 Startup Sequence

  • Apply 5VDC power. The board mounted LED will blink, followed immediately by the display of the standard PC POST messages, memory test, and configuration data on your terminal. (Assumes JP2 is installed). � The BIOS boots Syslinux and reads the kernel and syslinux.cfg file from the FAT partition (/dev/hda1). (see http://syslinux.zytor.com)
  • Syslinux loads the kernel on /dev/hda1 using the ext2 partition on /dev/hda2 as the root file system.
  • The file system loads, networking, message logging, Apache web server, etc. are started automatically.
  • The login prompt is displayed, type "root" to login, the password is "redhat", the bash prompt appears.
  • (When booting to DiskOnChip the GRUB bootloader is used to boot the initrd image which then loads the DiskOnChip driver and mounts the DOC as the root file system. See http://www.gnu.org/software/grub).

3 Message Logging

The klogd and syslogd message logging daemons are not automatically started.

The Apache web server with PHP extensions is automatically started. The log files for Apache are located in '/www/logs'. To disable the Apache web server comp letely, move the file '/etc/rc3.d/S60apache' to a different directory. To disable message logging (including verbosity) edit the /var/www/conf/httpd.conf file.

To enable system and kernel logging, make a symlink in the /etc/rc.d/rc3.d directory like this:

ln -s ../../init.d/loggers S05loggers

(See the /etc/syslog.conf file for details of the logging features enabled)

4 TCP/IP Configuration

The TCP/IP settings for TS-Linux 3 are configured in the file '/etc/config/ifcfg-eth0', here is a listing :

DEVICE=eth0 # Name of ethernet interface
IPADDR=192.168.0.50 # Internet Protocol address of this ethernet interface.
NETMASK=255.255.255.0 # Used with NETWORK to determine which IP's are local.
NETWORK=192.168.0.0 # Used with NETMASK to determine which IP's are local.
BROADCAST=192.168.0.255 # Broadcast IP for system wide messages.
ONBOOT="yes" # Load device on boot.

The TCP/IP network settings are configured in the file '/etc/sysconfig/network', here is a listing:

NETWORKING=yes
FORWARD_IPV4=yes
DEFRAG_IPV4=no
GATEWAY="192.168.0.1" # Gateway for internet access.
HOSTNAME=epc # Host name of this computer.

The TCP/IP name resolution server is configured in the file '/etc/resolv.conf', here is a listing:

Nameserver 192.168.0.1 # Name server for domain name lookups.

To access the web server, open a web browser and enter "192.168.0.50/php/" as the address. This should display the file list for the directory '/www/htdocs/php'. Select the file 'epcwebmain.php' you should see a web page with some demo functions displayed.

5 Linux Utilities

  • /sbin/ifconfig: Display information about ethernet settings.
  • /usr/bin/df: Display disk space usage.
  • /usr/bin/free: Display memory usage.

Most of the Linux utilities you would expect are present in the TS Linux. In total there are over 120 utilities installed on the file system. Many of the basic utilities are implemented using Busybox, check the busybox web site for more information. (http://www.busybox.net/)

6 Linux Notes

After the kernel is done booting the 'init' process reads the file '/etc/inittab'. The inittab file will call /etc/rc.d/ rcS.sysinit' as part of the system initialization. The runlevel then defaults to 3, which will run the '/etc/rcS' script and call all the scripts linked in the '/etc/rc3.d/' directory in numerical order. A halt or reboot command will change the runlevel to 0 or 6 execute the '/etc/rc0.d' scripts or 'etc/rc6.d' scripts respectively.

7 tsconfig Script

Run the tsconfig script to configure the console logins and default runlevel. A console login can be established for COM1, COM2 and VGA. The runlevel is set to 3 by the TS Linux scripts, the default runlevel can be changed using tsconfig.

8 Mounting NFS Root File System

To mount the root file system via NFS:

8.1 Prepare the Exported Root Directory on the Host Machine

1. Download the NFS root tarfile from our website to your Linux host machine: http://www.embeddedx86.com/downloads/TS-2.20-nfs.tar.gz

2. Untar NFS root package to a directory on the host machine.

gunzip TS-2.20-nfs.tar.gz
tar xvf TS-2.20-nfs.tar

The directory is '/home/nfs/' in this example.

3. Export the directory by adding the following line to the file '/etc/exports'

/home/nfs/ 192.168.0.0/255.255.255.0 (rw,no_root_squash,insecure)
Note: The IP mask in the above example will only allow NFS connections from computers having an IP starting with 192.168.0. Substitute the appropriate parameters for your local network. See the links to 'www.linuxdoc.org' at the end of this file for more info.

4. Restart NFS so the directory is available for export, on my machine I use:

/etc/init.d/nfs restart
Note: This may be different on your machine, or you can just reboot.

5. Modify the /home/nfs/etc/fstab file on your host system for your local network settings. On my system I use:

192.168.0.18:/home/nfs/ / nfs exec,dev,suid 0 0

8.2 Prepare the TS Computer for Your Local Settings

1. Edit the syslinux.cfg file on the boot partition (usually /dev/hda1). Modify the "nfs" section to match the directories and IP's of your local network. ( see section on page 4.)

2. Select "nfs" from the Syslinux boot prompt.

Note: Systems which are using COM2 as the console cannot see the Syslinux menu items because of limited video interrupt support in the BIOS. The possible entries are: "linux", "nfs" and "initrd".

8.3 Directories and IP Addresses Used in the Examples

  • /home/nfs/: This is the exported NFS directory on the Linux host machine running Mandrake, Redhat, etc. All development of the kernel, file system and applications can be done on this machine, then new files can be copied to the '/home/nfs/root' for debugging on the EPC.
  • 192.168.0.50: This is the IP for the EPC, used while the NFS mount process is starting. After the EPC mounts the NFS file system and runs INIT, the real IP for the EPC is setup in the file '/etc/config/ifcfg-eth0'. (this is also set to 192.168.0.50)
  • 192.168.0.18: This is the IP of the desktop machine running Mandrake. The desktop machine and the EPC are connected to the same hub on my local network.

8.4 Explanation of nfs section of syslinux.cfg file (usually on /dev/hda1)

<----start of nfs section---->

LABEL nfs
KERNEL bzImage
APPEND console=ttyS1 root=/dev/nfs nfsroot=192.168.0.18:/home/mike/nfs/
nfsaddrs=192.168.0.50:192.168.0.18::255.255.255.0:epc:eth0:none

<-----end of nfs section----->

  • bzImage: This is the kernel image to load.
  • console=ttyS1: Redirects messages and login to COM2.
  • root=/dev/nfs: Tells kernel to mount root directory as NFS.
  • nfsroot=...: This sets the IP and NFS directory of the host machine.
  • nfsaddrs=...: This sets the IP of the local machine, the IP of the host machine, the subnet mask, the machine name and the network device to use. The web links to www.linuxdoc.org provided above can provide more detailed explanation.

9 Further Sources of Information

In the kernel source tree: /Documentation/nfsroot.txt

On the web: www.linuxdoc.org/HOWTO/NFS-HOWTO/index.html www.linuxdoc.org/HOWTO/mini/NFS-Root.html www.linuxdoc.org/HOWTO/mini/NFS-Root-Client-mini-HOWTO/index.html

Technologic Systems support pages: www.embeddedx86.com/epc/support www.embeddedx86.com/~grimiore

Email: support@embeddedx86.com