Chinaunix首页 | 论坛 | 博客
  • 博客访问: 135543
  • 博文数量: 30
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 550
  • 用 户 组: 普通用户
  • 注册时间: 2013-09-08 20:28
个人简介

永远不要放弃学习,放弃学习就是放弃了勇敢生活下去的动力!

文章分类

全部博文(30)

文章存档

2014年(30)

我的朋友

分类: 嵌入式

2014-03-14 15:57:25

安装:

点击(此处)折叠或打开

  1. (1)利用张同光老师提供的工具包

  2. (2)解压arm-linux-gcc-2.95.3.tar.bz2到/usr/local/arm/中
  3. # tar -tvf arm-linux-gcc-2.95.3.tar.bz2
  4. # tar -xjvf arm-linux-gcc-2.95.3.tar.bz2 -C /usr/local/arm/
  5. (3)解压arm-linux-gcc-3.4.1.tar.bz2到/usr/local/arm/中
  6. # tar -tvf arm-linux-gcc-3.4.1.tar.bz2
  7. # tar -xjvf arm-linux-gcc-3.4.1.tar.bz2 -C /
  8. (4)解压arm-linux-tools-20070808.tar.gz(4.2.1版本)
  9. # tar -tvf arm-linux-tools-20070808.tar.gz
  10. # tar -xzvf arm-linux-tools-20070808.tar.gz -C /
  11. 至此,arm-linux-*交叉编译工具链安装成功。

 验证:

点击(此处)折叠或打开

  1. [root@localhost 2]# ll /usr/local/bin/
  2. 总用量 7620
  3. -rwxr-xr-x. 1 root root 391424 8月 8 2007 arm-linux-addr2line
  4. -rwxr-xr-x. 1 root root 1022 8月 3 2007 arm-linux-addr2name.awk
  5. -rwxr-xr-x. 2 root root 362832 8月 8 2007 arm-linux-ar
  6. -rwxr-xr-x. 2 root root 627652 8月 8 2007 arm-linux-as
  7. -rwxr-xr-x. 2 root root 178660 8月 8 2007 arm-linux-c++
  8. -rwxr-xr-x. 1 root root 387488 8月 8 2007 arm-linux-c++filt
  9. -rwxr-xr-x. 1 root root 177956 8月 8 2007 arm-linux-cpp
  10. -rwxr-xr-x. 1 root root 341500 8月 8 2007 arm-linux-elf2flt
  11. -rwxr-xr-x. 1 root root 10064 8月 8 2007 arm-linux-flthdr
  12. -rwxr-xr-x. 2 root root 178660 8月 8 2007 arm-linux-g++
  13. -rwxr-xr-x. 2 root root 176612 8月 8 2007 arm-linux-gcc
  14. -rwxr-xr-x. 2 root root 176612 8月 8 2007 arm-linux-gcc-4.2.1
  15. -rwxr-xr-x. 1 root root 15994 8月 3 2007 arm-linux-gccbug
  16. -rwxr-xr-x. 1 root root 181796 8月 8 2007 arm-linux-gcj
  17. -rwxr-xr-x. 1 root root 77056 8月 8 2007 arm-linux-gcjh
  18. -rwxr-xr-x. 1 root root 22788 8月 8 2007 arm-linux-gcov
  19. -rwxr-xr-x. 1 root root 179780 8月 8 2007 arm-linux-gfortran
  20. -rwxr-xr-x. 1 root root 77060 8月 8 2007 arm-linux-gjnih
  21. -rwxr-xr-x. 1 root root 94764 8月 8 2007 arm-linux-jcf-dump
  22. -rwxr-xr-x. 1 root root 68004 8月 8 2007 arm-linux-jv-scan
  23. -rwxr-xr-x. 1 root root 5467 8月 7 2007 arm-linux-ld
  24. -rwxr-xr-x. 2 root root 643200 8月 8 2007 arm-linux-ld.real
  25. -rwxr-xr-x. 2 root root 399968 8月 8 2007 arm-linux-nm
  26. -rwxr-xr-x. 1 root root 525388 8月 8 2007 arm-linux-objcopy
  27. -rwxr-xr-x. 2 root root 612048 8月 8 2007 arm-linux-objdump
  28. -rwxr-xr-x. 2 root root 362832 8月 8 2007 arm-linux-ranlib
  29. -rwxr-xr-x. 1 root root 214064 8月 8 2007 arm-linux-readelf
  30. -rwxr-xr-x. 1 root root 346180 8月 8 2007 arm-linux-size
  31. -rwxr-xr-x. 1 root root 346132 8月 8 2007 arm-linux-strings
  32. -rwxr-xr-x. 2 root root 525388 8月 8 2007 arm-linux-strip
  33. -rwxr-xr-x. 1 root root 27126 5月 20 2003 genext2fs

