|  | 
 
 楼主|
发表于 2005-10-8 10:44:34
|
显示全部楼层 
| 1。直接用NFS方式试一下,这次我把JFFS2文件系统已经写到NAND Flash 中了。关于如何写进去,待会我再写一次做演示,可以照着做。这次是检验一切正常可用。
 [code:1]
 U-Boot 1.1.3 (Sep 28 2005 - 00:33:39)
 
 U-Boot code: 00ED0000 -> 00EE8434  BSS: -> 00EF2688
 IRQ Stack: 00eaef7c
 FIQ Stack: 00eadf7c
 RAM Configuration:
 Bank #0: 00000000 16 MB
 Flash:  2 MB
 In:    serial
 Out:   serial
 Err:   serial
 Hit any key to stop autoboot:  0
 lumit4510 # tftp
 TFTP from server 192.168.1.2; our IP address is 192.168.1.5
 Filename 'uImage.bin'.
 Load address: 0x100000
 Loading: #################################################################
 #################################################################
 #################################################################
 #################################################################
 ############################
 done
 Bytes transferred = 1473412 (167b84 hex)
 lumit4510 # bootm
 ## Booting image at 00100000 ...
 Image Name:   Linux 2.6.9-hcs0 Kernel Image
 Image Type:   ARM Linux Kernel Image (uncompressed)
 Data Size:    1473348 Bytes =  1.4 MB
 Load Address: 00008000
 Entry Point:  00008000
 Verifying Checksum ... OK
 OK
 
 Starting kernel ...
 
 Linux version 2.6.9-hsc0 ([email protected]) (gcc version 3.4.0) #3 Sat Oct 8 02:00:46 CST 2005
 CPU: Samsung-S3C4510B [36807001] revision 1 (ARMv4T)
 Machine: ESPD 4510B(S3C4510B)
 Built 1 zonelists
 Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.2:/root/lumit/src/uClinux/2.6/uClinux-dist/romfs ip=192.168.1.5:::::eth0:any
 PID hash table entries: 128 (order: 7, 2048 bytes)
 Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
 Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
 Memory: 16MB = 16MB total
 Memory: 14680KB available (1264K code, 181K data, 68K init)
 Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
 NET: Registered protocol family 16
 JFFS2 version 2.2. (NAND) (SUMMARY)  (C) 2001-2003 Red Hat, Inc.
 Initializing Cryptographic API
 ttyS0 at I/O 0x3ffd000 (irq = 4) is a Samsung S3C4510B Internal UART
 ttyS1 at I/O 0x3ffe000 (irq = 6) is a Samsung S3C4510B Internal UART
 RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
 loop: loaded (max 8 devices)
 Samsung S3C4510B Ethernet Driver version 0.2 (2004-06-13) <[email protected]>
 Using anticipatory io scheduler
 NAND device: Manufacturer ID: 0xec, Chip ID: 0x73 (Samsung NAND 16MiB 3,3V 8-bit)
 Scanning device for bad blocks
 Creating 2 MTD partitions on "NAND 16MiB 3,3V 8-bit":
 0x00000000-0x00800000 : "LUMIT4510 flash partition A"
 mtd: Giving out device 0 to LUMIT4510 flash partition A
 0x00800000-0x01000000 : "LUMIT4510 flash partition B"
 mtd: Giving out device 1 to LUMIT4510 flash partition B
 NET: Registered protocol family 2
 IP: routing cache hash table of 512 buckets, 4Kbytes
 TCP: Hash tables configured (established 1024 bind 2048)
 NET: Registered protocol family 1
 NET: Registered protocol family 17
 IP-Config: Guessing netmask 255.255.255.0
 IP-Config: Complete:
 device=eth0, addr=192.168.1.5, mask=255.255.255.0, gw=255.255.255.255,
 host=192.168.1.5, domain=, nis-domain=(none),
 bootserver=255.255.255.255, rootserver=192.168.1.2, rootpath=
 Looking up port of RPC 100003/2 on 192.168.1.2
 Looking up port of RPC 100005/1 on 192.168.1.2
 VFS: Mounted root (nfs filesystem).
 Freeing init memory: 68K
 Shell invoked to run file: /etc/rc
 Command: hostname Samsung
 Command: mount -t proc proc /proc
 Command: cat /etc/motd
 Welcome to
 ____ _  _
 /  __| ||_|
 _   _| |  | | _ ____  _   _  _  _
 | | | | |  | || |  _ \| | | |\ \/ /
 | |_| | |__| || | | | | |_| |/    \
 |  ___\____|_||_|_| |_|\____|\_/\_/
 | |
 |_|
 
 For further information check:
 http://www.uclinux.org/
 
 Command: ifconfig lo 127.0.0.1
 Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo
 Command: ifconfig eth0 192.168.1.5
 Execution Finished, Exiting
 
 Sash command shell (version 1.1.1)
 /> ping 192.168.1.2
 PING 192.168.1.2 (192.168.1.2): 56 data bytes
 64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=2.5 ms
 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=2.5 ms
 64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=2.5 ms
 
 --- 192.168.1.2 ping statistics ---
 3 packets transmitted, 3 packets received, 0% packet loss
 round-trip min/avg/max = 2.5/2.5/2.5 ms
 />
 [/code:1]
 让我们看一下16MB的NAND Flash是怎么被分区的。对于NAND FLASH的驱动代码,我放在drivers/mtd/nand/lumit4510_mtd.c中。
 [code:1]
 /> cat /proc/mtd
 dev:    size   erasesize  name
 mtd0: 00800000 00004000 "LUMIT4510 flash partition A"
 mtd1: 00800000 00004000 "LUMIT4510 flash partition B"
 [/code:1]
 其实从其启动信息中您也可以看到:
 [code:1]
 Creating 2 MTD partitions on "NAND 16MiB 3,3V 8-bit":
 0x00000000-0x00800000 : "LUMIT4510 flash partition A"
 mtd: Giving out device 0 to LUMIT4510 flash partition A
 0x00800000-0x01000000 : "LUMIT4510 flash partition B"
 mtd: Giving out device 1 to LUMIT4510 flash partition B
 [/code:1]
 接着,如前所述,我已经将JFFS2文件系统写到/dev/mtd0中,所以我来看看
 能不能mount到目前用NFS方式的根文件系统的/mnt下面。
 [code:1]
 /> mount -t jffs2 /dev/mtdblock0 /mnt
 Empty flash at 0x000b9070 ends at 0x000b9200[注意,这里的信息好像并不重要]
 /> cd /mnt
 /mnt> ls
 bin
 dev
 etc
 home
 lib
 mnt
 proc
 sbin
 tmp
 usr
 var
 /mnt>
 [/code:1]
 看来是没有问题的。
 | 
 |