Nanobsd & CF geometry

Tom Simes simestd at netexpress.com
Mon Sep 18 11:09:39 PDT 2006


On Mon, 18 Sep 2006 10:31:28 -0700
Phill Hocking <phocking at 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 at netexpress.com 
======================================================================


More information about the freebsd-small mailing list