"-f file --file=file Dump to file\n"
"-l length --length=length Length\n"
"-n --noecc Read without error correction\n"
+"-N --nobad Read without bad block skipping\n"
"-o --omitoob Omit oob data\n"
"-b --omitbad Omit bad blocks from the dump\n"
"-p --prettyprint Print nice (hexdump)\n"
static bool pretty_print = false; // print nice
static bool noecc = false; // don't error correct
+static bool nobad = false; // don't skip bad blocks
static bool omitoob = false; // omit oob data
static unsigned long start_addr; // start address
static unsigned long length; // dump length
for (;;) {
int option_index = 0;
- static const char *short_options = "bs:f:l:opqnca";
+ static const char *short_options = "bs:f:l:opqnNca";
static const struct option long_options[] = {
{"help", no_argument, 0, 0},
{"version", no_argument, 0, 0},
{"startaddress", required_argument, 0, 's'},
{"length", required_argument, 0, 'l'},
{"noecc", no_argument, 0, 'n'},
+ {"nobad", no_argument, 0, 'N'},
{"quiet", no_argument, 0, 'q'},
{0, 0, 0, 0},
};
case 'n':
noecc = true;
break;
+ case 'N':
+ nobad = true;
+ break;
case '?':
error++;
break;
for (ofs = start_addr; ofs < end_addr ; ofs+=bs) {
// new eraseblock , check for bad block
- if (blockstart != (ofs & (~meminfo.erasesize + 1))) {
+ if (nobad) {
+ badblock = 0;
+ } else if (blockstart != (ofs & (~meminfo.erasesize + 1))) {
blockstart = ofs & (~meminfo.erasesize + 1);
if ((badblock = ioctl(fd, MEMGETBADBLOCK, &blockstart)) < 0) {
perror("ioctl(MEMGETBADBLOCK)");