Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Sep 2006 10:08:31 -0800
From:      Tom Simes <simestd@netexpress.com>
To:        freebsd-small@freebsd.org
Subject:   Re: Nanobsd & CF geometry
Message-ID:  <20060918100831.4102a6a9.simestd@netexpress.com>
In-Reply-To: <450ED7F0.3030203@no-wire.net>
References:  <6C0CF58A187DA5479245E0830AF84F421D1234@poweredge.attiksystem.ch> <450ED7F0.3030203@no-wire.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 18 Sep 2006 10:31:28 -0700
Phill Hocking <phocking@no-wire.net> wrote:

> Philippe Lang wrote:
> > Hi,
> > 
> > I'm trying to flash Nanobsd on a Compact Flash which is not listed
> > in /usr/src/tools/tools/nanobsd/FlashDevice.sub.
> > 
> > Does anyone know how to calculate NANO_MEDIASIZE, NANO_HEADS and
> > NANO_SECTS for a specific CF, in my case a Transcend 512 MB CF?
> > 
> > I found a datasheet, but I'm not sure what do do with it:
> > http://www.transcendusa.com/Support/DLCenter/Datasheet/TSXMCF80.pdf

I don't see any specs on number of cylinders, heads or sectors/track in
that datasheet.

Presuming you have a flash reader, an easy way to get the information is
just to get the info from the flash itself with fdisk.  Here's what a
128M card I have handy looks like

# fdisk da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=122 heads=64 sectors/track=32 (2048 blks/cyl)
....

In this case capacity would equal cyl*head*sectors*512 or

122 * 64 * 32 * 512 = 127926272

and a corresponding FlashDevice.sub for my device might look like:

        pny)
                case $a2 in
                122|122mb)
                        NANO_MEDIASIZE=`expr 127926272 / 512`
                        NANO_HEADS=64
                        NANO_SECTS=32
                        ;;
                *)
                        echo "Unknown Memory Corp Flash capacity"
                        exit 2
                        ;;
                esac
                ;;

And in my nanobsd conf file I would refer to it as:

FlashDevice pny 122mb


Tom
 
======================================================================
   "Z-80 system stack overflow.  Shut 'er down Scotty, the system's
         sucking mud" - Error message on TRS 80 Model-16B

Tom Simes                                       simestd@netexpress.com 
======================================================================



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060918100831.4102a6a9.simestd>