📄 00000006.htm
字号:
reset <BR> Display RedBoot version information <BR> version <BR> Display (hex dump) a range of memory <BR> x -b <location> [-l <length>] [-s] [-1|2|4] <BR> <BR>5.2.3 连接目标机 <BR> 连接目标机的途径有很多种。这里我们演示的是使用minicom连接目标机的串口 <BR>。 <BR> 首先,使用 minicom –s 设置串口参数:/dev/ttyS1,115200,8N1.将该设 <BR>置保存为默认值,退出。 <BR> 然后用 minicom –o 命令连接IQ80321开发板串口。-o (--noinit) 参数表示 <BR>取消发送初始化MODEM指令。这里似乎需要复位一下IQ80321板子(按板上的复位按 <BR>钮),敲回车,应该出现 RedBoot> 提示符,表示一切顺利。 <BR> 第一次连接后,需要使用 fconfig 命令设置目标机的网络、串口波特率等信息 <BR>。 <BR> 另外,还需要熟悉 fis,这是 RedBoot 提供的操作FLASH的工具。 <BR> Help 命令列出了在RedBoot提示符下面可以使用的所有命令。 <BR> <BR>[root@lips root]# minicom -o <BR>Welcome to minicom 2.00.0 <BR>OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n <BR>Compiled on Jan 25 2003, 00:15:18. <BR>Press CTRL-A Z for help on special keys <BR>+Ethernet eth0: MAC address 00:07:e9:03:39:f4 <BR>IP: 192.168.0.21/255.255.255.0, Gateway: 192.168.0.1 <BR>Default server: 192.168.0.20, DNS server IP: 192.168.0.1 <BR>RedBoot(tm) bootstrap and debug environment [ROM] <BR>Red Hat certified release, version 1.61 - built 16:46:58, Oct 23 2002 <BR>Platform: IQ80321 (XScale) <BR>Copyright (C) 2000, 2001, 2002, Red Hat, Inc. <BR>RAM: 0x00000000-0x08000000, 0x0001b488-0x01fd1000 available <BR>FLASH: 0xf0000000 - 0xf0800000, 64 blocks of 0x00020000 bytes each. <BR># 注意!!这两行显示信息很重要,可以看出: <BR># (1)IQ80321目标板有128M内存,FLASH容量为8M. <BR># (2)可用内存从地址0x0001b488开始. <BR># (3)FLASH的erase block size为0x20000(字节). <BR>RedBoot> <BR>RedBoot> fconfig <BR>Run script at boot: false <BR>Use BOOTP for network configuration: false <BR>Gateway IP address: 192.168.0.1 <BR>Local IP address: 192.168.0.21 <BR>Local IP address mask: 255.255.255.0 <BR>Default server IP address: 192.168.0.20 <BR>Console baud rate: 115200 <BR>DNS server IP address: 192.168.0.1 <BR>GDB connection port: 9000 <BR>Force console for special debug messages: true <BR>Console number for special debug messages: 0 <BR>Network debug at boot time: false <BR>alias/admin: <BR>alias/mobile: <BR>alias/motd: Hello. <BR>RedBoot> <BR>RedBoot> fis <BR>*** invalid 'fis' command: too few arguments <BR>Usage: <BR> fis create -b <mem_base> -l <image_length> [-s <data_length>] <BR> [-f <flash_addr>] [-e <entry_point>] [-r <ram_addr>] [-n] <name> <BR> fis delete name <BR> fis erase -f <flash_addr> -l <length> <BR> fis free <BR> fis init [-f] <BR> fis list [-c] [-d] <BR> fis load [-d] [-b <memory_load_address>] [-c] name <BR> fis lock [-f <flash_addr> -l <length>] [name] <BR> fis unlock [-f <flash_addr> -l <length>] [name] <BR> fis write -f <flash_addr> -b <mem_base> -l <image_length> <BR>RedBoot> <BR> <BR>5.3 MTD和jffs2 <BR>5.3.1 准备 <BR># 重新配置编译主机内核 <BR># 增加 MTD 支持 <BR>Memory Technology Devices (MTD) ---> <BR><*> Memory Technology Device (MTD) support <BR><*> Direct char device access to MTD devices (NEW) <BR><*> Caching block device access to MTD devices (NEW) <BR>Self-contained MTD device drivers ---> <BR><*> Test driver using RAM (NEW) <BR>#(4096) MTDRAM device size in KiB (NEW) <BR>(8192) MTDRAM device size in KiB (NEW) <BR>(128) MTDRAM erase block size in KiB (NEW) <BR><*> MTD emulation using block device (NEW) <BR># 增加 JFFS2 文件系统支持 <BR>File systems ---> <BR><*> Journalling Flash File System v2 (JFFS2) support <BR># 内核中增加了相应的支持之后,还需要 mkfs.jffs2 工具,下载 <BR># <A HREF="ftp://ftp.nluug.nl/pub/sunsite/distributions/altlinux/Sisyphus/files/i">ftp://ftp.nluug.nl/pub/sunsite/distributions/altlinux/Sisyphus/files/i</A> <BR>586/RPMS/jffs2-2.0-alt1.i586.rpm <BR># 安装此 RPM 包,然后就会有 /sbin/mkfs.jffs2 ,并且可以看手册页 <BR>[root@lips tars]# rpm -ivh jffs2-2.0-alt1.i586.rpm <BR># 创建设备节点 <BR>[root@lips tars]# mkdir -p /dev/mtdblock <BR>[root@lips tars]# mknod /dev/mtdblock/0 b 31 0 <BR># 如果已经有了 JFFS2 文件系统映像,怎么看其中的内容? <BR>[root@lips tmp]# dd if=iq80310.jffs2 of=/dev/mtdblock/0 <BR>12288+0 records in <BR>12288+0 records out <BR>[root@lips tmp]# mount -t jffs2 /dev/mtdblock/0 /mnt/ <BR>[root@lips tmp]# <BR> <BR>5.3.2 HOWTO <BR> (参考资料[3]) <BR> *** Putting a jffs file system on the flash devices: <BR> <BR> Now that you have successfully managed to detect your flash devices, <BR> <BR> you need to put a jffs on them. Unlike mke2fs there is no utility th <BR>at <BR> will directly create a jffs file-system onto the <BR> /dev/mtd0,1,2... device. <BR> <BR> You have to use a utility called mkfs.jffs available under mtd/util <BR> <BR> Get a directory ready with the stuff that you want to put under <BR> jffs. Let's assume that it's called /home/jffsstuff <BR> <BR> Then just do: <BR> #/usr/src/mtd/util/mkfs.jffs -d /home/jffsstuff -o /tmp/jffs.image <BR> <BR> This makes a jffs image file. Then do (if your flash chips are erase <BR>d, <BR> else see below): <BR> #cp /tmp/jffs.image /dev/mtd0,1,2... (as the case may be, most <BR> likely /dev/mtd0). <BR> <BR> You may also mount an erased mtdblock device directly without puttin <BR>g <BR> a file system on it. This will let you fill the device interactively <BR> <BR> under your shell control (you know- copy stuff to the mounted dir). <BR> <BR> If your flash chips are not erased or you have been messing around <BR> with them earlier, your cannot just copy the new image on top of the <BR> <BR> older one. Bad things may happen. Use the program mtd/util/erase to <BR> erase your device. <BR> <BR> #/usr/src/mtd/util/erase /dev/mtd0,1,2,3 <offset> <erase-size> <BR> where <BR> offset: try 0 if you don't know (start of mtd device), else must be <BR>in <BR> decimal bytes, but must start at an integral erase sector boundary. <BR> <BR> <BR> erase-size: How many "erase sectors" worth do you want to erase. <BR> Your max erase size for your flash is: <BR> (total-size/your mtd device erase size- look under `cat /proc/mtd`) <BR> <BR> <BR> <BR> Watch the messages on your console (assuming you have verbose turned <BR> <BR> on when you configured your kernel). You should not see any errors. <BR> <BR> When your command prompt returns, do: <BR> #cp /tmp/jffs.image /dev/mtd0,1,2... (as the case may be, most <BR> likely /dev/mtd0). <BR> <BR> <BR> Then load the jffs module in by: <BR> #modprobe jffs <BR> <BR> Then mount the file system by: <BR> #mount -t jffs /dev/mtdblock0 /mnt/jffs (assuming /mnt/jffs exists, <BR>else <BR> make it). <BR> <BR> Note: Note the use of /dev/mtdblock0 NOT /dev/mtd0. "mount" needs a <BR> block device interface and /dev/mtdblock0,1,2,3... are provided for <BR> that purpose. /dev/mtd0,1,2,3 are char devices are provided for thin <BR>gs <BR> like copying the binary image onto the raw flash devices. <BR> <BR> <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -