skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器...

25
Skyeye 中中中中中中

Post on 22-Dec-2015

429 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

Skyeye 中运行操作系统

Page 2: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

建立编译环境•下载 3.4的交叉编译器–arm-linux-gcc-3.4.1.tar.bz2

•配置环境 :为了避免重起 shell后,环境变量变化,修改 .bashrc文件。

• Vi .bashrc• Export PATH=$PATH:…/3.4.1/bin

注:省略号为解压缩编译器的绝对路径•判断安装是否成功

Page 3: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

建立编译环境

Page 4: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

安装 skyeye

• skyeye-1.2.5_rc1.tar.bz2

•解压缩 1.2.5后,并安装./configuremakesudo make install

Page 5: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量
Page 6: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

安装 skyeye-testsuits

•最新的 skyeye-testsuits,版本为1.2.5– skyeye-testsuite-1.2.5.tar.bz2–解压缩

Page 7: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

使用 skyeye模拟某个板子运行某个 Linux

•进入 linux/skyeye-testsuite-1.2.5/linux/s3c2410/cs8900a

•注:也可以选择其他型号

•输入系统的命令: • skyeye -c skyeye.conf -e vmlinux

• 后,可看到如下的图:

Page 8: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

使用 skyeye模拟某个板子运行某个 Linux

Page 9: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

在 Linux的根文件系统中添加hello

•编写 hello程序 :• #include <stdio.h>• Void main()• {• Printf (“hello embedded!”);• }

•使用命令编译:• arm-linux-gcc –static –o hello hello.c

Page 10: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

在 Linux的根文件系统中添加hello

•将 linux的根文件系统映像 initrd.img加载到某个目录下,由于刚才模拟了 8900a,则现在把 8900a根目录下面的 initrd.img 加载到我们建立的目录下,建立如下目录:

• [root@BC /]mkdir root进入到 8900a的目录,然后输入命令:

• sudo mount –o loop initrd.img /root

•将 hello拷贝到根文件系统中sudo cp hello root/bin

• sudo umount root

Page 11: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

在 Linux的根文件系统中添加hello

•进入到 8900a的目录,然后输入命令:• skyeye -c skyeye.conf -e vmlinux

• cd bin• ./hello•可以看到输出结果: hello embedded!

Page 12: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行• 进入用户主目录,修改安装文件,为其添加可执行属性,然后执行之:

• chmod a+x arm-elf-tools-20030314.sh

• ./arm-elf-tools-20030314.sh

Page 13: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行

Page 14: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

arm-elf-gcc -Wl,-elf2flt -o hello hello.c

Page 15: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行•将 uclinux 解压缩 tar xjvf uClinux-dist-20070130.tar.bz2•之后进入• cd uClinux-dist

• make menuconfig

Page 16: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行•在 make menuconfig 中,•选择 Vendor 为 GDB• Product 为 ARMulator•内核版本要选 Linux-2.4.x

Page 17: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行•如果 make menuconfig 成功,那么接下来执行关联编译

• make dep• 最后就是编译内核了:• make

Page 18: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行

Page 19: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

• /usr/src/uClinux-dist/images/下是否有文件 romfs.img,如果有,表示编译安装成功。

uClinux 在 skyeye 中运行

Page 20: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行

Page 21: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行

Page 22: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行

Page 23: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行

Page 24: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行

执行命令: skyeye -e linux-2.4.x/linux

Page 25: Skyeye 中运行操作系统. 建立编译环境 下载 3.4 的交叉编译器 –arm-linux-gcc-3.4.1.tar.bz2arm-linux-gcc-3.4.1.tar.bz2 配置环境 : 为了避免重起 shell 后,环境变量

uClinux 在 skyeye 中运行