Subject: Re: IDE Support & How to find the base address ?
To: Frederick Bruckman <fredb@fb.sa.enteract.com>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 04/09/1998 10:07:48
On Thu, 9 Apr 1998, Frederick Bruckman wrote:

> You can make a partition that works with the Installer, or the Booter
> even, using `newfs -O etc...' In fact, my Quantum 1G did not
> leave me any other choice--with the Mkfs made filesystem, NetBSD would
> crash into the debugger while unpacking the distribution, or fscking. 
> The message I got was
> 	
> 	panic: ffs_alloccgblk: can't find blk in cyls.
> 
> A trace included the following routines: ffs_alloccgblk, ffs_alloccg,
> ffs_hashtable, ffs_balloc, ffs_write, vn_write. 
> 
> Viewing the mode pages with FWB's SCSI config, it looked like this drive
> is moderately unusual in that it had reserved one bad block per CYLINDER,
> vs. the more conventional one or two per SECTOR. Mkfs doesn't permit this
> option, but newfs does (-x1). It works. I've been running from this drive
> for about a week now.  newfs complains, however: 

I'm confused here. I thought that SCSI devices did bad block remapping
invisably, if they did it. So any spare blocks the drive keeps will be
invisable to the host computer. The -x option seems to be taking sectors
visable to the OS and using them for bad-block replacement. AFAICT.

> fredb-> newfs -NO -k40,43 -m10 -r5400 -x1 sd0a
> 	or even
> fredb-> newfs -NO -x1 sd0a
> newfs: Warning: calculated sectors per cylinder (555) disagrees with disk
> label (556)
> 
> Warning: 365 sector(s) in last cylinder unallocated
> /dev/rsd0a:     1957120 sectors in 3527 cylinders of 4 tracks, 139 sectors
>         955.6MB in 221 cyl groups (16 c/g, 4.34MB/g, 1088 i/g)
> [etc.]
> 
> (The -N option is necessary, due to the fact that I'm currently running
> from this drive!) I'd like to send-pr on this, but I'm not quite sure what
> to make of it.  FWB's geometry doesn't add up either. Their sectors/track
> is all wrong. I'm letting newfs get that from the in kernel disklabel. 
> What I don't understand, is how newfs can correctly skip over the bad
> blocks without knowing where the cylinders end. Here's part of the
> disklabel from the same drive: 

You need to keep in mind that SCSI drives only loosly have a concept of
cylinders. Basiclly the sectors/track number will change from the inner to
the outer areas of the disk. All the UNIX utilities assume it's a
constant, so they get confused. The typically advertized number is an
average.

It doesn't matter that much as you access SCSI disks by sector number, not
by telling the drive to step to cylinder X, and read platter Y...

Take care,

Bill