From owner-freebsd-hardware Mon Jan 15 12:24:27 1996 Return-Path: owner-hardware Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA05831 for hardware-outgoing; Mon, 15 Jan 1996 12:24:27 -0800 (PST) Received: from sl-001.sl.cybercomm.net (sl-001.sl.cybercomm.net [199.171.196.129]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA05816 Mon, 15 Jan 1996 12:24:13 -0800 (PST) Received: from sl-001.sl.cybercomm.net (localhost [127.0.0.1]) by sl-001.sl.cybercomm.net (8.6.12/8.6.12) with SMTP id PAA03132; Mon, 15 Jan 1996 15:23:48 -0500 Date: Mon, 15 Jan 1996 15:23:48 -0500 (EST) From: Sujal Patel X-Sender: smpatel@sl-001.sl.cybercomm.net To: Bill Bradford cc: freebsd-questions@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Connectix QuickCam with FreeBSD? In-Reply-To: <199601151718.LAA28100@ion1.ionet.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hardware@freebsd.org Precedence: bulk On Mon, 15 Jan 1996, Bill Bradford wrote: > Has anyone ported software or gotten a Connectix QuickCam to work > with FreeBSD? I tried the Linux program "qcam", but it gives me > an error message about architecture problems. I'm running 2.1 on > a P120 here at work, and 2.0.5 on my DX2/66 at home. Yes... I haven't tried it, but here it is: --- Begin Forwarded Message --- >From POPmail Fri Jan 12 08:45:55 1996 Received: from ns.crynwr.com (ns.crynwr.com [192.203.178.14]) by po1.wam.umd.edu (8.6.10/8.6.12) with SMTP id IAA11256; Fri, 12 Jan 1996 08:43:09 -0500 Received: from hermes.sees.bangor.ac.uk by ns.crynwr.com with smtp (Smail3.1.29.1 #57) id m0taj41-000G38C; Fri, 12 Jan 96 07:58 EST From: D S Banarse Date: Fri, 12 Jan 96 12:58:27 GMT Message-Id: <3942.9601121258@hermes.sees.bangor.ac.uk> Received: from brains.sees (brains.sees.bangor.ac.uk) by hermes.sees.bangor.ac.uk; Fri, 12 Jan 96 12:58:27 GMT To: linux-connectix@crynwr.com Status: RO X-Status: Subject: qcam port to FreeBSD We have ported your qcam to FreeBSD. If you are interested we have included in this mail the diff needed to create qcam-FreeBSD.c from qcam-Linux.c Makefile also had to be tweeked so it's diffs have been included too. qcam-lib.c also had a minor tweek - diffs included. ==============================X==================================== Diffs for qcam-Linux.c to create qcam-FreeBSD.c follow NOTE: qcam-Linux.h must also be copied to qcam-FreeBSD.h ------------------------------x------------------------------------ 1c1 < /* qcam-Linux.c -- Linux-specific routines for accessing QuickCam */ --- > /* qcam-FreeBSD.c -- FreeBSD-specific routines for accessing QuickCam */ 34,39c34,35 < #include < < #include < #include < #include < #include --- > /* This is where inb and outb are hidden */ > #include 42c38,41 < #include "qcam-Linux.h" --- > #include "qcam-FreeBSD.h" > > /* No ioperm function under FreeBSD - open /dev/io instead */ > FILE * IOPerm; 44,48c43,57 < int read_lpstatus(struct qcam *q) { return inb(q->port+1); } < int read_lpcontrol(struct qcam *q) { return inb(q->port+2); } < int read_lpdata(struct qcam *q) { return inb(q->port); } < void write_lpdata(struct qcam *q, int d) { outb(d,q->port); } < void write_lpcontrol(struct qcam *q, int d) { outb(d,q->port+2); } --- > int read_lpstatus(struct qcam *q) { > return( (int) inb( (unsigned int)(q->port+1) ) ); > } > int read_lpcontrol(struct qcam *q) { > return( (int) inb( (unsigned int)(q->port+2) ) ); > } > int read_lpdata(struct qcam *q) { > return( (int) inb( (unsigned int)(q->port) ) ); > } > void write_lpdata(struct qcam *q, int d) { > outb( (unsigned int)(q->port), (unsigned char)d ); > } > void write_lpcontrol(struct qcam *q, int d) { > outb( (unsigned int)(q->port+2) ,(unsigned char)d ); > } 53,54c62,65 < if(q->port>0x3bc) return 1; < return (ioperm(q->port, 3, 1)); --- > if(q->port>0x3b8) return 1; > if( (IOPerm = fopen("/dev/io","r"))!=NULL ) > return 0; > else return 1; 59c70 < return (ioperm(q->port, 3, 0)); --- > return (fclose(IOPerm)); 142d152 < ==============================X==================================== Diffs on Makefile for FreeBSD follow ------------------------------x------------------------------------ 1c1 < # Makefile for QCAM under Linux --- > # Makefile for QCAM under FreeBSD 35c35 < $(CC) $(LDFLAGS) -o qcam qcam.o -L. -lqcam --- > $(CC) $(LDFLAGS) -L. qcam.o -o qcam -lqcam 38c38 < ln -sf qcam-`uname`.h qcam-os.h --- > ln -sf qcam-FreeBSD.h qcam-os.h 41c41 < ln -sf qcam-`uname`.c qcam-os.c --- > ln -sf qcam-FreeBSD.c qcam-os.c 48a49,51 > xqcam.o: xqcam.c qcam.h qcam-os.h > $(CC) $(CFLAGS) -I/usr/X11R6/include -c xqcam.c > 62d64 < 66c68 < ar rcs $@ $^ --- > ar r $@ qcam-lib.o qcam-os.o ==============================X==================================== Diffs on qcam-lib.c for FreeBSD follow ------------------------------x------------------------------------ 38a39 > #include 160,162c161 < f=fopen(CONFIG_FILE,"r"); < < if (f==NULL&&errno!=ENOENT) { --- > if( !(f=fopen(CONFIG_FILE,"r")) ) { ------------------------------x------------------------------------