vivi和内核分区的一致性_第1页
vivi和内核分区的一致性_第2页
vivi和内核分区的一致性_第3页
vivi和内核分区的一致性_第4页
vivi和内核分区的一致性_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、vivi和内核分区的一致性(vivi引导失败)linux技术2009-10-16 13:39:41阅读260评论0 字号:大中小订阅自己在内核移植过程中,忽然想到了引导程序中的分区和内核中分区信息应该一致才对。所以寻求一个解决方案。本处找了一些案例来作为参考。分为两部分,前一部分引用了一个移植,来知道一致性处理。后一部分是一致性的必要性证实,因为他处理中出错了黑色部分为第一部分,源自于: HYPERLINK /%B7%E7%BC%E4_%BB%C3%CF%EB/blog/item/93bac245f18fed8bb3b7dc49.html /%B7%E7%BC%E4_%BB%C3%CF%EB/

2、blog/item/93bac245f18fed8bb3b7dc49.html参考嵌入式Linux应用开发完全手册移植了 UBOOT1.1.6和内核Linux2.6.22由于我用的是阿南的AN2410SSB,没有norflash,只能把uboot烧进nand。刚开始不能saveenv保存环境变量,因为原始版本是保存在nor的,在打了补丁后问题解决,可以把环境变量保存在nand上了,但是修改部分的代码还有待研究。接着配置编译内核,通过tftp下载到sdram执行,打印如下的错误信息:usb usb1: configuration #1 chosen from 1 choicehub 1-0:1.

3、0: USB hub foundhub 1-0:1.0: 2 ports detectedInitializing USB Mass Storage driver.hub 1-0:1.0:Cannot enableport 1.Maybe theUSB cable is bad?hub 1-0:1.0:Cannot enableport 1.Maybe theUSB cable is bad?hub 1-0:1.0:Cannot enableport 1.Maybe theUSB cable is bad?hub 1-0:1.0:Cannot enableport 1.Maybe theUSB

4、 cable is bad?hub 1-0:1.0:Cannot enableport 2.Maybe theUSB cable is bad?hub 1-0:1.0:Cannot enableport 2.Maybe theUSB cable is bad?hub 1-0:1.0:Cannot enableport 2.Maybe theUSB cable is bad?hub 1-0:1.0:Cannot enableport 2.Maybe theUSB cable is bad?hub 1-0:1.0:Cannot enableport 1.Maybe theUSB cable is

5、bad?hub 1-0:1.0:Cannot enableport 1.Maybe theUSB cable is bad?并且不断重复,我想应该是板子没有把USB设备引出的缘故,暂时不管,应该不会影响到后面文件系统的移植。但是还有一个问题,就是nand的分区问题,内核把nand分成了三个区:kernel ; jffs2; yaffs,打印信息如下:NAND device: Manufacturer ID: 0 xec, Chip ID: 0 x76 (Samsung NAND 64M iB 3,3V 8-bit)Scanning device for bad blocksBad eraseb

6、lock 3917 at 0 x03d34000Creating 3 MTD partitions on NAND 64M iB 3,3V 8-bit:0 x00000000-0 x00200000 : kernel0 x00200000-0 x00a00000 : jffs20 x00a00000-0 x04000000 : yaffs有坏块,没办法有点郁闷。该内核没有给在nand上给uboot留一个分区。因为他针对的是有nor的班子,没办法,要自己在0地址多加一个uboot分区用来保存uboot。网上有的说bios分区要和内核分区一致,有的则说不要紧,至此没搞清楚。目标:mtdblock0