这样交叉编译环境就编译好了,下面我们来安装&QEMU、GDB,直接上我的过程。

点击(此处)折叠或打开

  1. login as: root
  2. root@192.168.0.253's password:
  3. Last login: Thu Mar 13 18:58:45 2014 from 192.168.0.12
  4. [root@localhost ~]# wget *
  5. 警告:HTTP 不支持通配符。
  6. --2014-03-14 14:10:57-- *
  7. 正在解析主机 wiki.qumu-project.org... 失败:未知的名称或服务。
  8. wget: 无法解析主机地址 “wiki.qumu-project.org”
  9. 去官网看看怎样下载qemu的
  10. [root@localhost ~]# git clone git://git.qemu-project.org/qemu.git
  11. Initialized empty Git repository in /root/qemu/.git/
  12. remote: Counting objects: 183101, done.
  13. remote: Compressing objects: 100% (38858/38858), done.
  14. remote: Total 183101 (delta 146313), reused 179677 (delta 143686)
  15. Receiving objects: 100% (183101/183101), 59.84 MiB | 273 KiB/s, done.
  16. Resolving deltas: 100% (146313/146313), done.
  17. [root@localhost ~]# ls
  18. add.c EIOffice install.log.syslog tmp 视频 下载
  19. add.c~ eioXpacklog.txt qemu 公共的 图片 音乐
  20. anaconda-ks.cfg install.log s.c 模板 文档 桌面
  21. [root@localhost ~]# cd qemu/
  22. [root@localhost qemu]# ./configure --target-list=arm-softmmu,arm-linux-user //后面的参数就是把qemu配置成支持arm的

  23. ERROR: DTC (libfdt) not present. Your options:
  24.          (1) Preferred: Install the DTC (libfdt) devel package
  25.          (2) Fetch the DTC submodule, using:
  26.              git submodule update --init dtc

  27. 提示错误,但是给出你解决方法

  28. [root@localhost qemu]# git submodule update --init dtc
  29. Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
  30. Initialized empty Git repository in /root/qemu/dtc/.git/
  31. remote: Counting objects: 2778, done.
  32. remote: Compressing objects: 100% (1692/1692), done.
  33. remote: Total 2778 (delta 2057), reused 1415 (delta 1056)
  34. Receiving objects: 100% (2778/2778), 654.75 KiB | 230 KiB/s, done.
  35. Resolving deltas: 100% (2057/2057), done.
  36. Submodule path 'dtc': checked out 'bc895d6d09695d05ceb8b52486ffe861d6cfbdde'
  37. [root@localhost qemu]# ./configure --target-list=arm-softmmu,arm-linux-user //配置
  38. Install prefix /usr/local
  39. BIOS directory /usr/local/share/qemu
  40. binary directory /usr/local/bin
  41. library directory /usr/local/lib
  42. module directory /usr/local/lib/qemu
  43. libexec directory /usr/local/libexec
  44. include directory /usr/local/include
  45. config directory /usr/local/etc
  46. local state directory /usr/local/var
  47. Manual directory /usr/local/share/man
  48. ELF interp prefix /usr/gnemul/qemu-%M
  49. Source path /root/qemu
  50. C compiler cc
  51. Host C compiler cc
  52. C++ compiler c++
  53. Objective-C compiler cc
  54. ARFLAGS rv
  55. CFLAGS -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread -I/usr/incl ude/glib-2.0 -I/usr/lib/glib-2.0/include -g
  56. QEMU_CFLAGS -fPIE -DPIE -m32 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE FILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels -Wmissing- include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit -self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype -limits -fstack-protector-all -I/usr/include/libpng12 -I/usr/include/pixma n-1 -I$(SRC_PATH)/dtc/libfdt
  57. LDFLAGS -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m32 -g
  58. make make
  59. install install
  60. python python -B
  61. smbd /usr/sbin/smbd
  62. module support no
  63. host CPU i386
  64. host big endian no
  65. target list arm-softmmu arm-linux-user
  66. tcg debug enabled no
  67. gprof enabled no
  68. sparse enabled no
  69. strip binaries yes
  70. profiler no
  71. static build no
  72. -Werror enabled no
  73. pixman system
  74. SDL support yes
  75. GTK support no
  76. curses support yes
  77. curl support yes
  78. mingw32 support no
  79. Audio drivers oss
  80. Block whitelist (rw)
  81. Block whitelist (ro)
  82. VirtFS support yes
  83. VNC support yes
  84. VNC TLS support yes
  85. VNC SASL support yes
  86. VNC JPEG support yes
  87. VNC PNG support yes
  88. VNC WS support yes
  89. xen support no
  90. brlapi support no
  91. bluez support no
  92. Documentation no
  93. GUEST_BASE yes
  94. PIE yes
  95. vde support no
  96. netmap support no
  97. Linux AIO support yes
  98. ATTR/XATTR support yes
  99. Install blobs yes
  100. KVM support yes
  101. RDMA support no
  102. TCG interpreter no
  103. fdt support yes
  104. preadv support yes
  105. fdatasync yes
  106. madvise yes
  107. posix_madvise yes
  108. sigev_thread_id yes
  109. uuid support yes
  110. libcap-ng support yes
  111. vhost-net support yes
  112. vhost-scsi support yes
  113. Trace backend nop
  114. Trace output file trace-
  115. spice support no
  116. rbd support no
  117. xfsctl support no
  118. nss used no
  119. libusb no
  120. usb net redir no
  121. GLX support yes
  122. libiscsi support no
  123. libnfs support no
  124. build guest agent yes
  125. QGA VSS support no
  126. seccomp support no
  127. coroutine backend ucontext
  128. coroutine pool yes
  129. GlusterFS support no
  130. virtio-blk-data-plane yes
  131. gcov gcov
  132. gcov enabled no
  133. TPM support no
  134. libssh2 support no
  135. TPM passthrough no
  136. QOM debugging yes
  137. vhdx yes
  138. Quorum no
  139. lzo support no
  140. snappy support no
  141. [root@localhost qemu]# make -j 2 //双核CPU
  142.   GEN arm-softmmu/config-devices.mak
  143.   GEN arm-linux-user/config-devices.mak
  144.   GEN config-host.h
  145.        :
  146.        :
  147.        ;
  148.        ;
  149.        ;
  150.   LINK arm-softmmu/qemu-system-arm
  151. [root@localhost qemu]# make install //安装
  152.         CHK version_gen.h
  153. install -d -m 0755 "/usr/local/share/qemu"
  154. install -d -m 0755 "/usr/local/etc/qemu"
  155. install -c -m 0644 /root/qemu/sysconfigs/target/target-x86_64.conf "/usr/local/etc/qemu"
  156. install -d -m 0755 "/usr/local/var"/run
  157. install -d -m 0755 "/usr/local/bin"
  158. libtool --quiet --mode=install install -c -m 0755 qemu-ga qemu-nbd qemu-img qemu-io fsdev/virtfs-proxy-helper "/usr/local/bin"
  159. install -d -m 0755 "/usr/local/libexec"
  160. libtool --quiet --mode=install install -c -m 0755 qemu-bridge-helper "/usr/local/libexec"
  161. set -e; for x in bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin acpi-dsdt.aml q35-acpi-dsdt.aml ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom qemu-icon.bmp qemu_logo_no_text.svg bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb multiboot.bin linuxboot.bin kvmvapic.bin s390-zipl.rom s390-ccw.img spapr-rtas.bin slof.bin palcode-clipper; do \
  162.                 install -c -m 0644 /root/qemu/pc-bios/$x "/usr/local/share/qemu"; \
  163.         done
  164. install -d -m 0755 "/usr/local/share/qemu/keymaps"
  165. set -e; for x in da en-gb et fr fr-ch is lt modifiers no pt-br sv ar de en-us fi fr-be hr it lv nl pl ru th common de-ch es fo fr-ca hu ja mk nl-be pt sl tr bepo cz; do \
  166.                 install -c -m 0644 /root/qemu/pc-bios/keymaps/$x "/usr/local/share/qemu/keymaps"; \
  167.         done
  168. for d in arm-softmmu arm-linux-user; do \
  169.         make --no-print-directory BUILD_DIR=/root/qemu TARGET_DIR=$d/ -C $d install || exit 1 ; \
  170.         done
  171. install -m 755 qemu-system-arm "/usr/local/bin"
  172. strip "/usr/local/bin/qemu-system-arm"
  173. install -m 755 qemu-arm "/usr/local/bin"
  174. strip "/usr/local/bin/qemu-arm"
  175. [root@localhost qemu]#cd
  176. [root@localhost ~]# qem
  177. qembed qemu-ga qemu-io qemu-system-arm
  178. qemu-arm qemu-img qemu-nbd
  179. [root@localhost ~]# qemu-arm -version //查看qemu的版本
  180. qemu-arm version 1.7.90, Copyright (c) 2003-2008 Fabrice Bellard
  181. [root@localhost ~]# wget ftp://sourceware.org/pub/gdb/releases/gdb-7.7.tar.gz //下载最新的gdb,最好不要和你的宿主系统的gdb一样
  182. 2014-03-14 14:28:19 (2.27 MB/s) - “gdb-7.7.tar.gz” 已保存 [32236190]
  183. [root@localhost ~]# ls
  184. add.c EIOffice install.log s.c 模板 文档 桌面
  185. add.c~ eioXpacklog.txt install.log.syslog tmp 视频 下载
  186. anaconda-ks.cfg gdb-7.7.tar.gz qemu 公共的 图片 音乐
  187. [root@localhost ~]# tar zxf gdb-7.7.tar.gz
  188. [root@localhost ~]# ls
  189. add.c EIOffice gdb-7.7.tar.gz qemu 公共的 图片 音乐
  190. add.c~ eioXpacklog.txt install.log s.c 模板 文档 桌面
  191. anaconda-ks.cfg gdb-7.7 install.log.syslog tmp 视频 下载
  192. [root@localhost ~]# cd gdb-7.7
  193. [root@localhost gdb-7.7]# ls
  194. bfd COPYING.LIB ltmain.sh move-if-change
  195. ChangeLog cpu lt~obsolete.m4 opcodes
  196. compile depcomp ltoptions.m4 readline
  197. config djunpack.bat ltsugar.m4 README
  198. config.guess etc ltversion.m4 README-maintainer-mode
  199. config-ml.in gdb MAINTAINERS sim
  200. config.rpath include Makefile.def src-release
  201. config.sub install-sh Makefile.in symlink-tree
  202. configure intl Makefile.tpl texinfo
  203. configure.ac libdecnumber md5.sum ylwrap
  204. COPYING libiberty missing
  205. COPYING3 libtool.m4 mkdep
  206. COPYING3.LIB ltgcc.m4 mkinstalldirs
  207. [root@localhost gdb-7.7]# ./configure --target=arm-linux //后面的参数别忘了
  208. [root@localhost gdb-7.7]# make
  209. [root@localhost gdb-7.7]# make install
  210. [root@localhost gdb-7.7]# which arm-linux-run
  211. /usr/local/bin/arm-linux-run
  212. [root@localhost gdb-7.7]# which arm-linux-gdb
  213. /usr/local/bin/arm-linux-gdb
  214. [root@localhost gdb-7.7]# arm-linux-
  215. arm-linux-addr2line arm-linux-c++filt arm-linux-gcc arm-linux-gcov arm-linux-jv-scan arm-linux-objdump arm-linux-strings
  216. arm-linux-addr2name.awk arm-linux-cpp arm-linux-gcc-4.2.1 arm-linux-gdb arm-linux-ld arm-linux-ranlib arm-linux-strip
  217. arm-linux-ar arm-linux-elf2flt arm-linux-gccbug arm-linux-gfortran arm-linux-ld.real arm-linux-readelf
  218. arm-linux-as arm-linux-flthdr arm-linux-gcj arm-linux-gjnih arm-linux-nm arm-linux-run
  219. arm-linux-c++ arm-linux-g++ arm-linux-gcjh arm-linux-jcf-dump arm-linux-objcopy arm-linux-size
  220. [root@localhost gdb-7.7]# arm-linux-gdb -v //查看arm-linux-gdb的版本
  221. GNU gdb (GDB) 7.7
  222. Copyright (C) 2014 Free Software Foundation, Inc.
  223. License GPLv3+: GNU GPL version 3 or later
  224. This is free software: you are free to change and redistribute it.
  225. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  226. and "show warranty" for details.
  227. This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux".
  228. Type "show configuration" for configuration details.
  229. For bug reporting instructions, please see:
  230. .
  231. Find the GDB manual and other documentation resources online at:
  232. .
  233. For help, type "help".
  234. Type "apropos word" to search for commands related to "word".


