From owner-freebsd-hardware Thu Apr 4 00:00:16 1996 Return-Path: owner-hardware Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA07052 for hardware-outgoing; Thu, 4 Apr 1996 00:00:16 -0800 (PST) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id AAA07013 for ; Thu, 4 Apr 1996 00:00:03 -0800 (PST) Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id RAA26522; Thu, 4 Apr 1996 17:52:34 +0930 From: Michael Smith Message-Id: <199604040822.RAA26522@genesis.atrad.adelaide.edu.au> Subject: Re: Some solutions to disk problems.... I think. To: Brett_Glass@ccgate.infoworld.com (Brett Glass) Date: Thu, 4 Apr 1996 17:52:34 +0930 (CST) Cc: msmith@atrad.adelaide.edu.au, jkh@time.cdrom.com, hardware@freebsd.org In-Reply-To: <9603038286.AA828600274@ccgate.infoworld.com> from "Brett Glass" at Apr 3, 96 11:40:32 pm MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hardware@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Brett Glass stands accused of saying: > > > *sigh* The whole point is that _nothing_ other than the 'wd' driver > > should know this; > > Why not? When a tape drive or CD-ROM is attached to a SCSI interface, there > are exposed flags for both the SCSI adapter and the drive. This isn't > "special case" code. Er, no there aren't any exposed flags for the device. SCSI devices are dynamically allocated at probe time, much too late for something like userconfig() to be of use. > Thus making the table larger than intelligent recognition code. Even > wildcards aren't enough to solve the problem. (Regular expressions WOULD > be, but I don't think there's much justification for adding a regular > expression matcher to the kernel!) Here's a suggestion. Write a function that performs simple string matching using a table of ten IDs. Write ten functions which each parse for these ID's. Compare the size of the two. Repeat the process for twenty, and so on. You may be unpleasantly surprised. Note that your functions will have to have the relevant text embedded _anyway_, so there's no way you can win 8) > The contents of the ID string may need to be parsed further. At which > point, one will need code anyway. For what? It matches, or it doesn't. If it matches, it has the noted behaviour. If it doesn't, it doesn't. KISS. > --Brett -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] Collector of old Unix hardware. "Where are your PEZ?" The Tick [[