7、 0 x000000000 x0100000 1Mubootmtdblock1 0 x001000000 x0600000 5Mkernelmtdblock2 0 x006000000 x1E00000 24Mrootmtdblock3 0 x01E000000 x04000000 34M user具体实现如下:首先修改BIOS里面的分区,在nand.cstatic struct Partition NandPart=(0,0 x0100000, uboot,(0 x00100000, 0 x0600000, kernel,(0 x00600000, 0 x1E00000, root,(0 x

8、01E00000, 0 x04000000, user,;再修改linux内核中的分区信息linux-2.6.22在driver/mtd/nand中s3c2410_nand.c中修改分区信息应该与BIOS中的分区信息相对照.#define NUM_PARTITIONS 4 /nand 的分区数目#define KERNEL_SIZE SZ_1M*5 /内核分区空间大小#define ROOT_SIZE SZ_1M*24 /根文件系统分区大小#define USER_SIZE SZ_1M*34 /用户空间分区大小static struct mtd_partition partition_info

9、 = ( .name = U-boot,.offset = 0,.size = UBOOT_SIZE, .name = linux 2.6.16 kernel,.offset = UBOOT_SIZE,.size = KERNEL_SIZE, .name = root,.offset = UBOOT_SIZE+KERNEL_SIZE,.size = ROOT_SIZE, .name = user,.offset = UBOOT_SIZE+KERNEL_SIZE+ROOT_SIZE,.size = USER_SIZE;这样就完成了。重新编译下载内核,OK一下是第二部分,从错误中修改出来源自: H

10、YPERLINK /rinehart/blog/item/4f3a61d0568bf689a0ec9cc8.html /rinehart/blog/item/4f3a61d0568bf689a0ec9cc8.htmlvivi bootCopy linux kernel from 0 x00040000 to 0 x30008000, size = 0 x001c0000 . donezImage magic = 0 x016f2818Setup linux parameters at 0 x30000100linux command line is: noinitrd root=/dev/mt

11、dblock/2 console=ttySAC0,115200mac=00:01:5d:68:7a:0fMACH_TYPE = 193NOW, Booting Linuxdone, booting theUncompressing Linuxkernel.找到原因了:内核分区表和VIVI分区表不一致吃完饭继续!内核里面的MTD分区表static struct mtd_partition yc2410_nand_part = (0 = .name = vivi,.size = 0 x00020000,#128K.offset = 0,= .name = param,.offset = 0 x00

12、020000,.size = 0 x00010000,#64K,= .name = kernel,.offset = 0 x00030000,.size = 0 x002D0000,#2M+832K,= .name = root,.offset = 0 x00300000,.size = 0 x00C10000,#12M+64K,= .name = usr,.offset = 0 x00F10000,.size = 0 x030EC000,#48M+944k,;VIVI定义的分区表:mtdpart info. (4 partitions)name offset size flagvivi :

13、0 x00000000 0 x000200000 128kparam : 0 x00020000 0 x000100000 64kkernel : 0 x00040000 0 x001c00000 1M+768kroot : 0 x00200000 0 x03cf8000 16 60M+992k=2008.8.24=早上重新配置和编译了一次内核修改了下面两个地方内核的Default kernel command stringnoinitrd root=/dev/mtdblock3 console=ttySAC0,115200 init=/linuxrc我顺便把EABI也选上了(因为觉得这样要好

14、些)VIVI 的noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0以下是引导信息!Linux version (rootlocalhost.localdomain) (gcc version 4.2.1) #73 Sun Aug 24 14:45:00CST 2008CPU: ARM920T 41129200 revision 0 (ARMv4T), cr=c0007177Machine: SMDK2410ATAG_INITRD is deprecated; please update your bootloader.Memor

15、y policy: ECC disabled, Data cache writebackCPU S3C2410A (id 0 x32410002)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, associa

16、tivity 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 00000007irq: clearing subpending status 00000002PID h

17、ash table entries: 256 (order: 8, 1024 bytes)timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8Console: colour dummy device 80 x30Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)Memory: 64MB = 64MB totalMemor

18、y: 61696KB available (2752K code, 311K 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 Elec

19、tronicsDMA 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 famil

20、y 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

21、(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 f

22、ailed 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 0 x50000000 (irq = 70) is a S3C2410s3c241

23、0-uart.1: s3c2410_serial1 at MMIO 0 x50004000 (irq = 73) is a S3C2410s3c2410-uart.2: s3c2410_serial2 at MMIO 0 x50008000 (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:

24、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: 0 xec, Chip ID: 0

25、x76 (Samsung NAND 64MiB 3,3V 8-bit)NAND_ECC_NONE selected by board driver. This is not recommended !Scanning device for bad blocksBad eraseblock 2372 at 0 x02510000Creating 8 MTD partitions on NAND 64MiB 3,3V 8-bit:0 x00000000-0 x00004000 : Boot Agent0 x00000000-0 x00200000 : S3C2410 flash partition

26、 10 x00400000-0 x00800000 : S3C2410 flash partition 20 x00800000-0 x00a00000 : S3C2410 flash partition 30 x00a00000-0 x00e00000 : S3C2410 flash partition 40 x00e00000-0 x01800000 : S3C2410 flash partition 50 x01800000-0 x03000000 : S3C2410 flash partition 60 x03000000-0 x04000000 : S3C2410 flash partition 7usbmon: debugfs is not availables3c2410-ohci s3c2410-ohci: S3C24XX OHCIs3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1s3c2410-oh

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论