安好了我们怎么用呢,下面介绍它们的简单应用,直接上我的过程:
ARM汇编程序:

点击(此处)折叠或打开

  1. .section .data

  2. msg:
  3.         .ascii "Hello,ARM!\n"
  4. len = .- msg

  5. .section .text
  6. .globl _start
  7. _start:
  8.         mov r0,$1
  9.         ldr r1,=msg
  10.         ldr r2,=len
  11.         mov r7,$4
  12.         swi $0

  13.         mov r0,$0
  14.         mov r7,$1
  15.         swi $0

编译并链接运行:

点击(此处)折叠或打开

  1. [root@localhost ~]# arm-linux-a
  2. arm-linux-addr2line arm-linux-addr2name.awk arm-linux-ar arm-linux-as
  3. [root@localhost ~]# arm-linux-as test.s -o test.o
  4. [root@localhost ~]# arm-linux-ld
  5. arm-linux-ld arm-linux-ld.real
  6. [root@localhost ~]# arm-linux-ld
  7. arm-linux-ld arm-linux-ld.real
  8. [root@localhost ~]# arm-linux-ld test.o -o test
  9. [root@localhost ~]# qem
  10. qembed qemu-arm qemu-ga qemu-img qemu-io qemu-nbd qemu-system-arm
  11. [root@localhost ~]# qem
  12. qembed qemu-arm qemu-ga qemu-img qemu-io qemu-nbd qemu-system-arm
  13. [root@localhost ~]# qemu-arm test
  14. Hello,ARM!
  15. [root@localhost ~]#

