From owner-freebsd-hackers Mon Jul 6 23:00:55 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA02183 for freebsd-hackers-outgoing; Mon, 6 Jul 1998 23:00:55 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from hen.scotland.net (hen.scotland.net [194.247.64.129]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA02172 for ; Mon, 6 Jul 1998 23:00:47 -0700 (PDT) (envelope-from freebsd@timog.prestel.co.uk) Received: from e2c10p50.scotland.net ([148.176.238.114] helo=timog.prestel.co.uk) by hen.scotland.net with esmtp (Exim 1.90 #5) for hackers@freebsd.org id 0ytQnY-0006mG-00; Tue, 7 Jul 1998 07:00:20 +0100 Received: (qmail 854 invoked by uid 1002); 6 Jul 1998 19:27:20 -0000 Message-ID: <19980706202720.A785@timog.prestel.co.uk> Date: Mon, 6 Jul 1998 20:27:20 +0100 From: Timo Geusch To: Mike Smith Cc: hackers@FreeBSD.ORG Subject: Re: PCMCIA disk cards Mail-Followup-To: Mike Smith , hackers@freebsd.org References: <199807061559.IAA03530@antipodes.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199807061559.IAA03530@antipodes.cdrom.com>; from Mike Smith on Mon, Jul 06, 1998 at 08:59:50AM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Jul 06, 1998 at 08:59:50AM -0700, Mike Smith wrote: > > Probably. But what with inserting and removing them... I guess removing > > such a drive can panick your system. > > Yes. PCMCIA sucks. > > There are actually a couple of different ways of talking to PCCARD > memory devices. The PAO people have driver support for some PCCARD ATA > and CompactFlash devices. You should talk to Hosakawa-san > (hosakawa@freebsd.org) and ask him why he hasn't committed these bits > (he said he was going to quite a while back now...) Well, to if I remember correctly, there are at least four different ways of handling storage devices in PCMCIA: 1. SRAM cards. Used as 'normal' memory, you map a part of their memory into the infamous 'above 640k' range because the bleedin' adapter still can't handle higher addresses (Ugh) and simply read/write from that memory. 2. Flash cards that come up as flash cards. IMHO, this is the worst part of 'em# all. The problem with those cards is that you have to determine exactly what kind of card it is, to make sure you get the erase block size and stuff like that right. Apart from that, you already know that the day after you are finished your customer will show up with yet another dubios card that will not work. 3. Flash cards and Hard drives that are using the ATA interface. From a driver point of view these are amongst the easiest to support, baring the one or two really weird cards that want to be configured as either primary or secondardy IDE devices. 4. The infamous non-ATA HD. Never came across one, but they are rumored to exist in the wild. Considering the file system problems (Guess were all this blabbing came from - I used to work on a PCMCIA driver suite for Windows NT, which incidentally has similar problems), I guess it should be possible to implement a partial working kind of hot swapping with a bit of reliance on the luser. Basically, the things that need to be assured are: - No write buffering. All the data has to go directly to the device. If that device has some kind of light, one can at least tell the luser that s/he can't remove the drive while the light is on. Pity that nobody bothered to create some kind of physical locking mechanism, otherwise we could simply lock the device until its unmounted. - When a PCMCIA ATA device is present, the kernel needs to know that it can go away at any time. Thus, the handling of sudden disk removals should be implemented in a way that will actually prevent the kernel from panicking. - Hot insertion would be nice, too :). Should not be to complicated, though. I actually did not look at the code for a long time, so if some of the features are already present, I have to apologize. Cheers, Timo To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message