随笔 - 60, 文章 - 0, 评论 - 197, 引用 - 0
数据加载中……

构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)

一 前言
  本文旨在将 arm-linux 在 skyeye 上搭建起来,并在 arm-linux 上能成功 mount
NFS 为目标, 最终我们能在 arm-linux 里运行我们自己的应用程序. 其实在 skyeye 上移
植 arm-linux 并非难事,网上也有不少资料, 只是大都遗漏细节, 以致细微之处卡壳,所以本
文力求详实清析, 希望能对大家有点用处。


二 安装 Skyeye
  我们选定 skyeye 的 1.2.4 这个版本, 为了能让它上面运行的 arm-linx 能挂接 NFS,我
们需要修改 device/net/dev_net_cs8900a.c (修改后的文件在附件里), 再编译 skyeye。
操作如下, 先解压源码包:
  #tar xzf skyeye-1.2.4_Rel.tar.gz
  #cd skyeye-1.2.4

请用附件里的 dev_net_cs8900a.c 替换 device/net/dev_net_cs8900a.c 后执行编译:
  #make NO_DBCT=1 NO_BFD=1

编译完后生成的 skyeye 在 binary 下,将其拷贝至 /usr/local/bin/ 下:
  #cp binary/skyeye /usr/local/bin


三 编译内核
  我们选定 linux-2.6.14.tar.bz2 这个版本, 交叉编译器用 arm-linux-gcc 3.4.1 (对
2.6 内核用 3.4 以下的版本编译经常会出现问题)。操作步骤如下:

1.假定内核源码包在 /root 下, 首先解压源码:
  #cd /root
  #tar xjf linux-2.6.14.tar.bz2

2.进入内核目录:
  #cd linux-2.6.14

  修改此目录下的 Makefile, 将
  ARCH          ?= $(SUBARCH)
  CROSS_COMPILE ?=
  改为
  ARCH          ?= arm
  CROSS_COMPILE ?= /usr/local/arm/3.4.1/bin/arm-linux-

3.生成默认的内核配置文件(for s3c2410):
  #make smdk2410_defconfig