下面介绍简单的调试,直接上我的图吧:

上面的图是怎样开始调试的,下面介绍一点简单的调试命令:

点击(此处)折叠或打开

  1. login as: root
  2. root@192.168.0.253's password:
  3. Last login: Fri Mar 14 15:06:11 2014 from 192.168.0.12
  4. [root@localhost ~]# arm-linux-gdb test
  5. GNU gdb (GDB) 7.7
  6. Copyright (C) 2014 Free Software Foundation, Inc.
  7. License GPLv3+: GNU GPL version 3 or later
  8. This is free software: you are free to change and redistribute it.
  9. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  10. and "show warranty" for details.
  11. This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux".
  12. Type "show configuration" for configuration details.
  13. For bug reporting instructions, please see:
  14. .
  15. Find the GDB manual and other documentation resources online at:
  16. .
  17. For help, type "help".
  18. Type "apropos word" to search for commands related to "word"...
  19. Reading symbols from test...done.
  20. (gdb) target remote localhost:9999
  21. Remote debugging using localhost:9999
  22. _start () at test.s:10
  23. 10 mov r0,$1
  24. (gdb) disa
  25. disable disassemble
  26. (gdb) disassemble             反汇编
  27. Dump of assembler code for function _start:
  28. => 0x00008074 <+0>: mov r0, #1
  29.    0x00008078 <+4>: ldr r1, [pc, #20] ; 0x8094 <_start+32>
  30.    0x0000807c <+8>: mov r2, #11
  31.    0x00008080 <+12>: mov r7, #4
  32.    0x00008084 <+16>: svc 0x00000000
  33.    0x00008088 <+20>: mov r0, #0
  34.    0x0000808c <+24>: mov r7, #1
  35.    0x00008090 <+28>: svc 0x00000000
  36.    0x00008094 <+32>: muleq r1, r8, r0
  37. End of assembler dump.
  38. (gdb) display /10i $pc-16             这个命令是显示当前pc附近的10条指令,代替调试x86程序的list命令
  39. 1: x/10i $pc-16
  40.    0x8064: andeq r0, r0, r11
  41.    0x8068: andeq r0, r0, r11
  42.    0x806c: andeq r0, r0, r6
  43.    0x8070: andeq r8, r0, r0
  44. => 0x8074 <_start>: mov r0, #1
  45.    0x8078 <_start+4>: ldr r1, [pc, #20] ; 0x8094 <_start+32>
  46.    0x807c <_start+8>: mov r2, #11
  47.    0x8080 <_start+12>: mov r7, #4
  48.    0x8084 <_start+16>: svc 0x00000000
  49.    0x8088 <_start+20>: mov r0, #0
  50. (gdb) si         si,不是s,是单步执行指令,如果是s的话就会执行到下一个标号处。类似的还有ni
  51. 11 ldr r1,=msg
  52. 1: x/10i $pc-16
  53.    0x8068: andeq r0, r0, r11
  54.    0x806c: andeq r0, r0, r6
  55.    0x8070: andeq r8, r0, r0
  56.    0x8074 <_start>: mov r0, #1
  57. => 0x8078 <_start+4>: ldr r1, [pc, #20] ; 0x8094 <_start+32>
  58.    0x807c <_start+8>: mov r2, #11
  59.    0x8080 <_start+12>: mov r7, #4
  60.    0x8084 <_start+16>: svc 0x00000000
  61.    0x8088 <_start+20>: mov r0, #0
  62.    0x808c <_start+24>: mov r7, #1
  63. (gdb) info registers         查看寄存器的值
  64. r0 0x1 1
  65. r1 0x40a00812 1084229650
  66. r2 0x0 0
  67. r3 0x0 0
  68. r4 0x0 0
  69. r5 0x0 0
  70. r6 0x0 0
  71. r7 0x0 0
  72. r8 0x0 0
  73. r9 0x0 0
  74. r10 0x10098 65688
  75. r11 0x0 0
  76. r12 0x0 0
  77. sp 0x40a006f8 0x40a006f8
  78. lr 0x0 0
  79. pc 0x8078 0x8078 <_start+4>
  80. cpsr 0x10 16
  81. (gdb) si
  82. 12 ldr r2,=len
  83. 1: x/10i $pc-16
  84.    0x806c: andeq r0, r0, r6
  85.    0x8070: andeq r8, r0, r0
  86.    0x8074 <_start>: mov r0, #1
  87.    0x8078 <_start+4>: ldr r1, [pc, #20] ; 0x8094 <_start+32>
  88. => 0x807c <_start+8>: mov r2, #11
  89.    0x8080 <_start+12>: mov r7, #4
  90.    0x8084 <_start+16>: svc 0x00000000
  91.    0x8088 <_start+20>: mov r0, #0
  92.    0x808c <_start+24>: mov r7, #1
  93.    0x8090 <_start+28>: svc 0x00000000
  94. (gdb) si
  95. 13 mov r7,$4
  96. 1: x/10i $pc-16
  97.    0x8070: andeq r8, r0, r0
  98.    0x8074 <_start>: mov r0, #1
  99.    0x8078 <_start+4>: ldr r1, [pc, #20] ; 0x8094 <_start+32>
  100.    0x807c <_start+8>: mov r2, #11
  101. => 0x8080 <_start+12>: mov r7, #4
  102.    0x8084 <_start+16>: svc 0x00000000
  103.    0x8088 <_start+20>: mov r0, #0
  104.    0x808c <_start+24>: mov r7, #1
  105.    0x8090 <_start+28>: svc 0x00000000
  106.    0x8094 <_start+32>: muleq r1, r8, r0
  107. (gdb) si
  108. 14 swi $0
  109. 1: x/10i $pc-16
  110.    0x8074 <_start>: mov r0, #1
  111.    0x8078 <_start+4>: ldr r1, [pc, #20] ; 0x8094 <_start+32>
  112.    0x807c <_start+8>: mov r2, #11
  113.    0x8080 <_start+12>: mov r7, #4
  114. => 0x8084 <_start+16>: svc 0x00000000
  115.    0x8088 <_start+20>: mov r0, #0
  116.    0x808c <_start+24>: mov r7, #1
  117.    0x8090 <_start+28>: svc 0x00000000
  118.    0x8094 <_start+32>: muleq r1, r8, r0
  119.    0x8098: cfstr64vs mvdx6, [r12], #-288 ; 0xfffffee0
  120. (gdb) si
  121. 16 mov r0,$0
  122. 1: x/10i $pc-16
  123.    0x8078 <_start+4>: ldr r1, [pc, #20] ; 0x8094 <_start+32>
  124.    0x807c <_start+8>: mov r2, #11
  125.    0x8080 <_start+12>: mov r7, #4
  126.    0x8084 <_start+16>: svc 0x00000000
  127. => 0x8088 <_start+20>: mov r0, #0
  128.    0x808c <_start+24>: mov r7, #1
  129.    0x8090 <_start+28>: svc 0x00000000
  130.    0x8094 <_start+32>: muleq r1, r8, r0
  131.    0x8098: cfstr64vs mvdx6, [r12], #-288 ; 0xfffffee0
  132.    0x809c: subpl r2, r1, #28416 ; 0x6f00
  133. (gdb) si
  134. 17 mov r7,$1
  135. 1: x/10i $pc-16
  136.    0x807c <_start+8>: mov r2, #11
  137.    0x8080 <_start+12>: mov r7, #4
  138.    0x8084 <_start+16>: svc 0x00000000
  139.    0x8088 <_start+20>: mov r0, #0
  140. => 0x808c <_start+24>: mov r7, #1
  141.    0x8090 <_start+28>: svc 0x00000000
  142.    0x8094 <_start+32>: muleq r1, r8, r0
  143.    0x8098: cfstr64vs mvdx6, [r12], #-288 ; 0xfffffee0
  144.    0x809c: subpl r2, r1, #28416 ; 0x6f00
  145.    0x80a0: andeq r2, r10, sp, asr #2
  146. (gdb) si
  147. 18 swi $0
  148. 1: x/10i $pc-16
  149.    0x8080 <_start+12>: mov r7, #4
  150.    0x8084 <_start+16>: svc 0x00000000
  151.    0x8088 <_start+20>: mov r0, #0
  152.    0x808c <_start+24>: mov r7, #1
  153. => 0x8090 <_start+28>: svc 0x00000000
  154.    0x8094 <_start+32>: muleq r1, r8, r0
  155.    0x8098: cfstr64vs mvdx6, [r12], #-288 ; 0xfffffee0
  156.    0x809c: subpl r2, r1, #28416 ; 0x6f00
  157.    0x80a0: andeq r2, r10, sp, asr #2
  158.    0x80a4: andeq r0, r0, r0
  159. (gdb) si
  160. [Inferior 1 (Remote target) exited normally] 执行完毕,远程连接退出
  161. (gdb) si
  162. The program is not being run.
  163. (gdb)

这样我们就完成了嵌入式的第一步,环境的初步搭建


阅读(6696) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~