From owner-freebsd-questions@FreeBSD.ORG Tue Nov 27 23:31:41 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E16E16A418 for ; Tue, 27 Nov 2007 23:31:41 +0000 (UTC) (envelope-from chuckr@chuckr.org) Received: from mail5.sea5.speakeasy.net (mail5.sea5.speakeasy.net [69.17.117.7]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2A413C459 for ; Tue, 27 Nov 2007 23:31:41 +0000 (UTC) (envelope-from chuckr@chuckr.org) Received: (qmail 31849 invoked from network); 27 Nov 2007 23:31:40 -0000 Received: from april.chuckr.org (chuckr@[66.92.151.30]) (envelope-sender ) by mail5.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 27 Nov 2007 23:31:40 -0000 Message-ID: <474CA85D.6080501@chuckr.org> Date: Tue, 27 Nov 2007 18:29:33 -0500 From: Chuck Robey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.9) Gecko/20071107 SeaMonkey/1.1.6 MIME-Version: 1.0 To: Warren Block References: <539c60b90711271248o6eb0b9fw757e40fbcdfdb3c2@mail.gmail.com> <20071127151259.H27150@wonkity.com> In-Reply-To: <20071127151259.H27150@wonkity.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Steve Franks , User Questions Subject: Re: how to compile and install a new driver X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2007 23:31:41 -0000 Warren Block wrote: > On Tue, 27 Nov 2007, Steve Franks wrote: > >> I found this thread >> http://lists.freebsd.org/pipermail/freebsd-stable/2006-August/027445.html >> to a driver I need for my system. >> >> (1) The file extension >> (http://www.dons.net.au/~darius/ucp-0.01.diff.gz) is .diff, not .c, so >> what exactly do I do with it to compile it? > > It's a file produced by diff(1), which shows the differences between > files. Normally, the difference is between the old files and what > someone has changed or added. Also called a patch file, since you use > patch(1) to apply it. patch(1) goes through the diff file and makes all > the changes shown. > Nice description, but you'd better include enough info so that they could make FreeBSD-stype diffs: diff has the unfortunate default of making an output that is compatible with ed(1). This supplies extremely little information to use, in case the file you're trying to patch with that diff has changed, and is also damned hard for mere humans to understand. There are two other options you can give to diff that change the format: -c gives "context" diffs, and -u gives "unified" diffs, and the -u is the option that is standard with FreeBSD. How you do this is to copy the file you intend to change BEFORE you edit the chantes in to "somefile.orig", and then, when you perform the diff, you must give the .orig file first, else you will produce a file that tries to remove the patch instead of applying the patch, like this: diff -u somefile.c.orig somefile.c >patchfile diffs have a standard header on them, and (although it seems that this isn't a FreeBSD standard) you can easily enter in freeform comments before your patch's header, describing the reasons for this patch to be applied (whatever condition this patch fixes). To tell you the truth, that idea of sticking comments at the top of patch files, I got from the crosscompiler site, and it's a great idea, it's how they set up their patches, and we should use it. > In this case, the diff file has changes to several files. > > Looks like it applies to /usr/src/sys. After untarring the file, and as > root: > > # cd /usr/src/sys > # patch < ucp-0.01.diff > > *If* the patch applies successfully, then you can compile. Easiest > would probably be to just rebuild the kernel. Slow, but you know it'll > get everything. > >> (2) Assuming I can get it to compile, which I've never done, what do I >> do with the object/driver file? > > Probably like other ucom(4) devices: > > kldload ucp > > and then access the serial port through /dev/cuaU0. > >> This driver is long overdue, the part has been in usb devices for >> several years, and support is in OpenBSD and Linux already (so I'm >> told by google). I'll happily document the process if someone holds >> my hand. > > That is a good case for a PR. Particularly when you've got a patch, at > least as a starting point. > > -Warren Block * Rapid City, South Dakota USA > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"