![]() |
| 首页 > 操作系统 > linux > linux嵌入式开发 |
1
1楼 shuiyu123 2009-5-5 22:41 现使有的是cramfs文件系统,nand flash分为4个区:0--bootloader,1--2.6.12kernel,2--rootfs(cramfs),3--usr.
内核中已经做了(fs/yaffs2)支持yaffs根文件的挂载,就执行以下的操作。 测试挂载的yaffs文件功能。 >mkdir /var/flash0 >mount -t yaffs /dev/mtdblock/3 /var/flash0 通过串口下载一个小文件到/var/flash0 >umount /var/flash0 查看mount上的目录,可以看到该目录下有刚才拷贝的文件,将其umount后,再次mount上来可以发现拷贝的文件仍然存在,这时删除该文件然后umount,再次mount后,可以发现拷贝的文件已经被删除,由此可以该分区可以正常读写。 现在我想在flash上建立根文件系统。 我思路先用busybox制作yaffs文件。用mkyaffsimge做成映像文件(rootfs.yaffs)。 >mount ?t yaffs /dev/mtdblock/3 /mnt/flash0 然后通过串口将yaffs映像文件下载到/var/flash0中. >umount /mnt/flash0 移植YAFFS根文件!我做的过程如下:先用busybox制作Yaffs文件。因为我不想改BIOS里面的东西,所以当然不支持在BIOS里面烧写YAFFS根文件到FLASH里面。因为关系到OOB的问题!所以,也不用MKYAFFSIMGE生成映像文件了!直接将busybox制作Yaffs文件压缩打包,再通过串口下载到FLASH当中,再解压。在这个操作之前必先要挂载好yaffs文件。moount -t yaffs /dev/mtblock/3 /usr/yaffs. 重启动,再修改启动参数。将"rootfs=/dev/mtdblock3......等其它的参数不变. 出现以下的错误提示: yaffs: dev is 32505859 name is "mtdblock3" yaffs: Attempting MTD mount on 31.3, "mtdblock3" 这里说明挂载成功了吧! VFS: Mounted root (yaffs filesystem). mount_devfs_fs(): unable to mount devfs, err: -2 Freeing init memory: 152K "初始内存152K为空"这不知道是什么意思! Warning: unable to open an initial console.“无法打开最初控制台” 这里的错误不知道是在根文件制作的那个地方? Kernel panic - not syncing: No init found. Try passing init= option to kernel. [ 本帖最后由 shuiyu123 于 2009-5-13 22:32 编辑 ] 2楼 adwolf 2009-5-6 17:59 mknod console c 5 1
mknod null c 1 3 弄过了没有呢? 3楼 shuiyu123 2009-5-6 21:13 这个已经加进去了! 不过,我在这论坛里面有人和我一样的问题!不同的是,他的板子nfs启动系统,我的板子是cramfs启动系统! 他也是要想在flash上建立yaffs根文件!!最后出现的问题与我一样!问题都是出在mkyaffsimage工具上面!他用一种方法绕过了不要用mkyaffsimage工具。 我也是和他用相同的方法! 现在正在测试!等一下再发上贴子! 白天因为上班,不能上网跟贴!晚上来了! 4楼 shuiyu123 2009-5-6 22:13 不过现在出现以下的问题!
'tarting pid 366, tty '': '/etc/init.d/rcS ': No such file or directory 好像是文件类型不对,还是属性权限的问题! 请前辈们指点一二谢谢! 5楼 shuiyu123 2009-5-9 09:24 在上面出现的现象,我没有说全。我把信息贴全!望高手赐教,谢谢!!
这是我重新编译的根文件现在出现问题好像是脚本里面有非法字符,出现bad inittab enty.以下是打印出的信息: yaffs: dev is 32505859 name is "mtdblock3" yaffs: Attempting MTD mount on 31.3, "mtdblock3" VFS: Mounted root (yaffs filesystem). Mounted devfs on /dev Freeing init memory: 152K init started: BusyBox v1.7.0 (2009-05-04 20:49:43 CST) Bad inittab entry: 'starting pid 366, tty '': '/etc/init.d/rcS ': No such file or directory Please press Enter to activate this console. 'starting pid 367, tty '': '/bin/sh ' (pid 367) exited. Scheduling it for restart. Please press Enter to activate this console. 'starting pid 368, tty '': '/bin/sh ' (pid 36 几个脚本文件如下: inittab ::sysinit:/etc/init.d/rcS ::askfirst:-/bin/sh ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a -r fstab none /proc proc defaults 0 0 none /dev/pts devpts mode=0622 0 0 tmpfs /dev/shm tmfs defaults 0 0 rcS #!/bin/sh /bin/mount -a /bin/mkdir /dev/pts /bin/mount -t devpts devpts /dev/pts /bin/echo /sbin/mdev > /proc/sys/kernel/hotplug /sbin/mdev -s /sbin/ifconfig eth0 192.168.1.10 [ 本帖最后由 shuiyu123 于 2009-5-12 22:25 编辑 ] 6楼 shuiyu123 2009-5-11 22:02 各位帮我顶一下!!谢谢!!
路过,留下一点什么东西吧! [ 本帖最后由 shuiyu123 于 2009-5-12 22:25 编辑 ] 7楼 shuiyu123 2009-5-12 22:26 这里出现“Bad inittab entry”,但是我看写的脚本没有什么问题吧!
前辈!! ::sysinit:/etc/init.d/rcS ::askfirst:-/bin/sh ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a -r 8楼 connet 2009-5-13 12:14 QUOTE: 现在我想在flash上建立根文件系统。 我思路先用busybox制作yaffs文件。用mkyaffsimge做成映像文件(rootfs.yaffs)。 >mount ?t yaffs /dev/mtdblock/3 /mnt/flash0 然后通过串口将yaffs映像文件下载到/var/flash0中. >umount /mnt/flash0 这里错了吧, 整个 mtdblock3 应该就是 yaffsimg, 而不是把 yafffsimg 这个文件放到 这个分区。 9楼 shuiyu123 2009-5-13 22:19 我那个思路前人有人做过了!这次,我是沿着前人走的路,自己去摸索求证一下,我费了好一个星期的时间到处看贴子,到处找资料!!其实就是犯了一个错太懒,所以走了一步。在写脚本的时候,复制别人的。自己没有好好的一步一步的写出来。结果就出现上面的bad inittab entry 唉!!做事做人,还是踏实一点,亲力亲为好一点!做事要坚持!求人不如求已。今天晚上总算结果出来了!下面是启动信息。楼顶,我说明了思路!如果有朋友也在做之方面的内容不妨看看此贴!关键是在于对busybox编译与脚本的编写!对了,我这里是静态编译的,库当然是自己人工加载进去的(/lib)!改天全都整理一下包括对busybox编译,然后还一些编译出错的故障都贴上!大家一起将知识开源到底!!!!
Load Kernel... Uncompressing Linux............................................................. ......................................... done, booting the kernel. Linux version 2.6.12-h1940 (root@linuxserver) (gcc version 3.4.1) #29 Wed Mar 26 17:25:02 EST 2008 CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T) 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 Machine: SMDK2410 ATAG_INITRD is deprecated; please update your bootloader. Memory policy: ECC disabled, Data cache writeback CPU S3C2440A (id 0x32440001) S3C2440: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz S3C2410 Clocks, (c) 2004 Simtec Electronics USB Control, (c) 2006 ucdragon yl2440.new Built 1 zonelists Kernel command line: root=/dev/mtdblock3 init=/linuxrc load_ramdisk=0 console=tt ySAC1,115200 mem=65536K devfs=mount display=dh240y irq: clearing pending ext status 0000c400 irq: clearing subpending status 0000009a irq: clearing subpending status 00000092 PID hash table entries: 512 (order: 9, 8192 bytes) timer tcon=00090000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8 Console: colour dummy device 80x30 Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory: 64MB = 64MB total Memory: 61568KB available (2648K code, 493K data, 152K init) Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok NET: Registered protocol family 16 S3C2440: Initialising architecture S3C2440: IRQ Support S3C2440: Clock Support, UPLL 96.000 MHz SCSI subsystem initialized usbcore: registered new driver usbfs usbcore: registered new driver hub S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics DMA channel 0 at c4800000, irq 33 DMA channel 1 at c4800040, irq 34 DMA channel 2 at c4800080, irq 35 DMA channel 3 at c48000c0, irq 36 NetWinder Floating Point Emulator V0.97 (double precision) devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au) devfs: boot_options: 0x1 NTFS driver 2.1.22 [Flags: R/W]. JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc. yaffs Mar 26 2008 17:21:15 Installing. Initializing Cryptographic API --- YLE2440fb init LCD --- VA=0xffc00000, PA=0x33d40000, size=0x00027000 Console: switching to colour frame buffer device 40x30 success to register framebuffer device: 0!!! fb1: Virtual frame buffer device, using 1024K of video memory in s3c2410ts init() s3c2410-ts device driver MAJOR:253 base_addr = 0xc4962000 register s3c2410-ts driver success, return code is 0 S3C2410 RTC, (c) 2004 Simtec Electronics s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling initialize ST16C550 on YLE2440 board, iobase = 0x08000000 ttsA0 at I/O 0xc4980000 (irq = 52) is a 16550A ttsA1 at I/O 0xc4b00000 (irq = 53) is a 16550A s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440 s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440 s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440 io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize loop: loaded (max 8 devices) nbd: registered device at major 43 ub: sizeof ub_scsi_cmd 68 ub_dev 2384 ub_lun 140 usbcore: registered new driver ub PPP generic driver version 2.4.2 PPP Deflate Compression module registered PPP BSD Compression module registered NET: Registered protocol family 24 DM9000 ethernet driver V1.26 I/O: c497e300, VID: 90000a46 tun: Universal TUN/TAP device driver, 1.6 tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com> Linux video capture interface: v1.00 Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx SET CF & IDE WAIT!now BWSCON=225ed510 now begin cf_ide_init_default_hwifs() hda: no response (status = 0xa1), resetting drive hda: no response (status = 0xa1) hdb: no response (status = 0xa1), resetting drive hdb: no response (status = 0xa1) hda: no response (status = 0xa1), resetting drive hda: no response (status = 0xa1) hdb: no response (status = 0xa1), resetting drive hdb: no response (status = 0xa1) S3C24XX NAND Driver, (c) 2004 Simtec Electronics s3c2410-nand: mapped registers at c4c80000 s3c2410-nand: timing: Tacls 10ns, Twrph0 40ns, Twrph1 10ns NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit ) NAND_ECC_NONE selected by board driver. This is not recommended !! Scanning device for bad blocks Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit": 0x00000000-0x00030000 : "Boot modified by fla in devs.c" 0x00030000-0x00200000 : "Kernel" 0x00200000-0x02000000 : "RootFileSystem" 0x02000000-0x04000000 : "ExtendFileSystem" usbmon: debugs is not available 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: Product: S3C24XX OHCI usb usb1: Manufacturer: Linux 2.6.12-h1940 ohci_hcd usb usb1: SerialNumber: s3c24xx hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected usbcore: registered new driver usblp drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver Initializing USB Mass Storage driver... usbcore: registered new driver usb-storage USB Mass Storage support registered. usbcore: registered new driver usbhid drivers/usb/input/hid-core.c: v2.01:USB HID core driver mice: PS/2 mouse device common for all mice s3c2410kbd_init s3c2410-maxtrixkb successfully loaded i2c /dev entries driver s3c2440-i2c s3c2440-i2c: slave address 0x10 s3c2440-i2c s3c2440-i2c: bus frequency set to 390 KHz s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter S3C2410-UDA1341 Probe have Enable IIS clock! UDA1341 audio driver initialized NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP established hash table entries: 4096 (order: 3, 32768 bytes) TCP bind hash table entries: 4096 (order: 2, 16384 bytes) TCP: Hash tables configured (established 4096 bind 4096) NET: Registered protocol family 1 yaffs: dev is 32505859 name is "mtdblock3" yaffs: Attempting MTD mount on 31.3, "mtdblock3" VFS: Mounted root (yaffs filesystem). Mounted devfs on /dev Freeing init memory: 152K init started: BusyBox v1.7.0 (2009-05-12 11:42:19 CST) starting pid 366, tty '': '/etc/init.d/rc' ------------------- love linux ------------------- the system is start loding.............................. Please press Enter to activate this console. starting pid 372, tty '': 'bin/sh' # ls bin lib mnt sbin usr dev linuxrc proc sys etc lost+found root tmp
搜索墙@2009 www.pkwall.com all rights reserved QQ:276471788 [京ICP备09111534号]
声明:本站部分数据来源于网络,仅供参考,如有版权问题,请联系我们,我们将及时删除!转载本站请注明来源
| ||||||||||||||||||||||||||||||||||||||||||||