LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: 聚焦深空

找到一新玩具 sbox2

[复制链接]
 楼主| 发表于 2009-3-13 13:21:44 | 显示全部楼层
上面问题已解决,居然是低级的路径问题。:yun:
等有时间总结一下。

注意下面 host 的 /bin/uname /usr/bin/gcc 已经被 sbox2 映射到 target。
  1. $ sbox2 [color="Green"]/bin/uname[/color] -a
  2. Linux localhost 2.6.28.7 #1 SMP Thu Mar 5 00:36:51 CST 2009 [color="Red"]arm[/color] GNU/Linux
  3. $
  4. $ sbox2 /arm-linux-gnu/rootfs/bin/uname -a
  5. Linux localhost 2.6.28.7 #1 SMP Thu Mar 5 00:36:51 CST 2009 [color="Red"]armv5tel[/color] GNU/Linux
  6. $
  7. $ sbox2 [color="Green"]/usr/bin/gcc[/color] -v
  8. Using built-in specs.
  9. Reading specs from /usr/share/scratchbox2/modeconf/gcc-specs.devel
  10. rename spec cpp to old_cpp
  11. Target: [color="Red"]arm-unknown-linux-gnu[/color]
  12. Configured with: /arm-linux-gnu/source/gcc-4.3.3/configure --prefix=/arm-linux-gnu/tools --build=i686-cross-linux-gnu --host=i686-cross-linux-gnu --target=arm-unknown-linux-gnu --with-sysroot=/arm-linux-gnu/rootfs --disable-nls --enable-shared --enable-languages=c,c++ --enable-__cxa_atexit --enable-c99 --enable-long-long --enable-threads=posix --disable-multilib
  13. Thread model: posix
  14. gcc version 4.3.3 (GCC)
复制代码

据近两周的经验,sbox2 与其前辈 scratchbox 工作原理并不相同,sbox2 的工作是已"路径重映射(path remap)"为基础,相对更高阶一些,限制也更少。

http://maemo-sdk.garage.maemo.org/user-guide.html 中有一段描述相当精到
1.3 Cross-compilation Universe

In the Scratchbox 2 cross-compilation universe system calls related to file system access are remapped so that build tools are taken from a specific build environment, libraries, header files, aclocal files etc. are taken from a target rootstrap, and source code to be compiled are taken as is, from the host.

By remapping file access we mean modifing the actual file path of the original call. For example, if we have a file execution access /usr/bin/bison it is converted to /opt/maemo/dists/etch/usr/bin/bison before the launch happens (all build tools are taken from a build tool distribution). Another example could be an access to library /usr/lib/libc.a which is converted to ~/.maemo-sdk/rootstraps/armel/diablo4.1.2_armel/usr/lib/libc.a (taken from Diablo rootstrap). The actual remapping rules of the cross-compilation universe can be read from /usr/share/scratchbox2/lua_scripts/pathmaps/devel/00_default.lua if you have Scratchbox 2 installed.

Since the cross-compilation universe does not map one to one to the target environment the target packages should not be installed or run in there. A separate execution universe is provided which is similar to the target device environment.
回复 支持 反对

使用道具 举报

发表于 2009-3-14 09:10:01 | 显示全部楼层
深空兄屡败屡战,不停探索,精神上支持你 :cool:
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-15 11:47:34 | 显示全部楼层
刚刚配置一个可以在 qemu-system-arm 下运行的 内核,现在 临时系统 已经可以正常启动。

qemu-system-arm 支持的硬件组合:
http://www.nongnu.org/qemu/qemu-doc.html#SEC65
arm 官方资料:
http://www.arm.com/products/CPUs/ARM926EJ-S.html
http://www.arm.com/products/DevTools/VersatileFamily.html
arm 架构:
http://en.wikipedia.org/wiki/ARM_architecture

qemu arm 内核配置指南:
http://linux.onarm.com/index.php ... mu_and_the_platform
Configure the kernel:

make ARCH=arm defconfig

Check to have the following options enabled in the configuration file:

CONFIG_PCI=y
CONFIG_PCI_SYSCALL=y
CONFIG_AEABI=y
CONFIG_OABI_COMPAT=y
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_SYM53C8XX_2=y
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
CONFIG_SCSI_SYM53C8XX_MMIO=y
CONFIG_INPUT_EVDEV=y
CONFIG_INOTIFY=y

偶是这样做的,先能运行再说:
make ARCH=arm versatile_defconfig
make ARCH=arm menuconfig

顺序添加
pci 支持
scsi 硬盘支持
scsi 驱动
framebufer 字体、logo
文件系统 ext3、tmpfs、sysfs
忘了选 inotify 支持

中文资料:
http://www.realview.com.cn/shopp ... 0%E8%A1%8CLinux.pdf
http://www.handheld.eetchina.com ... df?SOURCES=DOWNLOAD

moto e2 PXA27x 属于 ARMv5TE,选 qemu 模拟的 ARM Versatile baseboard 相对简单些,支持硬盘、光驱,qemu 默认支持的 ARM Integrator/CP board 却没有这些,没装 nfs server 暂时不想玩无盘站。

用下面参数可启动虚拟机
  1. qemu-system-arm -M versatileab -hda xxx -kernel xxx -append "root=/dev/xxx"
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表