• «
  • 1
  • 2
  • »
  • Pages: 1/2     Go
主题 : Qemu虚拟mini2440碰到的问题,求助,急! 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 15415
精华: 0
发帖: 30
金钱: 150 两
威望: 30 点
贡献值: 0 点
综合积分: 60 分
注册时间: 2010-03-04
最后登录: 2023-09-26
楼主  发表于: 2012-01-28 13:26

 Qemu虚拟mini2440碰到的问题,求助,急!

问题1:按照论坛内提供的《使用qemu 建立mini2440的模拟仿真环境》中描述的方法和文件建立了qemu虚拟环境,但在执行过程中发现DM9000不能有效工作,不知道是怎么回事,求指点。
问题2:我的硬件板子是S3C2410的,抄的SMDK2410,带两块mcp2515(CAN0,CAN1),NAND为64M,不知到怎么修改可以虚拟?
问题3:希望能在Windows XP下直接使用Qemu虚拟S3C2440/S3C2410,没找到可用的Qemu-System-ARM,不知谁有?

测试环境为:Vmware 8.0.0 build-471780+CentOS 6.0

[root@wujiang mini2440]# ./mini2440_start.sh
Starting in .
./../arm-softmmu/qemu-system-arm -kernel ./uImage -M mini2440 -serial stdio -mtdblock ./mini2440_nand128.bin -show-cursor -usb -usbdevice keyboard -usbdevice mouse -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=./qemu-ifup,downscript=./qemu-ifdown -monitor telnet::5555,server,nowait
Excuting qemu-ifup
mini2440_init: Boot mode: NAND
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
QEMU mini2440_reset: loaded default u-boot from NAND
QEMU mini2440_reset: loaded override u-boot (size 3aa00)
QEMU mini2440_reset: loaded ./uImage (size 1f2200)
S3C: CLK=240 HCLK=60 PCLK=30 UCLK=57
S3C: CLK=240 HCLK=60 PCLK=30 UCLK=48
S3C: CLK=405 HCLK=101 PCLK=50 UCLK=48


U-Boot 1.3.2-mini2440 (Jan 28 2012 - 01:50:59)

I2C:   ready
DRAM:  64 MB
NOR Flash not found. Use hardware switch and 'flinit'
Flash:  0 kB
NAND:  Bad block table not found for chip 0
Bad block table not found for chip 0
128 MiB
*** Warning - bad CRC or NAND, using default environment

USB:   S3C2410 USB Deviced
In:    serial
Out:   serial
Err:   serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot:  0
MINI2440 # ping 192.168.1.166
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
ping failed; host 192.168.1.166 is not alive

MINI2440 # bootm
## Booting kernel from Legacy Image at 32000000 ...
   Image Name:   Linux-2.6.32-rc8
   Created:      2012-01-28   4:51:23 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2039788 Bytes =  1.9 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux................................................................................................................................. done, booting the kernel.
