c helloworld on zynq

A linux os runs on zynq board. I want ro run a hello world c program on it.

I linked zynq board to a wifi router which my laptop also connected to and use scp command to transfer compiled files to board.

The linux os runing on zynq is reduced. its user and password is simple root and root.

helloworld.c

The content of helloworld.c is:

#include <stdio.h>

int main()
{
printf("Hello World\n");

return 0;
}

compile helloworld.c

when use universal arm gcc:
arm-linux-gnueabi-gcc helloworld.c -o helloworld_arm.out

when use xilinx arm gcc:
arm-xilinx-linux-gnueabi-gcc helloworld.c -o helloworld_xilinx.out

transfer file to board

scp *.out root@[ip address of zynq board]:~/

result

ssh root@[ip address of zynq board]

zynq> ./helloworld_arm.out
Hello World
zynq> ./helloworld_xilinx.out
Hello World

上一篇:C++ STL find


下一篇:检查DLL,EXE文件是64位或者32位的方法