|
Executables for ST40 Linux are built on the host, using gcc as a cross compiler. They then need to be made visible to the ST40, and the easiest way to do this is to simply place them within the part of the host PC's file system which has been NFS mounted by the ST40. Finally they are run like any other program from the target shell. In order to build programs to run on the ST40 Linux, you will first need to install some additional RPM's, if you have not already done so. You'll need: hhl-gcc hhl-binutils Refer back to the target installation section for a reminder how to do this. Next create your hello world source file:
#include <stdio.h>
void main(void)
{
printf("Hello from ST40 Linux\n");
}
and compile it using gcc: host% sh-linux-gnu-gcc -o hello hello.c Next copy the executable file to the NFS mounted file system: host% cp hello /opt/hardhat/devkit/sh/sh4/target/tmp/hello And finally run it from the shell prompt on the target: target% /tmp/hello Hello from ST40 Linux target% |
|||||||||||||||||||
|
||||||||||||||||||||