linux内核移植生成uImage映象文件参考

1、先修改顶层Makefile,如下:

ARCH ?= $ (SUBARCH)

CROSS_COMPILE ?=

改为:

ARCH ?= arm

CROSS_COMPILE ?= arm-linux-

2、执行make s3c2410_defconfig

3、make uImage,首次编译完内核用了4分钟,尾部出现如下信息:

LD arch/arm/boot/compressed/vmlinux OBJCOPY arch/arm/boot/zImage Kernel: arch/arm/boot/zImage is ready UIMAGE arch/arm/boot/uImage"mkimage" command not found – U-Boot images will not be built Image arch/arm/boot/uImage is ready

4、cd arch/arm/boot/

在这个目录下面没有发现uImage的身影,于是把zImage烤贝到 /var/lib/tftpboot下面。

然后通过在u-boot下面执行命令来烧写到板里。

5、在u-boot下面操作如下:

OpenJTAG> tftp 0x32000000 zImagedm9000 i/o: 0x28000300, id: 0x90000a46 DM9000: running in 16 bit modeMAC: 08:00:3e:26:0a:5bTFTP from server 172.22.136.38; our IP address is 172.22.136.55Filename ‘zImage’.Load address: 0x32000000Loading: checksum badT ################################################################# ################################################################# ################################################################# ################################################################# ####################################doneBytes transferred = 1511056 (170e90 hex)OpenJTAG> bootm 0x32000000## Booting image at 32000000 …6、从上面可以看出没有出现内核信息,于是从新回到pc机上编译内核完成的地方来查看问题出在哪?

看到这一行:"mkimage" command not found – U-Boot images will not be built

可以看出缺少mkimage这个命令。

7、上网查了点资料,在编译完成的u-boot-1.1.6的tool/下面找到mkimage这个文件,

把它烤贝到交叉编译的路径下面/work/tools/gcc-3.4.5-glibc-2.3.6/bin

8、重新再进入顶层,再进行内核编译,这次成功产生如下信息:

OBJCOPY arch/arm/boot/Image Kernel: arch/arm/boot/Image is ready AS arch/arm/boot/compressed/head.o GZIP arch/arm/boot/compressed/piggy.gz AS arch/arm/boot/compressed/piggy.o CC arch/arm/boot/compressed/misc.o LD arch/arm/boot/compressed/vmlinux OBJCOPY arch/arm/boot/zImage Kernel: arch/arm/boot/zImage is ready UIMAGE arch/arm/boot/uImageImage Name: Linux-2.6.22.6Created: Sun Dec 6 22:33:55 2009Image Type: ARM Linux Kernel Image (uncompressed)Data Size: 1511064 Bytes = 1475.65 kB = 1.44 MBLoad Address: 0x30008000Entry Point: 0x30008000 Image arch/arm/boot/uImage is ready

9、在arch/arm/boot

我们这一次可以看到uImage这个文件,不过此时还不是可执行文件,现在更改权限

chmod 777uImage

顔色变为绿色。。。。

10、在u-boot下继续操作,如下:

