我正在尝试使用 AT91RM9200 (ARM920T) 在 CSB337 板上制作嵌入式 linux。我使用 at91rm9200_defconfig 编译内核 3.2.63。我看到内核正在启动,但我遇到了 rootfs (initrd) 的问题。我将尝试解释上下文,但如果没有必要,您可以直接转到主题末尾的内核消息。
据我了解(我是嵌入式 linux 世界的新手),我可以选择安装 rootfs:initramfs、initrd、nfs 或 jffs2(直接来自闪存)。我的第一个目标是让 linux 工作,无论如何。所以所有解决方案对我来说都是可以接受的,但我必须选择一个开始。jffs2 的解决方案似乎是最困难的,因为我的闪存已经格式化为 TFS(来自 MicroMonitor 引导加载程序的几乎未知的文件系统)。使用 nfs 的解决方案可能很棒(至少对于测试而言),但即使在两台 linux PC 之间我也很难使 nfs 工作。所以,最后,我必须在 initramfs 和 initrd 之间做出选择。我决定从 initrd 开始,因为我相信修改比 initramfs 更灵活。
为了创建rootfs,我使用了具有最低配置的busybox(删除了除“初始化实用程序”之外的所有小程序,静态编译)。之后,我将 rootfs 压缩为 img.gz 并通过 tftp 将其发送到目标内存(与 zImage 相同)。我使用内核启动参数:“root=/dev/ram0 rw initrd=0x20100000,307331”。结果,我有这个内核输出:
Uncompressing Linux... done, booting the kernel.
Linux version 3.2.63 (vadim@vadim-ESPRIMO-Mobile-U9200) (gcc version 4.8.3 20140320 (prerelease
) (Sourcery CodeBench Lite 2014.05-29) ) #11 PREEMPT Fri Nov 7 23:50:05 CET 2014
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=00007177
CPU: VIVT data cache, VIVT instruction cache
Machine: Cogent CSB337
Memory policy: ECC disabled, Data cache writeback
AT91: Detected soc type: at91rm9200
AT91: Detected soc subtype: Unknown
AT91: sram at 0x200000 of 0x4000 mapped at 0xfef74000
Clocks: CPU 184 MHz, master 46 MHz, main 3.686 M
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064
Kernel command line: root=/dev/ram0 rw initrd=0x20100000,307331
PID hash table entries: 64 (order: -4, 256 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 16MB = 16MB total
Memory: 10856k/10856k available, 5528k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc1800000 - 0xfee00000 ( 982 MB)
lowmem : 0xc0000000 - 0xc1000000 ( 16 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc04c022c (4833 kB)
.init : 0xc04c1000 - 0xc04e7000 ( 152 kB)
.data : 0xc04e8000 - 0xc05157e0 ( 182 kB)
.bss : 0xc0515804 - 0xc05370a8 ( 135 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
Console: colour dummy device 80x30
console [tty0] enabled
Calibrating delay loop... 22.78 BogoMIPS (lpj=113920)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
NET: Registered protocol family 16
AT91: Power Management
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-gpio i2c-gpio.0: using pins 57 (SDA) and 58 (SCL)
Switching to clocksource 32k_counter
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
msgmni has been set to 21
io scheduler noop registered
io scheduler deadline registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfffff200 (irq = 1) is a ATMEL_SERIAL
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
physmap platform flash device: 00800000 at 10000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000089 Chip ID 0x
000017
Intel/Sharp Extended Query Table at 0x0031
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Creating 1 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000800000 : "uMON flash"
Generic platform RAM MTD, (c) 2004 Simtec Electronics
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffe0000 (irq 13)
eth0: Link now 100-FullDuplex
eth0: AT91 ethernet at 0xfefbc000 int=24 100-FullDuplex (5a:0b:01:d8:14:00)
eth0: Intel LXT971A PHY
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
at91_cf: probe of at91_cf failed with error -22
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 23, io mem 0x00300000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
USB Serial support registered for Keyspan - (without firmware)
USB Serial support registered for Keyspan 1 port adapter
USB Serial support registered for Keyspan 2 port adapter
USB Serial support registered for Keyspan 4 port adapter
usbcore: registered new interface driver keyspan
keyspan: v1.1.5:Keyspan USB to Serial Converter Driver
USB Serial support registered for MCT U232
usbcore: registered new interface driver mct_u232
mct_u232: z2.1:Magic Control Technology USB-RS232 converter driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mousedev: PS/2 mouse device common for all mice
at91_rtc at91_rtc: rtc core: registered at91_rtc as rtc0
AT91 Real Time Clock driver.
rtc-ds1307 0-0068: rtc core: registered ds1307 as rtc1
rtc-ds1307 0-0068: 56 bytes nvram
i2c /dev entries driver
AT91 Watchdog Timer enabled (5 seconds, nowayout)
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
input: gpio-keys as /devices/platform/gpio-keys/input/input0
UDF-fs: warning (device ram0): udf_fill_super: No partition found (1)
List of all partitions:
1f00 8192 mtdblock0 (driver?)
No filesystem could mount root, tried: reiserfs cramfs minix vfat msdos iso9660 ufs udf
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
[<c0014058>] (unwind_backtrace+0x0/0xe8) from [<c0384af4>] (panic+0x64/0x190)
[<c0384af4>] (panic+0x64/0x190) from [<c04c1bec>] (mount_block_root+0x1cc/0x20c)
[<c04c1bec>] (mount_block_root+0x1cc/0x20c) from [<c04c1e0c>] (mount_root+0xe4/0x10c)
[<c04c1e0c>] (mount_root+0xe4/0x10c) from [<c04c1f94>] (prepare_namespace+0x160/0x1c0)
[<c04c1f94>] (prepare_namespace+0x160/0x1c0) from [<c04c1860>] (kernel_init+0xf4/0x124)
[<c04c1860>] (kernel_init+0xf4/0x124) from [<c000f76c>] (kernel_thread_exit+0x0/0x8)
问题是:我的问题是什么?我可以想象没有文件系统支持,但在我的内核配置中我有:
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
...
如果有必要,我可以提供我的 .config 文件。
预先感谢您的所有评论。
在这篇文章中留下评论后(见下文),我尝试通过 buildroot 和集成的 initramfs 编译内核。现在它看起来更好但仍然无法正常工作。
Uncompressing Linux... done, booting the kernel.
Linux version 3.2.63 (vadim@vadim-ESPRIMO-Mobile-U9200) (gcc version 4.8.3 20140320 (prerelea
se) (Sourcery CodeBench Lite 2014.05-29) ) #2 PREEMPT Tue Nov 11 21:30:05 CET 2014
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=00007177
CPU: VIVT data cache, VIVT instruction cache
Machine: Cogent CSB337
Memory policy: ECC disabled, Data cache writeback
AT91: Detected soc type: at91rm9200
AT91: Detected soc subtype: Unknown
AT91: sram at 0x200000 of 0x4000 mapped at 0xfef74000
Clocks: CPU 184 MHz, master 46 MHz, main 3.686 MHz
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 7874
Kernel command line: mem=31M
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 31MB = 31MB total
Memory: 18672k/18672k available, 13072k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc2000000 - 0xfee00000 ( 974 MB)
lowmem : 0xc0000000 - 0xc1f00000 ( 31 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc04dcadc (4947 kB)
.init : 0xc04dd000 - 0xc0c24000 (7452 kB)
.data : 0xc0c24000 - 0xc0c51680 ( 182 kB)
.bss : 0xc0c516a4 - 0xc0c72b68 ( 134 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
Console: colour dummy device 80x30
console [tty0] enabled
Calibrating delay loop... 22.78 BogoMIPS (lpj=113920)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
NET: Registered protocol family 16
AT91: Power Management
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-gpio i2c-gpio.0: using pins 57 (SDA) and 58 (SCL)
Switching to clocksource 32k_counter
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
msgmni has been set to 36
io scheduler noop registered
io scheduler deadline registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfffff200 (irq = 1) is a ATMEL_SERIAL
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
physmap platform flash device: 00800000 at 10000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000089 Chip ID
0x000017
Intel/Sharp Extended Query Table at 0x0031
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Creating 1 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000800000 : "uMON flash"
Generic platform RAM MTD, (c) 2004 Simtec Electronics
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffe0000 (irq 13)
eth0: Link now 100-FullDuplex
eth0: AT91 ethernet at 0xfefbc000 int=24 100-FullDuplex (5a:0b:01:d8:14:00)
eth0: Intel LXT971A PHY
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
at91_cf: probe of at91_cf failed with error -22
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 23, io mem 0x00300000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
USB Serial support registered for Keyspan - (without firmware)
USB Serial support registered for Keyspan 1 port adapter
USB Serial support registered for Keyspan 2 port adapter
USB Serial support registered for Keyspan 4 port adapter
usbcore: registered new interface driver keyspan
keyspan: v1.1.5:Keyspan USB to Serial Converter Driver
USB Serial support registered for MCT U232
usbcore: registered new interface driver mct_u232
mct_u232: z2.1:Magic Control Technology USB-RS232 converter driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mousedev: PS/2 mouse device common for all mice
at91_rtc at91_rtc: rtc core: registered at91_rtc as rtc0
AT91 Real Time Clock driver.
rtc-ds1307 0-0068: rtc core: registered ds1307 as rtc1
rtc-ds1307 0-0068: 56 bytes nvram
i2c /dev entries driver
AT91 Watchdog Timer enabled (5 seconds, nowayout)
at91_mci at91_mci: 4 wire bus mode not supported - using 1 wire
at91_mci at91_mci: probe failed, err -22
at91_mci: probe of at91_mci failed with error -22
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
input: gpio-keys as /devices/platform/gpio-keys/input/input0
Freeing init memory: 7452K
usb 1-2: new low-speed USB device number 2 using at91_ohci
usb 1-2: device descriptor read/64, error -62
Starting logging: OK
usb 1-2: device descriptor read/64, error -62
Initializing random number generator... usb 1-2: new low-speed USB device number 3 using at91_ohci
usb 1-2: device descriptor read/64, error -62
done.
Starting network...
usb 1-2: device descriptor read/64, error -62
usb 1-2: new low-speed USB device number 4 using at91_ohci