Subj : Re: Determining geometry of Compact Flash To : comp.os.linux.embedded,comp.os.linux,programmer From : Grant Edwards Date : Wed Dec 15 2004 05:13 am On 2004-12-15, Kevin D Quitt wrote: > We are using an IDE compact flash reader, which the system sees as > /dev/sda. We need to programmatically determine the actual geometry of > the flash chip What do you mean by "geometry"? The number of 512-byte blocks is the only geometry I'm aware of. The actual geometry of the flash chip(s) is hidden behind the IDE interface logic. There's all sorts of stuff going on (remapping bad blocks, etc.). Even if you did know the geometry of the flash chip(s) you couldn't do anything with that information. > for lilo purposes, and we have chips of all different sizes. > (Surprise! Your 16MB flash can have anywhere from 15M to 24M > with all kinds of geometries even when they're exactly the > same size.) They're _not_ all the same size. That's the problem. What you have to do is standardize on a partition size that will fit on all the parts from all the vendors. If you're spec'ing 16MB CF cards, you can't depend on more than 16,000,000 bytes, and you probably ought to back off from that number by a couple percent. > The BIOS of the unit correctly determines the geometry, but > all of linux's measurements are way off. How are you doing the "measurements" and why do you think they're "off". > Isn't there *some* way to find out the *TRUTH*? This is > keeping us from automating production. The only thing I ever figured out to do was to generate a master "disk" image that was smaller than the smallest of the CF cards of the size in question. -- Grant Edwards grante Yow! I'd like TRAINED at SEALS and a CONVERTIBLE on visi.com my doorstep by NOON!! .