Enter your selection: qOpenJTAG> tftp 0x32000000 uImagedm9000 i/o: 0x28000300, id: 0x90000a46 DM9000: running in 16 bit modeMAC: 08:00:3e:26:0a:5bTFTP from server 172.22.136.38; our IP address is 172.22.136.55Filename ‘uImage’.Load address: 0x32000000Loading: checksum badchecksum badT ################################################################# ################################################################# ################################################################# ################################################################# ####################################doneBytes transferred = 1511128 (170ed8 hex)OpenJTAG> bootm 0x32000000## Booting image at 32000000 … Image Name: Linux-2.6.22.6 Created: 2009-12-06 14:33:55 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1511064 Bytes = 1.4 MB Load Address: 30008000 Entry Point: 30008000 Verifying Checksum … OKOKStarting kernel …Uncompressing Linux……………………………………………………………………………………… done, booting the kernel.Linux version 2.6.22.6 (root@huanghuang-desktop) (gcc version 3.4.5) #1 Sun Dec 6 22:33:51 CST 2009CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177Machine: SMDK2410Memory policy: ECC disabled, Data cache writebackCPU S3C2410A (id 0x32410002)S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHzS3C24XX Clocks, (c) 2004 Simtec ElectronicsCLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL onCPU0: D VIVT write-back cacheCPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 setsCPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 setsBuilt 1 zonelists. Total pages: 16256Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0irq: clearing subpending status 00000002PID hash table entries: 256 (order: 8, 1024 bytes)timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8Console: colour dummy device 80x30Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)Memory: 64MB = 64MB totalMemory: 61696KB available (2788K code, 313K data, 132K init)Mount-cache hash table entries: 512CPU: Testing write buffer coherency: okNET: Registered protocol family 16S3C2410 Power Management, (c) 2004 Simtec ElectronicsS3C2410: Initialising architectureS3C24XX DMA Driver, (c) 2003-2004,2006 Simtec ElectronicsDMA channel 0 at c4800000, irq 33DMA channel 1 at c4800040, irq 34DMA channel 2 at c4800080, irq 35DMA channel 3 at c48000c0, irq 36usbcore: registered new interface driver usbfsusbcore: registered new interface driver hubusbcore: registered new device driver usbNET: Registered protocol family 2IP 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 registeredNetWinder Floating Point Emulator V0.97 (double precision)JFFS2 version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.io scheduler noop registeredio scheduler anticipatory registered (default)io scheduler deadline registeredio scheduler cfq registereds3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attachs3c2410-lcd: probe of s3c2410-lcd failed with error -22lp: driver loaded but no devices foundppdev: user-space parallel port driverS3C2410 Watchdog Timer, (c) 2004 Simtec ElectronicsSerial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enableds3c2410-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410s3c2410-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410s3c2410-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksizeloop: module loadeddm9000 Ethernet DriverUniform Multi-Platform E-IDE driver Revision: 7.00alpha2ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xxBAST NOR-Flash Driver, (c) 2004 Simtec ElectronicsS3C24XX NAND Driver, (c) 2004 Simtec Electronicss3c2410-nand s3c2410-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30nsNAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)Scanning device for bad blocksCreating 8 MTD partitions on "NAND 64MiB 3,3V 8-bit":0x00000000-0x00004000 : "Boot Agent"0x00000000-0x00200000 : "S3C2410 flash partition 1"0x00400000-0x00800000 : "S3C2410 flash partition 2"0x00800000-0x00a00000 : "S3C2410 flash partition 3"0x00a00000-0x00e00000 : "S3C2410 flash partition 4"0x00e00000-0x01800000 : "S3C2410 flash partition 5"0x01800000-0x03000000 : "S3C2410 flash partition 6"0x03000000-0x04000000 : "S3C2410 flash partition 7"usbmon: debugfs is not availables3c2410-ohci s3c2410-ohci: S3C24XX OHCIs3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000usb usb1: configuration #1 chosen from 1 choicehub 1-0:1.0: USB hub foundhub 1-0:1.0: 2 ports detectedmice: PS/2 mouse device common for all miceS3C24XX RTC, (c) 2004,2006 Simtec Electronicss3c2410-i2c s3c2410-i2c: slave address 0x10s3c2410-i2c s3c2410-i2c: bus frequency set to 390 KHzs3c2410-i2c s3c2410-i2c: i2c-0: S3C I2C adapterTCP cubic registeredNET: Registered protocol family 1drivers/rtc/hctosys.c: unable to open rtc device (rtc0)List of all partitions:1f00 16 mtdblock0 (driver?)1f01 2048 mtdblock1 (driver?)1f02 4096 mtdblock2 (driver?)1f03 2048 mtdblock3 (driver?)1f04 4096 mtdblock4 (driver?)1f05 10240 mtdblock5 (driver?)1f06 24576 mtdblock6 (driver?)1f07 16384 mtdblock7 (driver?)No filesystem could mount root, tried: ext3 ext2 cramfs msdos vfat romfsKernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(31,3)从上面可以看到内核的启动信息。

11、Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(31,3)

这一行信息,是因为我们还没有修改MTD分区,没有增加对yaffs文件系统的支持。如果心胸不似海,又怎能有海一样的事业。

linux内核移植生成uImage映象文件参考

相关文章:

你感兴趣的文章:

标签云: