Subject: Re: accessing IDE hard drive via pcmcia card
To: None <netbsd-users@NetBSD.org>
From: Steven M. Bellovin <smb@research.att.com>
List: netbsd-users
Date: 05/17/2004 16:59:21
In message <20040517152455.47D547B44@berkshire.research.att.com>, Steve Bellovi
n writes:
>I bought a new hard drive for my laptop, and I'd like to copy things 
>over from the existing drive.  I have a pcmcia IDE adapter that I can 
>plug the new drive into.  Win2k recognizes the drive, but it doesn't 
>seem to spin up under NetBSD 2.0beta.  Here are the relevant dmesg 
>lines:
>
>wdc2 at pcmcia1 function 0
>atabus2 at wdc2 channel 0
>
>I can remove and reinsert the card:
>
>atabus2 detached
>wdc2 detached
>wdc2 at pcmcia0 function 0
>atabus2 at wdc2 channel 0
>
>My config file appears to have the right entries:
>
># PCMCIA IDE controllers
>wdc*    at pcmcia? function ?
>
># ATA (IDE) bus support
>atabus* at ata? 
>
>wd*     at atabus? drive ? flags 0x0000

Some followup data.  I set wdcdebug_mask to track probe operations and 
got the following:

wdc2:0: before reset, st0=0x80, st1=0x80
atabusattach: ch_drive_flags 0x0 0x0

Looking at /sys/ic/wdc.c, it seems that the only way it can print the 
'before reset' message and not an 'after reset' message is if both 
potential drives on the channel appear to have unreadable registers.  
I'm not 100% certain what that code is doing, but from the variable names
it seems to be trying to read the disk's idea of its geometry.

		--Steve Bellovin, http://www.research.att.com/~smb