s3c_timers_write: Bad register 0x40
Linux version 2.6.32-rc8 (root@wujiang.cqhtech) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #1 Sat Jan 28 12:51:02 CST 2012
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: MINI2440
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: root=/dev/mtdblock3 rootfstype=jffs2 console=ttySAC0,115200
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 60640KB available (3588K code, 388K data, 132K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:85
irq: clearing subpending status 00000002
Console: colour dummy device 80x30
console [ttySAC0] enabled
Calibrating delay loop... 120.83 BogoMIPS (lpj=302080)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
MINI2440: Option string mini2440=0tb
MINI2440: LCD [0:240x320] 1:800x480 2:1024x768 3:240x320 4:640x480
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
S3C24XX CPU Frequency driver, s3c244x cpu support
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c-i2c s3c2440-i2c: slave address 0x10
s3c-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 118
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 60x53
fb0: s3c2410fb frame buffer device
s3c2440-uart.0: ttySAC0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: ttySAC1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: ttySAC2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
at24 0-0050: 1024 byte 24c08 EEPROM (writable)
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c24xx-nand s3c2440-nand: Tacls=1, 9ns Twrph0=3 29ns, Twrph1=2 19ns
s3c24xx-nand s3c2440-nand: NAND soft ECC
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Creating 4 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x000000000000-0x000000040000 : "u-boot"
0x000000040000-0x000000060000 : "u-boot-env"
0x000000060000-0x000000560000 : "kernel"
0x000000560000-0x000008000000 : "root"
dm9000 Ethernet Driver, V1.31
eth0: dm9000e at c4860300,c4864304 IRQ 51 MAC: 08:08:11:18:12:27 (chip)
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
usbcore: registered new interface driver libusual
mice: PS/2 mouse device common for all mice
input: gpio-keys as /devices/platform/gpio-keys/input/input0
s3c2440-ts s3c2440-ts: Starting
  Created group ts filter len 12 depth 2 close 10 thresh 6
  Created Median ts filter len 20 depth 2 dec 24
  Created Mean ts filter len 4 depth 2 thresh 65535
  Created Linear ts filter depth 2
s3c2440-ts s3c2440-ts: 4 filter(s) initialized
s3c2440-ts s3c2440-ts: successfully loaded
input: s3c2410 TouchScreen as /devices/virtual/input/input1
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling
s3c2410-rtc s3c2410-rtc: rtc core: registered s3c as rtc0
i2c /dev entries driver
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
cpuidle: using governor ladder
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
s3c-sdi s3c2440-sdi: powered down.
s3c-sdi s3c2440-sdi: mmc0 - using pio, sw SDIO IRQ
Registered led device: led1
Registered led device: led2
Registered led device: led3
Registered led device: led4
Registered led device: backlight
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.21.
No device for DAI UDA134X
No device for DAI s3c24xx-i2s
S3C24XX_UDA134X SoC Audio driver
UDA134X SoC Audio Codec
asoc: UDA134X <-> s3c24xx-i2s mapping ok
ALSA device list:
  #0: S3C24XX_UDA134X (UDA134X)
TCP cubic registered
NET: Registered protocol family 17
s3c2410-rtc s3c2410-rtc: setting system clock to 2012-01-28 05:16:44 UTC (1327727804)
VFS: Mounted root (jffs2 filesystem) on device 31:3.
Freeing init memory: 132K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2012-01-29 14:14
问题1:按照论坛内提供的《使用qemu 建立mini2440的模拟仿真环境》中描述的方法和文件建立了qemu虚拟环境,但在执行过程中发现DM9000不能有效工作,不知道是怎么回事,求指点。

从你的log看,不像是u-boot的DM9000驱动问题。能否把你用的mini2440_start.sh和qemu-ifup, qemu-ifdown脚本(如果你自己创建了的话)贴出来?


问题2:我的硬件板子是S3C2410的,抄的SMDK2410,带两块mcp2515(CAN0,CAN1),NAND为64M,不知到怎么修改可以虚拟?

这个qemu支持模拟64M NAND, 只要修改hw/mini2440.c
复制代码
  1. diff --git a/hw/mini2440.c b/hw/mini2440.c
  2. index 40edb06..36d21c0 100644
  3. --- a/hw/mini2440.c
  4. +++ b/hw/mini2440.c
  5. @@ -421,9 +421,9 @@ mini2440_init(
  6.      qemu_register_reset(mini2440_reset, mini);
  7.         // Original 64MB NAND (obsolete part)
  8. - //   mini->nand = nand_init(NAND_MFR_SAMSUNG, 0x76);
  9. +    mini->nand = nand_init(NAND_MFR_SAMSUNG, 0x76);
  10.         // 128MB nand -- the hardware can also have 256, 1GB parts
  11. -    mini->nand = nand_init(NAND_MFR_SAMSUNG, nand_cid);
  12. +//    mini->nand = nand_init(NAND_MFR_SAMSUNG, nand_cid);
  13.      mini->cpu->nand->reg(mini->cpu->nand, mini->nand);

另外,修改mini2440_start.sh,把
复制代码
  1. #    dd if=/dev/zero of="$name_nand" bs=528 count=131072

这一行不要注释掉,同时把
复制代码
  1. dd if=/dev/zero of="$name_nand" bs=2112 count=65536

这一行注释掉
qemu的主要目的不是模拟周边外设,如果你需要调试MCP5215, 建议你在你的实际硬件上调。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2012-01-29 16:53
问题3:希望能在Windows XP下直接使用Qemu虚拟S3C2440/S3C2410,没找到可用的Qemu-System-ARM,不知谁有?

qemu可以在Windows下用mingw32环境编译。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 15415
精华: 0
发帖: 30
金钱: 150 两
威望: 30 点
贡献值: 0 点
综合积分: 60 分
注册时间: 2010-03-04
最后登录: 2023-09-26
3楼  发表于: 2012-01-30 13:33

 回 1楼(kasim) 的帖子

就是用的自带的mini2440_start.sh,
qemu-ifup, qemu-ifdown均是按《使用qemu 建立mini2440的模拟仿真环境》步骤做的。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2012-01-30 14:23

 Re:回 1楼(kasim) 的帖子

引用第3楼xxlwsj于2012-01-30 13:33发表的 回 1楼(kasim) 的帖子 :
就是用的自带的mini2440_start.sh,
qemu-ifup, qemu-ifdown均是按《使用qemu 建立mini2440的模拟仿真环境》步骤做的。

如果你没有改过作者的qemu-ifup和qemu-ifdown的话,你在u-boot里ping的地址应该是10.0.0.1. 另外,从git://repo.or.cz/w/u-boot-openmoko/mini2440.git上下载的u-boot源代码里设定的mini2440的IP地址是10.0.0.111, 这和10.0.0.1是匹配的。
[ 此帖被kasim在2012-01-30 14:33重新编辑 ]
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 15415
精华: 0
发帖: 30
金钱: 150 两
威望: 30 点
贡献值: 0 点
综合积分: 60 分
注册时间: 2010-03-04
最后登录: 2023-09-26
5楼  发表于: 2012-01-30 22:22

 Re:Re:回 1楼(kasim) 的帖子

引用第4楼kasim于2012-01-30 14:23发表的 Re:回 1楼(kasim) 的帖子 :

如果你没有改过作者的qemu-ifup和qemu-ifdown的话,你在u-boot里ping的地址应该是10.0.0.1. 另外,从git://repo.or.cz/w/u-boot-openmoko/mini2440.git上下载的u-boot源代码里设定的mini2440的IP地址是10.0.0.111, 这和10.0.0.1是匹配的。

这个我改了,我的虚拟机IP地址为192.168.1.166,网关为192.168.1.1,我把u-boot的IP改为192.168.1.2,网关设为192.168.1.1了。
qemu-ifup和qemu-ifdown中的10.0.0.1改成了192.168.1.4.
是不是因为这个造成的。TAP方式是不是相当于又增加了一次路由,不能和VMWARE虚拟机在同一网段。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
6楼  发表于: 2012-01-31 00:00

 Re:Re:Re:回 1楼(kasim) 的帖子

引用第5楼xxlwsj于2012-01-30 22:22发表的 Re:Re:回 1楼(kasim) 的帖子 :

这个我改了,我的虚拟机IP地址为192.168.1.166,网关为192.168.1.1,我把u-boot的IP改为192.168.1.2,网关设为192.168.1.1了。
qemu-ifup和qemu-ifdown中的10.0.0.1改成了192.168.1.4.
是不是因为这个造成的。TAP方式是不是相当于又增加了一次路由,不能和VMWARE虚拟机在同一网段。

TAP方式相当于在你的虚拟机和qemu之间新建了一个局域网,最好不要和vmware原本的地址放在同一网段。qemu-ifup中的192.168.1.4就是这个局域网中你的虚拟机的地址, 你可以在u-boot中用这个地址访问你的虚拟机。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 15415
精华: 0
发帖: 30
金钱: 150 两
威望: 30 点
贡献值: 0 点
综合积分: 60 分
注册时间: 2010-03-04
最后登录: 2023-09-26
7楼  发表于: 2012-01-31 12:53

 Re:Re:Re:Re:回 1楼(kasim) 的帖子

引用第6楼kasim于2012-01-31 00:00发表的 Re:Re:Re:回 1楼(kasim) 的帖子 :

TAP方式相当于在你的虚拟机和qemu之间新建了一个局域网,最好不要和vmware原本的地址放在同一网段。qemu-ifup中的192.168.1.4就是这个局域网中你的虚拟机的地址, 你可以在u-boot中用这个地址访问你的虚拟机。

谢谢,确实是这个问题。
级别: 新手上路
UID: 15415
精华: 0
发帖: 30
金钱: 150 两
威望: 30 点
贡献值: 0 点
综合积分: 60 分
注册时间: 2010-03-04
最后登录: 2023-09-26
8楼  发表于: 2012-02-09 18:31
问题3:希望能在Windows XP下直接使用Qemu虚拟S3C2440/S3C2410,没找到可用的Qemu-System-ARM,不知谁有?


我在linux下已经改成功了s3c2410的,出现了NAND不可写的问题,但可以通过NFS启动内核和文件系统,QT程序也可以运行。
NAND不管改成64M还是128M均报错,不知道是不是和NAND芯片本身有关?

使用Msys-cn中的MingW编译成功了qemu-system-arm.exe,加入了S3C2410支持,但是调试窗口无法像Linux一样捕获键盘操作,无法进入u-boot命令行修改启动参数,TAP无法连接到NFS,在u-boot下只能等待连接NFS服务器。

我只是把mini2440.h复制成sm2410.h,修改其中2440为2410,并在系统中加入了2410的MACHINE,要启用Windows下键盘捕获是否还要修改代码,请高手指点?
级别: 新手上路
UID: 15415
精华: 0
发帖: 30
金钱: 150 两
威望: 30 点
贡献值: 0 点
综合积分: 60 分
注册时间: 2010-03-04
最后登录: 2023-09-26
9楼  发表于: 2012-02-11 21:37
引用第8楼xxlwsj于2012-02-09 18:31发表的  :


我在linux下已经改成功了s3c2410的,出现了NAND不可写的问题,但可以通过NFS启动内核和文件系统,QT程序也可以运行。
NAND不管改成64M还是128M均报错,不知道是不是和NAND芯片本身有关?

.......

看了Qemu的说明文档,解决了Windows下调试串口的问题。继续等待解决NAND无法写入的问题。
  • «
  • 1
  • 2
  • »
  • Pages: 1/2     Go