Setting Up the Build/Development Environment
4.4Setting Up the Build/Development Environment
To set up the development and build environment, follow these steps:
1)Log in to your user account (and not as root) on the NFS host system.
2)Set your PATH so that the MontaVista tool chain host tools and cross compiler
PATH="/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin: /opt/mv_pro_5.0/montavista/pro/bin:
/opt/mv_pro_5.0/montavista/common/bin:$PATH"
If you installed in a location other than /opt/mv_pro_5.0, use your own location in the PATH.
3)Remember to use the following command after modifying your
.bashrc file:
host $ source ~/.bashrc
4.4.1Writing a Simple Program and Running it on the EVM
Make sure you have performed the steps in Section 4.3.4, Exporting a
Shared File System for Target Access and Section 4.4, Setting Up the
Build/Development Environment.
Perform the following steps on the NFS host system as user (not as root):
1)host $ mkdir /home/<useracct>/workdir/filesys/opt/hello
2)host $ cd /home/<useracct>/workdir/filesys/opt/hello
3)Create a file called hello.c with the following contents:
#include <stdio.h>
int main() { printf("Buongiorno DaVinci!\n"); return 0;
}
4)host $
Perform the following steps on the target board. You may use either the target's console window (Section 2.2) or a telnet session.
1)target $ cd /opt/hello
2)Run ./hello. The output should be:
Buongiorno DaVinci!