Running LinuxLink Classic x86 Distribution as a target on a Host Operating System

LinuxLink Classic reference distributions are preconfigured to be installed in a host-target development environment. If you prefer to boot and run the LinuxLink Classic x86 distribution on the host, and eliminate the need for a target board, this document describes one method.

Prerequisites and Assumptions

This document makes the following assumptions:

  • Your x86 host meets the requirements specified in Linux Host Considerations.
  • It has an unused 700 MB or greater disk partition on which to install a TimeSys RFS.
  • It uses the GRUB bootloader. Although the instructions in this article are specific to GRUB, they should be easy to adapt if you use the LILO bootloader.

General Procedure

To install and configure the RFS:

  1. Prepare the unused disk partition.
  2. Install the TimeSys RFS on the partition.
  3. Configure GRUB so it can boot the kernel.
  4. Configure the TimeSys RFS.

Prepare a Partition

To find and prepare an unused disk partition:

  1. List your disk drives by examining the /proc/ide directory:
    # ls /proc/ide/
    drivers  hda  hdc  ide0  ide1  sis
  2. Use the fdisk command to display the names of the partitions, as shown in the following example:
    # fdisk -l /dev/hda /dev/hdc
    
    Disk /dev/hda: 120.0 GB, 120033041920 bytes
    255 heads, 63 sectors/track, 14593 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *           1        2550    20482843+  83  Linux
    /dev/hda2           12162       12404     1951897+  82  Linux swap
    /dev/hda3           12405       14593    17583142+  83  Linux
    /dev/hda4            2551       12161    77200357+   f  W95 Ext'd (LBA)
    /dev/hda5            2551       12161    77200326   83  Linux
    
    Partition table entries are not in disk order
    
    Disk /dev/hdc: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdc1               1        4800    38555968+  83  Linux
    /dev/hdc2            4801        9520    37913400   83  Linux
    /dev/hdc3            9521        9729     1678792+  82  Linux swap
  3. Once you decide which partition to use, ensure that it is formatted for the ext filesystem. This command will erase all of the data on the partition. The following example shows the /dev/hdc2 partition being formatted:
    # mke2fs /dev/hdc2

Install the RFS

The easiest way to install the RFS on the new partition is to run the distribution installer and select only the RFS for installation:

  1. Mount the partition that you prepared in the previous section. The following example uses /mnt/new as the path for relocating the RFS:
    # mkdir /mnt/new  
    # mount /dev/hdc2 /mnt/new
  2. Run the installer and select the RFS:
    ./install 
    ...
    ...
    Select the components you wish to install or update by entering the selection
    numbers separated by commas.
    Enter X to Exit >  4
    
       1.  Standard Cygwin-hosted glibc Toolchain for target i686.......339912K
       2.  Standard Linux-hosted glibc Toolchain for target i686........340947K
       3.  Kernel for x86-p3-basic......................................210568K
      *4.  Linux Standard RFS...........................................494256K
       5.  Extra Linux-hosted tools.......................................1611K
       6.  Extra Cygwin-hosted Tools.......................................416K
       
     The components marked with * will be installed.  Total size: 494256K
     Enter numbers separated by commas to select or unselect more components.
     Enter X to Exit or A to Accept > a
  3. When prompted, enter y to indicate that you want to relocate the RFS:
    Components will be installed in the following paths:
    
    Linux Standard RFS..................................................494256K
    Path: /opt/timesys/linux/6.1/i686-std/rfs
    Partition: /
    
    Partition summary:
    Partition: /    Available: 784228K    Required: 494256K
    Do you want to relocate any of these components? [y/N]  y
    
    The following components are relocatable.
    
    Linux Standard RFS..................................................494256K
    Path: /opt/timesys/linux/6.1/i686-std/rfs
    Partition: /
  4. Enter the path to the new partition as the location for installing the RFS:
    Type in new path or hit Enter to use above path:  /mnt/new
    ----------------------------------------------------
    Components will be installed in the following paths:
    
    Linux Standard RFS..................................................494256K
    Path: /mnt/new
    Partition: /mnt/new
    
    Partition summary:
    Partition: /mnt/new    Available: 784228K    Required: 494256K
    Do you want to relocate any of these components? [y/N]
  5. When prompted again to relocate components, enter n to complete the installation.

Configure GRUB

The default directory used by grub is /boot. A TimeSys reference distribution includes a kernel image in the /boot directory of the RFS. Add the path of this image to the GRUB configuration file, keeping in mind that the GRUB you are configuring here is the GRUB that is part of the original desktop distribution on the host, not the GRUB that is delivered as part of the TimeSys distribution.

Modify the original GRUB configuration file so that it can boot either the original distribution or the TimeSys distribution. Older versions of GRUB use the configuration file /boot/grub/grub.conf. Newer versions use /boot/grub/menu.lst. Add a stanza similar to the following one to the file you have:

title TimeSys 2.6.16-ts.x86p3.1
    root (hd2,1)
    kernel /boot/bzImage-kernel-2.6.16-ts.x86p3.1 ro

Here, root specifies the partition where you just installed the TimeSys RFS, kernel is the path to the TimeSys kernel in the RFS, and the ro parameter causes the RFS to be initially mounted as read only. Refer to the GRUB Manual for more details.

Configure the TimeSys RFS

Finally, you must edit the /etc/fstab file in the TimeSys RFS to specify the location of the RFS. At this stage, the full path to this file is /mnt/new/etc/fstab.

/dev/hdc2    /    ext3    defaults    1 1

Now, when you reboot the system, you can select the TimeSys distribution from the boot menu.