From owner-freebsd-hackers Sat Feb 1 21:37:54 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA01876 for hackers-outgoing; Sat, 1 Feb 1997 21:37:54 -0800 (PST) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA01871 for ; Sat, 1 Feb 1997 21:37:51 -0800 (PST) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.2/8.7.3) id QAA15620; Sun, 2 Feb 1997 16:07:31 +1030 (CST) From: Michael Smith Message-Id: <199702020537.QAA15620@genesis.atrad.adelaide.edu.au> Subject: Re: Device Driver: Almost home(?) In-Reply-To: <199702020327.WAA00333@spoon.beta.com> from "Brian J. McGovern" at "Feb 1, 97 10:27:51 pm" To: mcgovern@spoon.beta.com (Brian J. McGovern) Date: Sun, 2 Feb 1997 16:07:30 +1030 (CST) Cc: hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL28 (25)] 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 Brian J. McGovern stands accused of saying: > > Ok. I've collated a half dozen responses, and merged them in to what I hope > is less of a Frankenstein. At this point, I've modified files.i386, and moved > foo.c in to /usr/src/sys/dev/foo/foo.c. I've added a "pseudo-device foo 1" You shouldn't be modifying files.i386 if the file isn't in the i386 tree. You should be modifying /sys/conf/files as I previously mentioned. > its making it in there. However, I don't think fooinit() is being run > properly, and I'm not sure of the call I make to register the device. As > before, if someone can sanity check me, and let me take it a step or two > further, I'd appreciate it. I think that once I can get it to where I can > tinker and debug, I should be set. Do you see your printf at startup? > Also, I'm getting a warning about the SYSINIT macro, stating > "warning: initialization from incompatible pointer type". If someone could > give me a lead on that as well, I'd appreciate it. ... > static void fooinit(void) That should be static void fooinit(void *unused) as per the example I referenced in /sys/dev/vn/vn.c > static int fooread(dev,myuio, flag) > dev_t dev; > struct uio *myuio; > int flag; > { > unsigned char *buffer_pointer; > int toread; > if ((myuio->uio_iovcnt != 1) || (minor(dev) != 0)) > return ENODEV; > while(myuio->uio_resid) > { > buffer_pointer = (message + (myuio->uio_offset % sizeof(message))); > toread = ((long unsigned int)(message + sizeof(message)) - (long unsigned int)buffer_pointer); > uiomove(buffer_pointer, toread, myuio); > myuio->uio_offset + toread; > myuio->uio_resid = myuio->uio_resid - toread; > } > return 0; > } This is still complete rubbish; please see my earlier message. 8) > -Brian -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[