作者 主題: 以Qemu模擬spitz(PAX270)平台時,製作MTD的問題  (閱讀 6930 次)

0 會員 與 1 訪客 正在閱讀本文。

Marty

  • 可愛的小學生
  • *
  • 文章數: 7
    • 檢視個人資料
    • http://smem.no-ip.com/
大家好我是Embedded system的初學者,目前想以Qemu來當作測試平台。我選用Spitz時,他要求我指定MTD,如此我以 mkfs.jffs2 指令製作了MTD,不過載入kernel後出現很多
Bad eraseblock 1018 at 0x00fe8000類似的訊息。
對於MTD小弟仍很陌生,想請教各位。
1.MTD是否可視為一個file system的image,如後可以以mkfs.jffs2製作出來?
2.mkf2.jffs2 指令常常會伴隨著-e 0x40000,那我要如何知道我的-e參數後面應該接的是多少?是否為依照硬體的不同,有甚麼發上可以查詢嗎?

謝謝!

Marty

  • 可愛的小學生
  • *
  • 文章數: 7
    • 檢視個人資料
    • http://smem.no-ip.com/
解決了,原來是make kernel時要指定相關參數。

不過遇到其他問題是,

我到網路上面找了MTD相關的資訊,也做了一個MTD image給Qemu用。


不過做的過程有點一知半解,所以開機是開了,不過一直跟我說:


Failed to execute /sbin/init.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option
to kernel.


我檢查 /sbin/init明明存在,怎麼會一直跟我說沒有。後來有點懷疑是MTD製作的時候沒做好。
我是以mkfs.jffs2 -d ./arm-test -e 0x20000 --pad 0x2000000 -o mtd.jffs2做出來
的。


而arm-test則是root file system目錄


我的kernel參數是
Kernel command line: noinitrd console=ttyS0,115200 init=/sbin/init rw
root=/dev/mtdblock3 rootfstype=jffs2


是否有人有相關經驗,可以分享的?


謝謝!

Marty

  • 可愛的小學生
  • *
  • 文章數: 7
    • 檢視個人資料
    • http://smem.no-ip.com/
附上開機的資訊

Uncompressing Linux.............................................................
................................... done, booting the kernel.
Linux version 2.6.23 (marty@marty-desktop) (gcc version 4.2.0 20070413 (prerelease)
(CodeSourcery Sourcery G++ Lite 2007q1-21)) #10 PREEMPT Wed Apr 16 15:34:06 CST 2008
CPU: XScale-PXA270 [69054114] revision 4 (ARMv5TE), cr=00007977
Machine: SHARP Spitz
Ignoring unrecognised tag 0x00000000
Memory policy: ECC disabled, Data cache writeback
Run Mode clock: 208.00MHz (*16)
Turbo Mode clock: 416.00MHz (*2.0, active)
Memory clock: 208.00MHz (/2)
System bus clock: 208.00MHz
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists in Zone order.  Total pages: 16256
Kernel command line: noinitrd console=ttyS0,115200 init=/sbin/init rw root=/dev/mtdblock3 rootfstype=jffs2
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttyS0] enabled
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: 61824KB available (2752K code, 224K data, 88K init)
SLUB: Genslabs=22, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Sharp Scoop Device found at 0x10800000 -> 0xc4800000
spitz_out_switch: Charging off.
Sharp Scoop Device found at 0x08800040 -> 0xc4802040
Time: oscr0 clocksource has been installed.
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
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
JFFS2: default compression mode: priority
fuse init (API version 7.8)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
spitz_bl_update: LCD Backlight now at 47/63
Corgi Backlight Driver Initialized.
spitz_lcdtg_dac_put: LCD in VGA mode
Console: switching to colour frame buffer device 60x40
spitz_lcdtg_dac_put: LCD in VGA mode
pxa2xx-uart.0: ttyS0 at MMIO 0x40100000 (irq = 22) is a FFUART
pxa2xx-uart.1: ttyS1 at MMIO 0x40200000 (irq = 21) is a BTUART
pxa2xx-uart.2: ttyS2 at MMIO 0x40700000 (irq = 20) is a STUART
pccard: PCMCIA card inserted into slot 0
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: module loaded
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
Sharp SL series flash device: 800000 at 0
Using static partision definition
Creating 1 MTD partitions on "sharpsl-flash":
0x00140000-0x007f0000 : "Boot PROM Filesystem"
NAND device: Manufacturer ID: 0xec, Chip ID: 0x73 (Samsung NAND 16MiB 3,3V 8-bit                                  )
Scanning device for bad blocks
Creating 3 MTD partitions on "sharpsl-nand":
0x00000000-0x00700000 : "System Area"
0x00700000-0x00c00000 : "Root Filesystem"
0x00c00000-0x01000000 : "Home Filesystem"
input: Spitz Keyboard as /class/input/input0
input: Corgi Touchscreen as /class/input/input1
I2C: i2c-0: PXA I2C adapter
I2C: i2c-1: PXA I2C adapter
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
XScale iWMMXt coprocessor detected.
pccard: PCMCIA card inserted into slot 1
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 88K
Warning: unable to open an initial console.
Failed to execute /sbin/init.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

proxypaul

  • 可愛的小學生
  • *
  • 文章數: 2
    • 檢視個人資料
你的mtd 只分割了
Creating 3 MTD partitions on "sharpsl-nand":
0x00000000-0x00700000 : "System Area"
0x00700000-0x00c00000 : "Root Filesystem"
0x00c00000-0x01000000 : "Home Filesystem"

而你的root指到 root=/dev/mtdblock3
實際上沒又這個MTD 的區塊!
你的開機參數應該改成 root=/dev/mtdblock1