From owner-freebsd-hackers Fri Jan 22 04:19:35 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA05376 for freebsd-hackers-outgoing; Fri, 22 Jan 1999 04:19:35 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA05341 for ; Fri, 22 Jan 1999 04:19:27 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from localhost (dfr@localhost) by nlsystems.com (8.9.1/8.8.5) with SMTP id MAA60013; Fri, 22 Jan 1999 12:20:09 GMT Date: Fri, 22 Jan 1999 12:20:09 +0000 (GMT) From: Doug Rabson To: "David E. Cross" cc: hackers@FreeBSD.ORG Subject: Re: device driver writing In-Reply-To: <199901211600.LAA28568@cs.rpi.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 21 Jan 1999, David E. Cross wrote: > > I am attempting to write a very simple device driver for the serial port > (8250 only) as a KLD (this is for demonstration purposes to a class). I admit > I have never written a UNIX device drvier before, but KLD makes it look so > easy :). The problem that I am having is that I do not know how to hook > in to the interupts. I have looked at sio.c and noticde the > 'struct isa_device', that contains the information I want to set (I think), > but I do not see where or how this information is registered with the kernel. > Any pointers/sample code would be appreciated, thanks :) Unfortunately the ISA code in -current is not well suited to loadable drivers. It would probably be possible to call intr_create() to set up an interrupt but it would be ugly. Garrett has been working on the i386 isa code to move it to the new device framework in -current. When that happens, things will be a lot easier. I don't know how long it will be before this arrives in the tree though :-(. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message