4.为内核添加 cs8900(见附件) 网卡驱动,以支持 NFS 挂接:
  (1)复制 cs8900 驱动到 drivers/net/arm 目录
     #cp cs8900.c drivers/net/arm
     #cp cs8900.h drivers/net/arm

  (2)修改 drivers/net/arm 目录下的 Kconfig 文件, 在最后添加:
     config ARM_CS8900
        tristate "CS8900 support"
        depends on NET_ETHERNET && ARM && ARCH_SMDK2410
        help
          Support for CS8900A chipset based Ethernet cards. If you have a network
          (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available
          from as well as .To compile this driver as a module, choose M here and read.
          The module will be called cs8900.o.

     注:在运行 make menuconfig 命令时就会出现: [ ] CS8900 support 这一选项

  (3)修改 drivers/net/arm 目录下的Makefile文件,在最后添加如下内容:
     obj-$(CONFIG_ARM_CS8900) += cs8900.o

     注:2.6 版本内核的 Makefile 也与 2.4 的有所不同, 添加以上语句, 就会使内核在
     编译的时候根据配置将cs8900A的驱动程序以模块或静态的方式编译到内核当中。

  (4)修改 arch/arm/mach-s3c2410/mach-smdk2410.c
     在此文件中找到 smdk2410_iodesc[] 结构数组,添加如下如下内容:

     {vSMDK2410_ETH_IO,pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE}

     修改之后变成:

     static struct map_desc smdk2410_iodesc[] __initdata = {
     /* nothing here yet */
     /* Map the ethernet controller CS8900A */
     {vSMDK2410_ETH_IO,pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE}
     };

     并且添加一个头文件引用:
     #include <asm-arm/arch-s3c2410/smdk2410.h>

  (5)在 include/asm-arm/arch-s3c2410 目录下创建文件 smdk2410.h
     #ifndef _INCLUDE_SMDK2410_H_
     #define _INCLUDE_SMDK2410_H_

     #include <linux/config.h>
     #define pSMDK2410_ETH_IO 0x19000000
     #define vSMDK2410_ETH_IO 0xE0000000
     #define SMDK2410_ETH_IRQ IRQ_EINT9

     #endif

5.参照 http://skyeye.wiki.sourceforge.net/Linux 修改内核文件
  修改 include/asm-arm/arch-s3c2410/map.h
  #define S3C2410_CS6 (0x30000000UL)
  to
  #define S3C2410_CS6 (0xC0000000UL)

  修改 include/asm-arm/arch-s3c2410/memory.h
  #define PHYS_OFFSET (0x30000000UL)
  to
  #define PHYS_OFFSET (0xC0000000UL)

6.裁剪/定制内核
  (1)#make menuconfig
  (2)设置内核启动参数
     Boot options ---> Default kernel command string:
     mem=32M console=ttySAC0 root=/dev/ram initrd=0xc0800000,0x00800000 ramdisk_size=8192 rw
  (3)设置 CS8900 的支持
     Device Drivers --->
     Network device support --->
     Ethernet (10 or 100Mbit)  ---> []   CS8900 support
     选中 [*]   CS8900 support
  (4)设置 initrd 的支持
     Device Drivers ---> Block devices  ---> [ ] RAM disk support
     下面三项必须设置:
     1.确保 RAM disk support 被选中
     2.相应的将默认的 (4096) Default RAM disk size (kbytes) 改成 8192;
     3.Initial RAM disk (initrd) support 一定要选中, 切记!
  (5)设置 NFS 的支持
     File systems  ---> Network File Systems  --->
     至少确保下面两项被选中:
     [*] NFS file system support
     [*]   Provide NFSv3 client support
  (6)设置 ROM file system 的支持
     File systems  ---> [*] ROM file system support
     确保 [*] ROM file system support 被选中
  (7)设置 ext2 的支持
     File systems  ---> [*] Second extended fs support
     确保 [*] Second extended fs support 被选中

7.编译
  #make
  编译完成后会有个 vmlinux 在当前目录下, 这就是我们要的 arm-linux 内核了


四 制作根文件系统 initrd.img(Initial RAM disk)
  我们选定 busybox-1.9.2.tar.bz2 这个版本, 以静态方式编译, 即生成的 busybox 不需
要共享库的支持就能运行。这样做我们就不需要布署程序库了。缺点是自己写的 arm-linux 程序在
这个根文件系统中是不能运行的,因为缺少共享程序库的支持。不过别担心,我们会解决这个问题的,稍
后你将看到,通过在 arm-linux 里以挂接 NFS 的方式, 将宿主机的 arm-linux-gcc 编译器的
库文件挂到 arm-linux 的 /lib 下, 就可完美的运行我们自己的程序了。好,一步步来,先来看看
根文件系统的制作:

1.解压源码包
  #tar xjf busybox-1.9.2.tar.bz2
  #cd busybox-1.9.2
2.修改 Makefile, 将
  ARCH          ?= $(SUBARCH)                                                                                                                               
  CROSS_COMPILE ?= 
  改为
  ARCH          ?= arm                                                                                                                                      
  CROSS_COMPILE ?= /usr/local/arm/3.3.2/bin/arm-linux- 

  注:这个版本的 busybox 用 3.4.1 的 arm-linux-gcc 编译有些问题, 用 3.3.2 版则可顺利编译。
3.定制 busybox
  #make menuconfig

  设置静态编译方式
  Busybox Settings  ---> Build Options  ---> [*] Build BusyBox as a static binary (no shared libs)
  确保 [*] Build BusyBox as a static binary (no shared libs) 被选中
4.执行 make 编译
  #make

  编译出错, 信息如下:
  applets/applets.c:15:2: warning: #warning Static linking against glibc produces buggy executables
  applets/applets.c:16:2: warning: #warning (glibc does not cope well with ld --gc-sections).
  applets/applets.c:17:2: warning: #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
  applets/applets.c:18:2: warning: #warning Note that glibc is unsuitable for static linking anyway.
  applets/applets.c:19:2: warning: #warning If you still want to do it, remove -Wl,--gc-sections
  applets/applets.c:20:2: warning: #warning from scripts/trylink and remove this warning.
  applets/applets.c:21:2: error: #error Aborting compilation.
  make[1]: *** [applets/applets.o] Error 1

  按照提示,修改 scripts/trylink, 将此文件里面有 -Wl,--gc-sections 的行都删除掉,
  然后重新 make
  #make

  还是出错, 信息如下:
  root@hukq-desktop:~/busybox/busybox-1.9.2# make
  CC      applets/applets.o
  applets/applets.c:15:2: warning: #warning Static linking against glibc produces buggy executables
  applets/applets.c:16:2: warning: #warning (glibc does not cope well with ld --gc-sections).
  applets/applets.c:17:2: warning: #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
  applets/applets.c:18:2: warning: #warning Note that glibc is unsuitable for static linking anyway.
  applets/applets.c:19:2: warning: #warning If you still want to do it, remove -Wl,--gc-sections
  applets/applets.c:20:2: warning: #warning from scripts/trylink and remove this warning.
  applets/applets.c:21:2: error: #error Aborting compilation.
  make[1]: *** [applets/applets.o] Error 1
  make: *** [applets] Error 2

  修改文件 applets/applets.c 第 21 行, 将
  #error Aborting compilation.
  注释掉:
  /*#error Aborting compilation.*/

  执行 make 重新编译
  #make

  编译通过, busybox 被生成了, 然后执行
  #make install

  busybox 就被安装到默认的临时目录 _install 下了
5.制作 initrd.img
  有了 busybox 后制作 initrd.img 就容易多了,只是说起来比较烦琐。以命令演示如下:

  创建映像文件并挂到 initrd 目录
  #mkdir initrd
  #dd if=/dev/zero of=initrd.img bs=1k count=4096
  #mke2fs -F -v initrd.img
  #mount -o loop initrd.img initrd

  将添加 busybox 到此映像文件
  #cd initrd
  #cp -r ../_install/* .

  #创建必要的目录
  #mkdir proc lib etc dev root home var tmp
  #chmod 777 tmp

  建立设备文件
  #cd dev
  #mknod -m 644 console c 5 1
  #mknod -m 644 null c 1 3
  #mknod -m 640 ram b 1 1
  #mknod -m 644 mem c 1 1
  #cd ..

  创建脚本文件 etc/inittab, 内容如下:
  ::sysinit:/etc/init.d/rcS
  ::askfirst:-/bin/sh
  ::restart:/sbin/init
  ::ctrlaltdel:/sbin/reboot
  ::shutdown:/bin/umount -a -r
  ::shutdown:/sbin/swapoff -a

  设置此脚本执行权限
  #chmod 644 etc/inittab

  创建脚本文件 etc/init.d/rcS, 内容如下:
  #!/bin/sh
  /bin/mount -t proc none /proc
  /sbin/ifconfig lo 127.0.0.1 up
  /sbin/ifconfig eth0 10.0.0.2 netmask 255.0.0.0 up
  hostname skyeye
  mkdir /var/tmp
  mkdir /var/log
  mkdir /var/run
  mkdir /var/lock
  /bin/ash

  设置此脚本执行权限
  #chmod 755 etc/init.d/rcS
 
  最后一步,执行实际的写入操作,生成 initrd.img
  cd ..
  umount initrd


五 运行 arm-linux
  现在我们有了内核 vmlinux, 映像文件 initrd.img, 模拟程序 skyeye, 我们还需要一个
  配置文件 skyeye.conf 进行 arm-linux 的仿真运行。

  #mkdir /root/test
  #cd /root/test

  将 vmlinux, initrd.img 都拷贝到此目录, 在此目录下建立一个 skyeye 的配制文件
  skyeye.conf, 文件内容如下:
  cpu: arm920t
  mach: s3c2410x

  # physical memory
  mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00800000
  mem_bank: map=M, type=RW, addr=0xc0800000, size=0x00800000, file=./initrd.img
  mem_bank: map=M, type=RW, addr=0xc1000000, size=0x01000000

  # all peripherals I/O mapping area
  mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000

  mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
  net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1

  lcd: type=s3c2410x, mod=gtk
  #dbct:state=on


  好了,试运行吧:
  skyeye -e vmlinux

  看到你的 arm-linux 运行了吗 :-)

 
