public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Bill Roman <roman@alerton.com>
To: mtd@infradead.org
Subject: Re: Booting from the flash
Date: Wed, 01 Mar 2000 14:09:14 -0800	[thread overview]
Message-ID: <38BD950A.AF21594E@alerton.com> (raw)
In-Reply-To: E12QFbt-0003hv-00@infradead.org

Dvir Oren wrote:
> 
> It appears that nftl_format deletes M-Systems' firmware.  I
> remember that David wrote something about fixing that.
> doc_loadbios seems to destroy the partition entirely.  Neither M-
> Systems' drivers nor MTD drivers can recognize anything on the
> flash after doc_loadbios.
> 
> Is there a way to boot from a DOC2000 flash using MTD drivers?

Yes, I've just gone through this.  I've had mixed results resurrecting devices
after destroying their firmware this way: a 4 MB DiskOnChip 2000 was
recoverable, while a 2 MB unit was not.

What I learned is that doc_loadbios seems to need an image captured by "dd
if=/dev/mtd0 ...".  Given this, I was able to destroy and reload the M-Systems
firmware on the 4 MB device.  I confess, after the lack of success with the 2 MB
unit, I didn't try too hard to explore the failure modes in this process, so I'm
not promising it's foolproof.

Of course if that firmware is already gone, you can't capture an image of it!  I
managed to get out of this situation by using the DOS utilities from M-Systems'
web site, and thrashing around booting Linux and DOS from a floppy.  First, I
used the firmware image (DOC121.EXB) and doc_loadbios to load it.  This isn't
enough to make the firmware work, but it's enough to persuade DUPDATE.EXE
(running under DOS, I didn't try dosemu) that the DiskOnChip is present so it
would write the firmware the right way.

After you've succeeded in restoring the boot code (or, preferably, before you've
destroyed it), dd it off of /dev/mtd0 to make an image that works with
doc_loadbios.

You avoid getting into this mess in the first place by supplying an offset of
49152 (48 * 1024) when doing nftl_format.  For example:

    nftl_format /dev/mtd0 49152

This leaves the firmware intact.  Then insmod nftl.o, run fdisk to create a
partition, make a DOS filesystem on it with mkdosfs, and use syslinux to boot.  

I put the necessary modules (doc2000.o, mtd.o, and nftl.o) on an initial RAM
disk image.  This way I can access the flash to update the RAM disk image stored
there.


To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

  reply	other threads:[~2000-03-01 22:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-01 20:22 Booting from the flash Dvir Oren
2000-03-01 22:09 ` Bill Roman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-03-02 10:37 jyllyj

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=38BD950A.AF21594E@alerton.com \
    --to=roman@alerton.com \
    --cc=mtd@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