"nand write[.jffs2] - addr off|partiton size - read/write `size' bytes starting\n"
" at offset `off' to/from memory address `addr'\n"
……
先在其中增加“nand write.yaffs ……”的使用说明:
U_BOOT_CMD(nand, 5, 1, do_nand,
"nand - NAND sub-system\n",
"info - show available NAND devices\n"
"nand device [dev] - show or set current device\n"
"nand read[.jffs2] - addr off|partition size\n"
"nand write[.jffs2] - addr off|partiton size - read/write `size' bytes starting\n"
" at offset `off' to/from memory address `addr'\n"
"nand read.yaffs addr off size - read the `size' byte yaffs image starting\n"
" at offset `off' to memory address `addr'\n"
"nand write.yaffs addr off size - write the `size' byte yaffs image starting\n"
" at offset `off' from memory address `addr'\n"
……
然后,在nand命令的处理函数do_nand中增加对“write.yaffs ……”的支持。do_nand函数仍在common/cmd_nand.c中实现,代码修改如下:
331 (!strcmp(s, ".jffs2") || !strcmp(s, ".e") || !strcmp(s, ".i"))) {
……
354 }else if ( s != NULL && !strcmp(s, ".yaffs")){
355 if (read) {
356 /* read */
357 nand_read_options_t opts;
358 memset(&opts, 0, sizeof(opts));
359 opts.buffer = (u_char*) addr;
360 opts.length = size;
361 opts.offset = off;
362 opts.readoob = 1;
363 opts.quiet = quiet;
364 ret = nand_read_opts(nand, &opts);
365 } else {
366 /* write */
367 nand_write_options_t opts;
368 memset(&opts, 0, sizeof(opts));
369 opts.buffer = (u_char*) addr;/* yaffs文件系统映像存放的地址 */
370 opts.length = size;/* 长度 */
371 opts.offset = off;/* 要烧写到的NAND Flash的偏移地址 */
372 /* opts.forceyaffs = 1; *//* 计算ECC码的方法,没有使用 */
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-65990-31.html
好像“一妻多夫”“光棍”也不该属于经济问题啊
刚开战没多久
声音太好听