六 在 arm-linux 里运行我们自己的程序
  现在 arm-linux 在 skyeye 上跑起来了, 我们能运行里面的命令, 但这些都是 busybox
的,是系统程序。怎样才能在 arm-linux 里运行我们自己的程序呢? 有两种方案,我们不妨讨论一
下,择优而录之:

1.在制作根文件系统 initrd.img 的时候把我们自己的程序加进去,比如放在 /usr/bin 里
  目录下,然后重新生成 initrd.img,并用这个新的根文件系统来运行 arm-linux。其实这
  是我们的产品在 arm-linux 上发布的最终方式,但这有个缺点: 在产品开发/调试阶段这么
  做比较麻烦,每修改一次代码就得 build 一次根文件系统。

2.利用挂接 NFS(Network file system) 的方式,我们访问/执行一个网络文件系统上的文件
  就像它在本地一样,显然这么做能避免第一种方案的弊端! 如何实现呢? 随我来:

  (1)在 arm-linux 的宿主机里配置 NFS Server (我用是 ubuntu,而且是在 vmware 里)
     #apt-get install nfs-kernel-server
     #apt-get install nfs-common
  (2)编辑文件 /etc/exports, 内容如下(具体需求由你而定):
     /test                          *(rw,sync,no_root_squash)
     /usr/local/arm/3.3.2/lib       *(ro,sync,no_root_squash)    
  (3)配置宿主机的 ip
     #ifconfig eth1 down
     #ifconfig eth1 10.0.0.1 netmask 255.0.0.0 up
     注:你的可能是 eth0, 另外 ip 地址你也可自己定义,只要能和 arm-liux 通信
  (4)重启 nfs server
     #/usr/sbin/exportfs -r
     #/etc/init.d/nfs-kernel-server restart
     #/etc/init.d/portmap restart
     注:可用 showmount -e 来验证你的配置是否成功
  (5)在 skyeye 运行 arm-linux,为其配置 ip
     #ifconfig lo down
     #ifconfig eth0 down   
     #ifconfig lo 127.0.0.1 up
     #ifconfig eth0 10.0.0.2 netmask 255.0.0.0 up
     注:可将这几个命令加到 rcS 脚本里,让 arm-linux 启动时帮你做
  (6)在 skyeye 上运行 arm-linux,演示 nfs 挂接
     #mount -o nolock 10.0.0.1:/usr/local/arm/3.3.2/lib /lib
     #export LD_LIBRARY_PATH=/lib   
     #mount -o nolock 10.0.0.1:/test /tmp

     在宿主机的 /test 下建立文件 hello.c,用 arm-linux-gcc 3.3.2 编译
     #cd /test
     #arm-linux-gcc -o hello hello.c

     在 arm-linux 的 /tmp 下看看,是不是有 hello.c 和 hello 这两个文件了? 试着运行看看:
     #cd /tmp
     #./hello

注:为了确认 arm-linux 能和宿主机通信, 可尝试以下手段:
(1)在宿主机上 ping 你的 arm-linux
   #ping 10.0.0.2 -c 2
(2)在 arm-linux 里 ping 你的宿主机
   #ping 10.0.0.1 -c 2
(3)如果相互都 ping 不通过,可这样做:
   重新设置一下 arm-linux 的网络:
   #ifconfig eth0 down
   #ifconfig eth0 up

   再重新设置一下宿主机的网络:
   #ifconfig eth1 down
   #ifconfig eth1 up

   然后再像上一步那样,相互 ping 对方,直至 ping 通为止。能说的就这么多了,祝你好运!



附件内容(可下载)

posted on 2008-04-17 11:53 Normandy 阅读(12266) 评论(32)  编辑 收藏 引用 所属分类: Embeded Area

评论

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

慢慢看, 先给顶一下再说.
2008-04-17 13:24 | samsun

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)[未登录]  回复  更多评论   

好东西呀!感谢楼主贡献出来与大家共享!
2008-04-17 14:38 | kyle

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

CROSS_COMPILE ?= arm-linux-

介个之前要export或者改成完整的路径呀。

:) 感觉和俺之前摸索的方法差不多。帮顶了。
2008-04-17 15:01 | 菌子

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)[未登录]  回复  更多评论   

模拟只是玩具,有时间还不如多读读内核
2008-04-17 15:08 | 补考少年

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

@补考少年
模拟正是为了实践,这样修改了内核可以在 skyeye 上跑跑, 省得老烧板子了
2008-04-17 15:39 | Normandy

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

用skyeye比烧板子确实快得多。挺好的一个东西。
2008-04-18 08:23 | 菌子

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)[未登录]  回复  更多评论   

先说声谢谢,按照你的文档做下来,基本上成功了,不过还是有些小问题,好像网络有问题,运行的时候网络启动不了

错误如:ifconfig: SIOCSIFADDR: No such device

