From: Chen Yaoming <ming@ocdtt.com>
To: linux-mtd@lists.infradead.org
Subject: mtd_debug damaged my rom monitor
Date: Wed, 24 Oct 2001 13:12:34 +0800 [thread overview]
Message-ID: <3BD64DC2.3E3E79F1@ocdtt.com> (raw)
# ./mtd_debug write /dev/mtd0 0x100000 16 /boot/vmlinuz
The command above damaged my rom monitor at FLASH offset 0.
Actually the code in mtd_debug.c can't recognize hex digital due to its
the string to digital conversion
functions called is atol(). I think it should be strtol() as in erase.c
to reach the versatility.
Here is the patch.
--- mtd_debug.c.orig Tue Oct 9 06:00:06 2001
+++ mtd_debug.c Wed Oct 24 11:34:49 2001
@@ -386,13 +386,13 @@
showinfo (fd);
break;
case OPT_READ:
- err = flash_to_file (fd,atol (argv[3]),atol
(argv[4]),argv[5]);
+ err = flash_to_file (fd,strtol (argv[3],NULL,0),strtol
(argv[4],NULL,0),argv[5]);
break;
case OPT_WRITE:
- err = file_to_flash (fd,atol (argv[3]),atol
(argv[4]),argv[5]);
+ err = file_to_flash (fd,strtol (argv[3],NULL,0),strtol
(argv[4],NULL,0),argv[5]);
break;
case OPT_ERASE:
- err = erase_flash (fd,atol (argv[3]),atol (argv[4]));
+ err = erase_flash (fd,strtol (argv[3],NULL,0),strtol
(argv[4],NULL,0));
break;
}
next reply other threads:[~2001-10-24 5:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-24 5:12 Chen Yaoming [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-10-24 5:10 mtd_debug damaged my rom monitor Chen Yaoming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BD64DC2.3E3E79F1@ocdtt.com \
--to=ming@ocdtt.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox