[ECOS] How can I write some data to FIS directoy in linux system?

guzhiqiang gzhq05@gmail.com
Wed Jul 4 12:12:00 GMT 2007


Hi
All.I want to edit the redboot FIS derectory in linux system,this
linux's kernel version is 2.6.my <http://2.6.my> fis divided is:

Name FLASH addr Checksum Length Entry point
RedBoot 0x50000000 0x00000000 0x00080000 0x00000000
kernel 0x50080000 0x15D77917 0x00100000 0x01600000
ramdisk 0x50180000 0x21EC107B 0x00600000 0x00800000
jffs2 0x50780000 0x34013981 0x00860000 0x01600000
FIS directory 0x50FE0000 0x00000000 0x0001F000 0x00000000
RedBoot config 0x50FFF000 0x00000000 0x00001000 0x00000000

in my linux system:

/ $ cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00020000 "RedBoot"
mtd1: 00100000 00020000 "kernel"
mtd2: 00600000 00020000 "ramdisk"
mtd3: 00860000 00020000 "jffs2"
mtd4: 0001f000 00020000 "FIS directory"
mtd5: 00001000 00020000 "RedBoot config"
/ $

so,the FIS directory match along with the file "/dev/mtdblock/4" in
linux system.I write a program to edit the RedBoot Fis directory through
the file in linux system
/dev/mtdblock/4
At first ,my program can't open the file "dev/mtdblock/4",error
infomation is:"cannot open the readonly filesytem."
and so on,I edit the linux kernel file " /drivers/mtd/mtdpart.c"

if ((slave->mtd.flags & MTD_WRITEABLE) && (slave->mtd.size %
slave->mtd.erasesize)) {
// slave->mtd.flags = ~MTD_WRITEABLE;
printk ("mtd: partition \"%s\" doesn't end on an erase block -- force
read-o+>>>nly:%d\n",
parts[i].name,MTD_WRITEABLE);
}
so,compliing and burning to the flash ,now execute my program can write
4 bytes to "/dev/mtdblock/4" file.
But give the error infomation is "end_request: I/O error, dev 1f:04
(mtdblock), sector 2".
after while,i cat /dev/mtdblock/4 > /mnt/4
i use the hexedit open the "/mnt/4 " file, is same to before,in fact ,
the file "/dev/mtdblock/4" not changed.why not write to the file?
how can i write the file?

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list