运行ifconfig查看,只有lo,没有eth0网络设备打印信息,不知道大虾有没有遇到过这种问题,还请指点

# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
2008-04-20 23:40 | silence

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

@silence
我的成功了。可能网卡驱动没有加载,请用如下命令确认一下: dmesg | grep -i 'eth'
看看有没有 eth0 或 cs8900 之类的字消息,有的话,请重新在 skyeye 上运行 arm-linux。如果没有,那就考虑一下如何加载 cs8900 这个网卡驱动。
2008-04-21 10:43 | Normandy

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   


io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
eth0: CS8900A rev D at 0xe0000300 irq=53, no eeprom , addr: 08: 0:3E:26:0A:5B
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 4096KiB [1 disk] into ram disk... done.
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 92K
2008-05-18 00:25 | guest

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   


io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
eth0: CS8900A rev D at 0xe0000300 irq=53, no eeprom , addr: 08: 0:3E:26:0A:5B
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 4096KiB [1 disk] into ram disk... done.
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 92K


然后就不动了。。。。。。
2008-05-18 00:26 | guest

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

@guest
从上面看不出哪出错了,你的用 skyeye 和 linux 内核版本是多少? 内核如何配置的?
2008-05-19 09:35 | Normandy

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

再回去看Kconfig的配置,cs8900是否选上了
Device Drivers --->
Network device support --->
Ethernet (10 or 100Mbit) ---> [] CS8900 support
选中 [*] CS8900 support
2008-05-24 10:43 | 路人甲

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

除了交叉编译的版本不一样外,其他的,例如内核版本,skyeye版本,busybox版本等,都和这篇文章的一样。谢谢
2008-05-24 11:46 | guest

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

CS8900 support

是已选的
2008-05-24 12:02 | guest

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

@guest
可能是 "Initial RAM disk (initrd) support" 没有选中,所以根文件系统没能成功加载。检查一下你的内核配置,看看在我这篇博客里用黄色加亮的部分是否被正确配置。或者把你的内核配置文件 .config 发我看看(jbin8164@gmail.com)。
2008-05-26 10:12 | Normandy

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

Normandy:config文件已经发送到您的邮箱,请帮忙查看一下,谢谢!
2008-05-26 23:12 | guest

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

@guest
看了, 内核配置应该没有问题, 可能是根文件系统的问题, 你用 busybox 制作的根文件系统有多大? 你先用 skyeye testsuite 里的根文件系统试试, 看能否启动?
2008-05-28 11:53 | Normandy

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

我在制作根文件系统的时候出现错误

make menuconfig时出现以下错误

/root/busybox-1.9.2/scripts/gcc-version.sh: line 1: /usr/local/arm/3.3.2/bin/arm-linux-: 没有那个文件或目录

请问下这个是什么问题,搞了半天没搞定

前面的配置都按照你的文章来的,没出现问题,就是make menuconfig出问题

版本跟你的一样
2008-07-12 13:39 | 宗华

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

@宗华
编译 busybox 1.9.2 需要 arm linux 3.3.2 的编译器, 用 3.3.4 的编译器会有问题, 你需要安装 3.3.2 版本来制作根文件系统
2008-07-14 11:04 | Normandy

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

我用busybox 1.9.2一直出现问题,不管是用3.4.1还是3.3.2 都一样

后来我尝试了很多版本,最后用1.9.1和arm-linux-gcc 3.4.1 成功了

谢谢楼主
2008-07-14 20:18 | 宗华

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

有个问题
(5)在 include/asm-arm/arch-s3c2410 目录下创建文件 smdk2410.h
.....
#inlcue <linux/config.h>

为什么 我们config.h这个文件 2.6.20内核是不是低版本才有这个?
2008-12-02 15:12 | armlinux

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

编译内核时候出现一下错误:
arch/arm/mm/alignment.c: In function 'proc_alignment_write':
arch/arm/mm/alignment.c:119: error: read-only variable '__r2' used as 'asm' output
arch/arm/mm/alignment.c:119: error: read-only variable '__r2' used as 'asm' output
arch/arm/mm/alignment.c:119: error: read-only variable '__r2' used as 'asm' output
arch/arm/mm/alignment.c:119: error: read-only variable '__r2' used as 'asm' output
make[1]: *** [arch/arm/mm/alignment.o] 错误 1
make: *** [arch/arm/mm] 错误 2

看看什么问题哦
2009-01-16 11:10 | rainbowbirds

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

