Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 1996 15:23:48 -0500 (EST)
From:      Sujal Patel <smpatel@wam.umd.edu>
To:        Bill Bradford <mrbill@ionet.net>
Cc:        freebsd-questions@freebsd.org, freebsd-hardware@freebsd.org
Subject:   Re: Connectix QuickCam with FreeBSD?
Message-ID:  <Pine.BSF.3.91.960115152209.2940D-100000@sl-001.sl.cybercomm.net>
In-Reply-To: <199601151718.LAA28100@ion1.ionet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <dbanarse@sees.bangor.ac.uk>
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 <asm/io.h>
< 
< #include <sys/time.h>
< #include <sys/types.h>
< #include <sys/stat.h>
< #include <fcntl.h>
---
> /* This is where inb and outb are hidden */
> #include <machine/cpufunc.h>
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 <sys/errno.h>
160,162c161
<   f=fopen(CONFIG_FILE,"r");
< 
<   if (f==NULL&&errno!=ENOENT) {
---
>   if( !(f=fopen(CONFIG_FILE,"r")) ) {

------------------------------x------------------------------------






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.960115152209.2940D-100000>