vmware+redhat+rtai

14
Install RTAI-Patched Redhat 9.0 in VMWare 7.0 Wang, Hancheng, May 14 th , 2010 Abstraction The low-frequency, high-speed camera system will be built based on linux system with RTAI. Following this document, we can set up a real-time experimental platform to make the SPCA5xx-based webcam work(see the ppt) properly and get familiar with linux. Now, we choose Redhat 9.0 as the operation system, for which there are lots of reference materials. We also adopt VMWare 7.0 to make the process much easier and to encourage us to try whatever we want in this easy-recoverable system. Keywords RTAI, Redhat, Linux, VMWare, VMWare tools, kernel, patch, update, 2.4.20-8

Upload: samirever

Post on 15-Nov-2015

2 views

Category:

Documents


0 download

DESCRIPTION

VMWARE Redhat linux

TRANSCRIPT

  • Install RTAI-Patched Redhat 9.0 in VMWare 7.0

    Wang, Hancheng, May 14th

    , 2010

    Abstraction

    The low-frequency, high-speed camera system will be built based on linux system with RTAI.

    Following this document, we can set up a real-time experimental platform to make the

    SPCA5xx-based webcam work(see the ppt) properly and get familiar with linux.

    Now, we choose Redhat 9.0 as the operation system, for which there are lots of reference

    materials. We also adopt VMWare 7.0 to make the process much easier and to encourage us to try

    whatever we want in this easy-recoverable system.

    Keywords

    RTAI, Redhat, Linux, VMWare, VMWare tools, kernel, patch, update, 2.4.20-8

  • Procedures

    In this part, we will learn to set up the system by 5 steps (click to jump to the part you care about

    in this document):

    1. Install VMWare 7.0;

    2. Install Redhat 9.0;

    3. Install VMWare tools for Redhat 9.0;

    4. Update Redhat from 2.4.20-8 to 2.4.27;

    5. Patch RTAI to the kernel.

    1. Install VMWare 7.0

    a). Purchase and download a copy of VMWare 7.0 from its official website, VMWare 7.0

    download, or get it from anywhere you can(You know what I mean. I wont mention this

    again for any other commercial software.).

    b). Open the install program, and you will see the graphic interface below

    Fig. 1 The starting interface for VMWare Setup

    c). Follow its instruction and use its default setting(You can specify where to install it, or what

    plugins to include with. These wont affect our further use).

  • 2. Install Redhat 9.0

    a). Download all three .iso files for Redhat 9.0 installation: shrike-i386-disc1.iso,

    shrike-i386-disc2.iso, shrike-i386-disc3.iso. P2P-based download tools, such as Thunder, are

    required to get them successfully.

    b). Open the VMWare Workstation and press ctrl + n to create a new virtual machine.

    c). Choose Custom(advanced) and continue.

    Fig. 2 The wizard interface for creating a new virtual machine in VMWare 7.0

    d). For Hardware compatibility, use the default Workstation 6.5-7.0.

  • e). Choose Installer disc image file (iso): and browse to locate your shrike-i386-disc1.iso.

    Fig. 3 Set the source for install Redhat 9.0

    f). For Guest operation system, select Linux; for Version, select Red Hat Linux

    g). Name your virtual machine and place it.

    Fig. 4 Name the virtual machine and place it

  • h). Choose the number of processors and cores according your computer.

    i). Allocate memory to the virtual machine according to your computer.

    Fig. 5 Memory for the virtual machine

    j). Keep clicking next to finish this wizard.

    k). Now we come to the same install interface of Redhat 9.0 as for a physical machine. Skip

    the CD test unless youd like to have a try.

    Fig. 6 Welcome interface for Redhat 9.0 installation

  • l).Wait for a while until the graphic interface appears. Then click next until you see the

    scene below. Dont change the types of mouse or keyboard even if they are different from

    your hardware as signals delivered to Redhat 9.0 are changed by VMWare. English is also

    preferred.

    Fig. 7 Choose installation type

    m). For Installation type, choose Custom so that we can specify the file system ourselves.

    n). For Disk partition setup, select Manually partition with Disk Druid. Then, click yes

    for the warning.

  • o). Click the free space and New a root partition as below.

    Fig. 8 Create a root partition

    p). Create a swap partition which will be us4ed for Linux as the virtual memory for Windows.

    This is not required, but it do speed up the system.

    Fig. 9 Create the swap partition

  • Now we can see the picture below.

    Fig. 10 Final partition situation

    q). Configure the system as you wish. Dont forget to choose Chinese support and some

    necessary development tools.

    r). Just drink a cup of tea, walk around for a while, or take a shower. Then youll see a

    window come up.

    Fig. 11 Change CD Hint Window

  • Then we change the .iso file by right click the virtual machine and left click setting on the

    bottom.

    Fig. 12 Go to the settings of virtual machine

    Change the .iso file by browsing and mark Connected.

    Fig. 13 Change the .iso file for installation

    s). Change .iso for another time when being asked to. Wait for several minutes, click several

    next, then you will have a bright new Redhat 9.0 installed in your VMWare 7.0!

  • 3. Install VMWare tools for Redhat 9.0

    After finish step 2, we get a fresh Redhat 9.0. The first time you open it, you will be asked to

    create a normal user account. Dont try to register it on internet as the register server has

    stopped for ages. Now, what we have is a operating system which cant communicate with

    host system , log on the internet, nor present high resolution. To solve these problems, we

    have to install VMWare tools.

    a). Log in the system as root. Click VMInstall VMWare Tools as below.

    Fig. 14 Start to install VMWare Tools

    b). Press ctrl + alt + F1(press F1 first and press alt + ctrl before releasing F1), and

    type commands as following.

    Fig. 15 Install VMWare Tools in commandline

  • c). Keep pressing enter to adopt the default settings and install the tools.

    d). Restart the virtual machine after VMWare tools are installed. Now, you can move your

    mouse from Redhat 9.0 to the host system directly without press ctrl + alt, or take files from

    Redhat 9.0 to the host system directly by drag and drop. Also, the internet becomes available,

    and the system owns a higher resolution.

    4. Update Redhat from 2.4.20-8 to 2.4.27

    Why do we need to update the kernel? It is because Redhat 9.0 modifies the kernel from

    standard 2.4.20 to its own 2.4.20-8 which does not support some standard-version-aimed

    programs, such as RTAI and the driver for SPCA5xx.

    a) Download the kernel 2.4.27 from www.kernel.org, which I use is linux-2.4.27.tar.bz2

    b) cp linux-2.4.27-tar.bz2 /usr/src

    c) tar jxvf linux-2.4.27.tar.bz2

    d) ln linux-2.4.27 linux -s

    e) cd linux

    f) make mrproper (not required for first time kernel compilation)

    g) cp /boot/config-2.4.20-8 .config (you may take a snapshot here or in the next step)

    h) make menuconfig

    i. This is the most important part. Be sure to build everything needed into the kernel,

    instead of compiling them as modules (If you cannot find some modules listed

    below, dont worry. Just read the configuration, select what you think is useful, and

    then save it and continue, as its easy to recover the system from snapshots taken

    before).

    ii. The modules included in original kernel of Redhat Linux 9.0 are:

    1. parport_pc

    2. lp

    3. parport

    4. autofs

    5. e100

    6. e1000

    7. ipt_REJECT

    8. iptable_filter

    9. ip_tables

    10. sg

    11. sr_mod

    12. microcode

    13. ide-scsi

    14. scsi_mod

    15. ide_cd

  • 16. cdrom

    17. keybdev

    18. mousedev

    19. hid

    20. input

    21. usb-uhci

    22. ehci-hcd

    23. usbcore

    24. ext3

    25. jbd

    i) make dep

    j) make clean

    k) make bzImage

    l) make modules

    m) make modules_install

    n) if you meet errors like No module BusLogic found for kernel 2.4.27, then do

    i)cp /usr/src/linux-2.4.27/drivers/scsi/BusLogic.o /lib/modules/2.4.27/kernel/drivers/scsi

    ii)make modules_install

    o) cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.27

    p) cp System.map /boot/System.map-2.4.27

    q) mkinitrd /boot/initrd-2.4.27.img 2.4.27

    r) cd /boot

    s) rm -f System.map vmlinuz

    t) ln -s System.map-2.4.27 System.map

    u) ln -s vmlinuz-2.4.27 vmlinuz

    v) vim /boot/grub/grub.conf (revise the file as below, i.e., add last four lines):

    default=0

    timeout=0

    splashimage=(hd0,0)/boot/grub/splash.xpm.gz

    password md5 $1$4xbn4JKI$q9haaCOWymqjQAvhUmFKp1

    title Red Hat Linux (2.4.20-8)

    root (hd0,0)

    kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi

    initrd /boot/initrd-2.4.20-8.img

    title Red Hat Linux (2.4.27+RTAI)

    root (hd0,0)

  • kernel /boot/ vmlinuz root=/dev/hda1

    initrd /boot/initrd-2.4.27.img

    w) Reboot the machine, at GRUB menu, select the Red Hat (2.4.27+RTAI). If the kernel is

    properly configured, the system could be normally booted.

    5. Patch RTAI to the kernel

    a) Download the RTAI 3.1 package from www.rtai.org, which is rtai-3.1.tar.bz2

    b) Assume we store this file rtai-3.1.tar.bz2 in /home/

    c) Extract files

    i. bzip2 d rtai-3.1.tar.bz2

    ii. tar xvf rtai-3.1.tar

    d) Patch Kernel 2.4.27 with RTAI patch 2.4.27

    i. cd /usr/src/linux

    ii. patch p1 < /home/rtai-3.1/rtai-core/arch/i386/patches/hal16-2.4.27.patch

    e) Rebuild the kernel with the 2.4.27 patch

    i. make menuconfig

    1. Be sure to disable Set version information on all module symbols

    2. Be sure to enable "Adeos support" on "General setup"

    3. Be sure to disable "Compile the kernel with frame pointers" on "Kernel

    hacking"

    ii. make dep

    iii. make clean

    iv. make bzImage

    v. make modules

    vi. make modules_install

    vii. mkinitrd /boot/initrd-2.4.27-adeos 2.4.27-adeos

    viii. cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage-2.4.27

    ix. cp /usr/src/linux/System.map /boot/System.map-2.4.27

    x. (Reboot the machine, and reinstall vmware-tools as you have updated the kernel)

    f) Configure the RTAI

    i. cd /home

    ii. mkdir rtai-install

    iii. cd rtai-install

    iv. make f /home/rtai-3.1/makefile srctree=/home/rtai-3.1/ menuconfig

    1. Try to exclude the Comedi support over LXRT in Add-ons

    2. Exclude the RTAI Lab and RTAI Simulator if you dont have those

    supporting files installed.

    3. Try to exclude the LTT supports and Watchdog support if you have such

    function built in the kernel.

  • g) Install RTAI-3.1

    i. cd /home/rtai-install

    ii. make install

    iii. Add the installation directory into the shell PATH variable:

    1. Revise the file /root/.bash_profile, add: PATH=$PATH:/usr/realtime/bin

    h) Test RTAI-3.1

    i. cd /usr/realtime/testuite/kern/latency

    ii. ./run (ctrl+c to stop the calibration)

    1. You can find the largest latency of our labs infrastructure computer is a little

    more than 3000ns (3x10-6

    s)

    Reference

    1. Xu, Kai, Robot Control System References_version 1.2, ARMA Lab, Columbia University,

    Sep, 2008.

    2. http://www.rtai.org/

    3. http://www.anqn.com/article/d/gjyy/2009-04-24/a09109370.shtml

    4. http://blog.csdn.net/huangsihua/archive/2009/04/14/4071664.aspx

    5. http://blog.csdn.net/wasid/archive/2005/08/03/445320.aspx

    Afterword

    This document is only for your interest to get aware of the process to build up a

    RTAI-patched Redhat 9.0 in VMWare Station 7.0. For your ease, you can get a copy of .vmdk file

    directly and import it into your VMWare Workstation. Then its done. Just have fun with it!