[root@ARMLinux arm_test]# skyeye -e vmlinux
big_endian is false.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x805faf0
ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.2
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
Loaded RAM ./initrd.img
start addr is set to 0xc0008000 by exec file.

那位大哥帮我解决一下咯 谢谢!
2009-03-13 22:19 | ooooo

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)[未登录]  回复  更多评论   

我遇到以下错误...
ERROR: s3c2410x_io_write_word(0x19000308)

===============
fb0: Virtual frame buffer device, using 1024K of video memory
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
ERROR: s3c2410x_io_write_word(0x19000308) = 0x00000000
eth0: incorrect signature 0xffff
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
RAMDISK: ext2 filesystem found at block 0
==========

那位大哥帮我解决一下咯 谢谢!
2009-03-22 15:07 | Alex

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)[未登录]  回复  更多评论   

我試了在2.6.21 安裝CS8900, 失敗了,有沒有方法可以在2.6.21 里用NETWORK? rtl8019 和CS8900 也失敗,TUN 也不可,什麼辦法才能用到SKYEYE的NETWORK呢?

那位大哥帮我解决一下咯 谢谢!
2009-03-25 00:44 | Alex

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

Loaded RAM ./initrd.img
start addr is set to 0xc0008000 by exec file.


这个我是用高版本的skyeye解决的
我的是1.2.6,直接编译skyeye就可以了不用修改源码

我移植了linux 2.6.25 CS8900
主机能ping通宿主机 ,但宿主机不能ping通主机。。。。。。
2009-04-29 09:50 | rootkit

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

freeing init memory:92K
Kernel panic - not syncing:No init found. Try passing init= option to Kernel

就掛掉了

請問各問大大這是哪裡出錯了?

請救救我吧
2009-06-03 21:02 | iolcst

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

感谢大虾的倾心相告,向你学习认真的精神。
2009-09-28 10:14 | joel

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

@guest
ram_disk我想变为16m,是不是修改下面三个部分
1.(mem=32M console=ttySAC0 root=/dev/ram initrd=0xc0800000,0x00800000 ramdisk_size=8192 rw) Default kernel command string,里面的ramdisk_size=16384
2.(16384) Default RAM disk size (kbytes) 改为16384
3.dd if=/dev/zero of=initrd.img bs=1k count=16384
可是我启动arm-linux时报错:
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
改怎么样解决?
2009-11-10 13:40 | wangjl

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

@wangjl
解决了
1.修改内核参数
#cd /home/linux-2.6.14
#make menuconfig
(1)修改内核的启动参数
Boot options ---> Default kernel command string:
mem=64M console=ttySAC0 root=/dev/ram initrd=0xc0800000,0x01000000 ramdisk_size=16384 rw
注:
这里的地址0x01000000刚好是16384K=16M,mem=64M不应该设置为32m,因为32m为内核+文件系统的总内存
(2)设置 initrd 的支持
Device Drivers ---> Block devices ---> [ ] RAM disk support
相应的将默认的 (4096) Default RAM disk size (kbytes) 改成 16384;
2.生成16M的文件系统
#cd /home/busybox-1.9.2
#dd if=/dev/zero of=initrd.img bs=1M count=16
3.修改skyeye.conf配置文件
修改为:
cpu: arm920t
mach: s3c2410x

# physical memory
mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00800000
mem_bank: map=M, type=RW, addr=0xc0800000, size=0x01000000, file=./initrd.img
mem_bank: map=M, type=RW, addr=0xc1800000, size=0x02800000

# all peripherals I/O mapping area
mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000

mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1, state=on
lcd: type=s3c2410x, mod=gtk
#dbct:state=on
注:
0xc0000000+0x00800000=0xc0800000
0x01000000=16M
0xc0800000+0x01000000=0xc1800000
0x00800000+0x01000000+0x02800000=64M
2009-11-10 15:33 | wangjl

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)  回复  更多评论   

你好,我是按照楼主的方法一步一步做的,但是当我启动arm-linux时报错:
在Skyeyearm-linux时,出现错误:

Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to kernel.

这该怎么样解决?
2009-11-30 22:49 | yanglibin1000

# re: 构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)[未登录]  回复  更多评论   

请问楼主,你的skyeye.conf中mem_bank的地址及大小是根据什么配置的?
2010-08-06 15:30 | 1

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理