skyeye模拟s3c2410 linux下程序

来源:互联网 发布:读取网络考勤机数据 编辑:程序博客网 时间:2024/05/22 08:27

在前面的基础上,下面开始利用skyeye自带的testsuites中的资源来运行自己的程序的方法

 

1.首先是下载下载skyeye-1.2.5_REL.tar.gz,然后解压该文件

 

2.使用skyeye模拟板子s3c2410运行某个linux

首先进入解压完的目录,然后

cd ./linux/s3c2410/s3c2410x-2.6.14

skyeye –c skyeye.conf –e vmlinux

注意的是skyeye的版本问题,我是用的是skyeye-1.2.6的,其他版本可能不能够使用。

然后出现

 

Welcome to

   ......(arm linux)

ARMLinux for Skyeye 

 

 

3.编写hello.c

// hello.c for s3c2410c board

#include <stdio.h>

int main ()

{

int i;

 for(i=0; i<6; i++)

    printf(“This is my program!”);

return 0;

 

 

arm-linux-gcc -static -o hello hello.c

 

4.运行hello程序

首先确定一个目录,作为mount目录,我选择的是/home/xuqiang/root

执行下面的命令:

sudo mount –o loop initrd.img /home/xuqiang/root/

cp hello /home/xuqiang/root/bin

sudo umount /home/xuqiang/root/

 

skyeye -e vmlinux -c skyeye.conf

 

然后就是:

 

Welcome to

     _        _____      __   __    _      _

    / /      /  __ /    /  /_/  /  | |    |_|                 

   / _ /   | |  | |  / //   // / | |     _ ____  _   _  _  _ 

  / /_/ /  | |__| | / /  /_/  / /| |    | |  _ /| | | |/ // /

 / /___/ / | |__/ / | |       | || |___ | | |_| | |_| |/    /

/_/    /_/| |   /_/|_|       |_||_____||_|_| |_|/____|/_//_/

  

ARMLinux for Skyeye 

For further information please check:

http://www.skyeye.org/

 

 

上面需要注意的是版本的使用问题:skyeye 1.2.6 arm-linux-gcc 3.4.1

 

参考http://blog.chinaunix.net/u1/56374/showart_491186.htmlcankaoccankao

Skyeye-testsuite测试包的使用
如何交叉编译自己的程序并加入到已有的文件系统映像中?
1.交叉编译自己的应用程序
arm-elf-gcc -Wl,-elf2flt -o hello hello.c
2.解开已有文件系统映像文件
mkdir /mnt/romfs
mkdir romfs
mount -o loop romfs.img /mnt/romfs
cp -r /mnt/romfs/* romfs/
3.在解开的文件系统中加入交叉编译后的程序
cp hello romfs/bin/
4.重新生成文件系统映像
genromfs -f boot.img -d romfs/
这样就在当前目录中生成新的文件系统映像文件boot.img.

原创粉丝点击