
NA150 Series Network Appliance U
ser’s Manual
Software User Guide
23
3.6 Compile Sample Program
Add cross-compiler to the PATH
# export PATH=/opt/armv7-marvell-linux-gnueabi-
hard_i686_64K_Dev_20131002/bin:$PATH
Create a directory for sample program
# cd ~/Project/NA150
# mkdir sample
# cd sample
Use vi to edit hello.c
# vi hello.c
#include<stdio.h>
int main()
{
printf(“hello world\n”);
return 0;
}
Compile the sample program
# arm-marvell-linux-gnueabi-gcc hello.c
–o hello
After compili
ng, enter command “ls” and you can see the ‘hello’ execution file.
How to Put and Run a Sample Program Via USB Flash Drive
From the host
, copy ‘hello’ program to USB flash drive.
Attach USB flash drive to NA150.
# mkdir /mnt/usb
–p
# mount /dev/sda1 /mnt/usb
# cp /mnt/usb/hello /root
# cd /root
# chmod +x hello
# ./hello
Via TFTP
The Host Development System Installation already has a TFTP server installed.
In the host:
# cp hello /tftpboot
In the target:
# tftp
–g –r hello 192.168.0.3 (tftp server IP)
# chmod +x hello
#
Run the ‘hello’ program.
#./hello
Содержание NA150
Страница 1: ...NA150 Network Appliance User s Manual...
Страница 8: ...NA150 Series Network Appliance User s Manual Introduction 4 1 4 Dimensions and Outlines...
Страница 12: ...NA150 Series Network Appliance User s Manual 8 Hardware Description 2 3 Board Layout Component Side Solder Side...
Страница 22: ...NA150 Series Network Appliance User s Manual 18 Software User Guide To login please enter root with no password...
Страница 34: ...NA150 Series Network Appliance User s Manual Warning 30 This page is intentionally left blank...