From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from majordomo by infradead.org with local (Exim 3.16 #2) id 143SJN-0002tX-00 for mtd-list@infradead.org; Wed, 06 Dec 2000 00:19:53 +0000 Received: from [203.46.70.199] (helo=singularity.tronunltd.com) by infradead.org with esmtp (Exim 3.16 #2) id 143SJJ-0002tR-00 for mtd@infradead.org; Wed, 06 Dec 2000 00:19:50 +0000 Date: Wed, 6 Dec 2000 10:19:30 +1000 Message-Id: <200012060019.KAA19472@singularity.tronunltd.com> To: "Ronald G Minnich" Subject: Re: Problems with r/w on mtdblock0 From: "Ian" Cc: , Reply-To: "Ian" Sender: owner-mtd@infradead.org List-ID: Ok - I have more info (and I retract my self-scumbagging from yesterday :-) In the cases where you can "dd if=any_file of=/dev/mtd0 bs=512 count=1" and get *no* change in the DoC content (verified with a "hexdump -v /dec/mtd0") .. If you, instead, try a "doc_loadbios /dev/mtd0 any_file" you should see your "any_file" contents stick to /dev/mtd0's content. See here, result of; #cat crt0.bin crt0.bin > bios #doc_loadbios /dev/mtd0 bios #hdexdump -v /dev/mtd0 | more 0000000 69b0 80e6 0000 0000 0000 0000 0000 0000 0000010 0000 0000 0000 0000 0000 0000 0000 0000 0000020 0000 0000 0000 0000 0000 0000 0000 0000 0000030 0000 0000 0000 0000 0000 0000 0000 0000 0000040 0000 0000 0000 0000 0000 0000 0000 0000 0000050 0000 0000 0000 0000 0000 0000 0000 0000 0000060 0000 0000 0000 0000 0000 0000 0000 0000 0000070 0000 0000 0000 0000 0000 0000 0000 0000 0000080 0000 0000 0000 0000 0000 0000 0000 0000 0000090 0000 0000 0000 0000 0000 0000 0000 0000 00000a0 0000 0000 0000 0000 0000 0000 0000 0000 00000b0 0000 0000 0000 0000 0000 0000 0000 0000 00000c0 0000 0000 0000 0000 0000 0000 0000 0000 00000d0 0000 0000 0000 0000 0000 0000 0000 0000 00000e0 0000 0000 0000 0000 0000 0000 0000 0000 00000f0 0000 0000 0000 0000 0000 0000 0000 0000 0000100 0000 0000 0000 0000 0000 0000 0000 0000 0000110 0000 0000 0000 0000 0000 0000 0000 0000 0000120 0000 0000 0000 0000 0000 0000 0000 0000 0000130 0000 0000 0000 0000 0000 0000 0000 0000 0000140 0000 0000 0000 0000 0000 0000 0000 0000 0000150 0000 0000 0000 0000 0000 0000 0000 0000 0000160 0000 0000 0000 0000 0000 0000 0000 0000 0000170 0000 0000 0000 0000 0000 0000 0000 0000 0000180 0000 0000 0000 0000 0000 0000 0000 0000 0000190 0000 0000 0000 0000 0000 0000 0000 0000 00001a0 0000 0000 0000 0000 0000 0000 0000 0000 00001b0 0000 0000 0000 0000 0000 0000 0000 0000 00001c0 0000 0000 0000 0000 0000 0000 0000 0000 00001d0 0000 0000 0000 0000 0000 0000 0000 0000 00001e0 0000 0000 0000 0000 0000 0000 0000 0000 00001f0 00ea 0000 f4fe 0000 0000 0000 0000 ffff 0000200 69b0 80e6 0000 0000 0000 0000 0000 0000 0000210 0000 0000 0000 0000 0000 0000 0000 0000 0000220 0000 0000 0000 0000 0000 0000 0000 0000 0000230 0000 0000 0000 0000 0000 0000 0000 0000 0000240 0000 0000 0000 0000 0000 0000 0000 0000 0000250 0000 0000 0000 0000 0000 0000 0000 0000 0000260 0000 0000 0000 0000 0000 0000 0000 0000 0000270 0000 0000 0000 0000 0000 0000 0000 0000 0000280 0000 0000 0000 0000 0000 0000 0000 0000 0000290 0000 0000 0000 0000 0000 0000 0000 0000 00002a0 0000 0000 0000 0000 0000 0000 0000 0000 00002b0 0000 0000 0000 0000 0000 0000 0000 0000 00002c0 0000 0000 0000 0000 0000 0000 0000 0000 00002d0 0000 0000 0000 0000 0000 0000 0000 0000 00002e0 0000 0000 0000 0000 0000 0000 0000 0000 00002f0 0000 0000 0000 0000 0000 0000 0000 0000 0000300 0000 0000 0000 0000 0000 0000 0000 0000 0000310 0000 0000 0000 0000 0000 0000 0000 0000 0000320 0000 0000 0000 0000 0000 0000 0000 0000 0000330 0000 0000 0000 0000 0000 0000 0000 0000 0000340 0000 0000 0000 0000 0000 0000 0000 0000 0000350 0000 0000 0000 0000 0000 0000 0000 0000 0000360 0000 0000 0000 0000 0000 0000 0000 0000 0000370 0000 0000 0000 0000 0000 0000 0000 0000 0000380 0000 0000 0000 0000 0000 0000 0000 0000 0000390 0000 0000 0000 0000 0000 0000 0000 0000 00003a0 0000 0000 0000 0000 0000 0000 0000 0000 00003b0 0000 0000 0000 0000 0000 0000 0000 0000 00003c0 0000 0000 0000 0000 0000 0000 0000 0000 00003d0 0000 0000 0000 0000 0000 0000 0000 0000 00003e0 0000 0000 0000 0000 0000 0000 0000 0000 00003f0 00ea 0000 f4fe 0000 0000 0000 0000 ffff However! If you *then* do a dd and transfer any_other_file into /dev/mtd0, the new contents are logically "and"ed with the old contents of /dev/mtd0. Ie; #dd if=doc_loadbios of=/dev/mtd0 bs=512 count=2 #hexdump -v /dev/mtd0 | more 0000000 4130 0044 0000 0000 0000 0000 0000 0000 0000010 0000 0000 0000 0000 0000 0000 0000 0000 0000020 0000 0000 0000 0000 0000 0000 0000 0000 0000030 0000 0000 0000 0000 0000 0000 0000 0000 0000040 0000 0000 0000 0000 0000 0000 0000 0000 0000050 0000 0000 0000 0000 0000 0000 0000 0000 0000060 0000 0000 0000 0000 0000 0000 0000 0000 0000070 0000 0000 0000 0000 0000 0000 0000 0000 0000080 0000 0000 0000 0000 0000 0000 0000 0000 0000090 0000 0000 0000 0000 0000 0000 0000 0000 00000a0 0000 0000 0000 0000 0000 0000 0000 0000 00000b0 0000 0000 0000 0000 0000 0000 0000 0000 00000c0 0000 0000 0000 0000 0000 0000 0000 0000 00000d0 0000 0000 0000 0000 0000 0000 0000 0000 00000e0 0000 0000 0000 0000 0000 0000 0000 0000 00000f0 0000 0000 0000 0000 0000 0000 0000 0000 0000100 0000 0000 0000 0000 0000 0000 0000 0000 0000110 0000 0000 0000 0000 0000 0000 0000 0000 0000120 0000 0000 0000 0000 0000 0000 0000 0000 0000130 0000 0000 0000 0000 0000 0000 0000 0000 0000140 0000 0000 0000 0000 0000 0000 0000 0000 0000150 0000 0000 0000 0000 0000 0000 0000 0000 0000160 0000 0000 0000 0000 0000 0000 0000 0000 0000170 0000 0000 0000 0000 0000 0000 0000 0000 0000180 0000 0000 0000 0000 0000 0000 0000 0000 0000190 0000 0000 0000 0000 0000 0000 0000 0000 00001a0 0000 0000 0000 0000 0000 0000 0000 0000 00001b0 0000 0000 0000 0000 0000 0000 0000 0000 00001c0 0000 0000 0000 0000 0000 0000 0000 0000 00001d0 0000 0000 0000 0000 0000 0000 0000 0000 00001e0 0000 0000 0000 0000 0000 0000 0000 0000 00001f0 0022 0000 0012 0000 0000 0000 0000 0804 0000200 0020 0000 0000 0000 0000 0000 0000 0000 0000210 0000 0000 0000 0000 0000 0000 0000 0000 0000220 0000 0000 0000 0000 0000 0000 0000 0000 0000230 0000 0000 0000 0000 0000 0000 0000 0000 0000240 0000 0000 0000 0000 0000 0000 0000 0000 0000250 0000 0000 0000 0000 0000 0000 0000 0000 0000260 0000 0000 0000 0000 0000 0000 0000 0000 0000270 0000 0000 0000 0000 0000 0000 0000 0000 0000280 0000 0000 0000 0000 0000 0000 0000 0000 0000290 0000 0000 0000 0000 0000 0000 0000 0000 00002a0 0000 0000 0000 0000 0000 0000 0000 0000 00002b0 0000 0000 0000 0000 0000 0000 0000 0000 00002c0 0000 0000 0000 0000 0000 0000 0000 0000 00002d0 0000 0000 0000 0000 0000 0000 0000 0000 00002e0 0000 0000 0000 0000 0000 0000 0000 0000 00002f0 0000 0000 0000 0000 0000 0000 0000 0000 0000300 0000 0000 0000 0000 0000 0000 0000 0000 0000310 0000 0000 0000 0000 0000 0000 0000 0000 0000320 0000 0000 0000 0000 0000 0000 0000 0000 0000330 0000 0000 0000 0000 0000 0000 0000 0000 0000340 0000 0000 0000 0000 0000 0000 0000 0000 0000350 0000 0000 0000 0000 0000 0000 0000 0000 0000360 0000 0000 0000 0000 0000 0000 0000 0000 0000370 0000 0000 0000 0000 0000 0000 0000 0000 0000380 0000 0000 0000 0000 0000 0000 0000 0000 0000390 0000 0000 0000 0000 0000 0000 0000 0000 00003a0 0000 0000 0000 0000 0000 0000 0000 0000 00003b0 0000 0000 0000 0000 0000 0000 0000 0000 00003c0 0000 0000 0000 0000 0000 0000 0000 0000 00003d0 0000 0000 0000 0000 0000 0000 0000 0000 00003e0 0000 0000 0000 0000 0000 0000 0000 0000 00003f0 0028 0000 0406 0000 0000 0000 0000 0000 So if I take a hexdump of the first line of the "doc_loadbios" binary; #hexdump -v doc_loadbios | more 0000000 457f 464c 0101 0001 0000 0000 0000 0000 .. the first line of my bios image; #hdexdump -v bios | more 0000000 69b0 80e6 0000 0000 0000 0000 0000 0000 .. and "and" the two; 0110100110110000 = 69b0h 0100010101111111 = 4575h ================ 0100000100110000 ... I get the first word displayed by /dev/mtd0 after the dd (see above) 0100000100110000 = 4130h Is /dev/mtd0 supposed to behave like this, or have I just rediscovered a deliberate "feature" ... ? > I was confused too. All I can tell you is I have seen cases where the > write doesn't "stick". > > ron -- http://HumanHeuristic.com/ "Bringing people together in a world full of computers" To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org