Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1277805
  • 博文数量: 286
  • 博客积分: 3713
  • 博客等级: 少校
  • 技术积分: 2275
  • 用 户 组: 普通用户
  • 注册时间: 2012-01-11 09:47
个人简介

http://blog.chinaunix.net/uid/16979052.html

文章分类

全部博文(286)

文章存档

2018年(1)

2017年(16)

2016年(9)

2015年(17)

2014年(15)

2013年(112)

2012年(116)

分类: 虚拟化

2014-01-17 11:32:58

root@leon-lu:/home/work/qemu4arm/Demo# chmod +x arm-2010.09-50-arm-none-linux-gnueabi.bin 

root@leon-lu:/home/work/qemu4arm/Demo# ./arm-2010.09-50-arm-none-linux-gnueabi.bin 
Checking for required programs: awk grep sed bzip2 gunzip
===============================================================
Error: DASH shell not supported as system shell
===============================================================
The installer has detected that your system uses the dash shell
as /bin/sh.  This shell is not supported by the installer.
You can work around this problem by changing /bin/sh to be a
symbolic link to a supported shell such as bash.
For example, on Ubuntu systems, execute this shell command:
   % sudo dpkg-reconfigure -plow dash
   Install as /bin/sh? No
Please refer to the Getting Started guide for more information,
or contact CodeSourcery Support for assistance.
===============================================================

root@leon-lu:/home/work/qemu4arm/Demo# dpkg-reconfigure -plow dash



root@leon-lu:/home/work/qemu4arm/Demo# qemu-system-arm --version
QEMU emulator version 0.14.0, Copyright (c) 2003-2008 Fabrice Bellard



#include
int main()
{
    printf("Hello, QEMU for ARM!\n");
    return 0;
}
root@leon-lu:/home/work/qemu4arm/test# arm-none-linux-gnueabi-gcc hello.c -o hello
root@leon-lu:/home/work/qemu4arm/test# qemu-arm -L ~/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/libc/ hello
Hello, QEMU for ARM!

DEBUG
1. qemu端
root@leon-lu:/home/work/qemu4arm/Demo/u-boot-2010.09# qemu-system-arm -M versatilepb -nographic -kernel u-boot -s

U-Boot 2010.09 (Jan 16 2014 - 21:41:46)

DRAM:  0 Bytes
## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
Flash: 0 Bytes
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   SMC91111-0
VersatilePB # 


2. gdb端
root@leon-lu:/home/work/qemu4arm/Demo/u-boot-2010.09# arm-none-linux-gnueabi-gdb u-boot
GNU gdb (Sourcery G++ Lite 2010.09-50) 7.2.50.20100908-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi".
For bug reporting instructions, please see:
...
Reading symbols from /home/work/qemu4arm/Demo/u-boot-2010.09/u-boot...done.
(gdb) 

3. gdb端
(gdb) target remote :1234
Remote debugging using :1234
serial_getc () at serial_pl01x.c:176
176 return pl01x_getc (CONSOLE_PORT);
(gdb) b do_printenv
Breakpoint 1 at 0x1008210: file cmd_nvedit.c, line 148.
(gdb) c
Continuing.

4. qemu端
VersatilePB # printenv

5. gdb端
Breakpoint 1, do_printenv (cmdtp=0x1015548, flag=0, argc=1, argv=0xfddee4)
    at cmd_nvedit.c:148
148 if (argc == 1) {
(gdb) 

6. gdb端
输入空格,显示
Continuing.

7. qemu端
bootargs=root=/dev/nfs mem=128M ip=dhcp netdev=25,0,0xf1010000,0xf1010010,eth0
bootdelay=2
baudrate=38400
bootfile="/tftpboot/uImage"
stdin=serial
stdout=serial
stderr=serial
verify=n
ethact=SMC91111-0


Environment size: 202/8188 bytes
VersatilePB # 


Open TFTP Server
$ tar zxvf opentftpmtV1.63.tar.gz
$ mv opentftp/ /opt/
$ cd /opt/opentftp/
$ gedit /etc/rc.d/rc.local
add:
/opt/opentftp/rc.opentftp start
/opt/opentftp/rc.opentftp status




阅读(1133) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
请登录后评论。

登录 注册