From owner-freebsd-hackers Tue May 7 21:54:49 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA22858 for hackers-outgoing; Tue, 7 May 1996 21:54:49 -0700 (PDT) Received: from mercury.interpath.com (babbleon@mercury.interpath.com [199.72.1.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id VAA22813 Tue, 7 May 1996 21:54:43 -0700 (PDT) Received: (from babbleon@localhost) by mercury.interpath.com (8.6.12/8.6.9) id AAA29669; Wed, 8 May 1996 00:54:43 -0400 From: "Brian T. Schellenberger - Personal Account" Message-Id: <199605080454.AAA29669@mercury.interpath.com> Subject: Uknown CD-ROM : debugging a driver To: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Date: Wed, 8 May 1996 00:54:42 -0400 (EDT) X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Ok, this is a little weird, but I have an unknown make of CD-ROM. I own a ProStar 9400 and the people in technical support claim not to *know* who make the driver or how to get in contact with them, and there's no clear ID on it. (The only thing is a label saying that it is model CDR-9502, Made in Taiwan. The only maufacturer logo to be found is on two little Philips chips inside, but I've called Philips and they deny making it.) But FreeBSD things thinks an "?uknown" sort of mcd drive, so I thought I'd start with that driver and hack at it, sort of poking around to see what happens. I started out by putting a few printf statements about, but that gets sorta of tedious as I have to reboot each time I rebuild, so I got the clever idea to change all occurances of inb and outb in mcd.c to print out the address and value read/written, by creating BTSinb and BTSoutb, and globbally changing to use those. They are included below for your edification and amusement. However, with this change, the system won't boot, going into an infinite loop as we "inb" a 222 from location 301 over and over. My CD-ROM is at 300, so I think that this is the probe of the non-existant next device, but I'm only guessing here. QUESTIONS: - I'm surely not the first to do this sort of thing. How does one usually do it? - Where is doc on ddb, if that's the best way to look at this? - For that matter, where is ddb itself? I have a man page, but no command, and I did a string search in ftp://ftp.freebsd.org/pub/FreeBSD/packages-2.1/all for "ddb" and found nothing. - I want to watch the probing along with the open &c. How can I get FreeBSD to probe for a device *after* the system has booted and the rest of it is sane rather than before? ================ The failed attempt to show all i/o traffic: ============== (in i386/isa/mcd.c): static int inbval; #define BTSinb(a) ( inbval = inb(a), \ printf("MCD inb: addr=%p in=%c (%d)\n", a, inbval, inbval), \ inbval ) #define BTSoutb(a,b) ( printf("MCD outb: addr=%p, out=%c (%d)\n", a, b, b), \ outb(a, b) ) -- Brian T. Schellenberger, the Man from Babble-On. "Someday I'll get around to importing all the cool quotes from my other account's .sig files." http://mercury.interpath.com/~babbleon