From owner-freebsd-current Wed Oct 28 18:20:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA13006 for freebsd-current-outgoing; Wed, 28 Oct 1998 18:20:22 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from mail (needhams.quiknet.com [207.183.237.4]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id SAA12983 for ; Wed, 28 Oct 1998 18:20:14 -0800 (PST) (envelope-from eric@needhams.com) Received: from needhams.com by mail with smtp (Smail3.1.29.1 #3) id m0zYhf0-00093oC; Wed, 28 Oct 98 18:18 PST Message-ID: <3637D059.80889AB6@needhams.com> Date: Wed, 28 Oct 1998 18:18:01 -0800 From: Eric Cox X-Mailer: Mozilla 4.5 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: Parag Patel CC: current@FreeBSD.ORG, tjm@codegen.com Subject: Re: Mod to doscmd's port.c to directly access parallel ports References: <199810290057.QAA20847@pinhead.parag.codegen.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi Parag! I don't know that much about FreeBSD (the only thing I've done on FreeBSD is setup a news feeder), but it looks to me like i386_set_ioperm is being called with the same parameters under iomap or iounmap (i.e. the two calls are the same, functionally). For all I know this is the way it's supposed to be - just caught my eye. Thanks (!) for your help on this. I'll have to try this at home, and if successful, I'll stick it up on the website... Eric Parag Patel wrote: > I just acquired a Needhams EMP-10 EPROM programmer and wanted to run it > directly under FreeBSD 3.0-CURRENT. > > So I modified doscmd's port.c to let me run the Needham DOS software > which wants direct access to a parallel port. I needed the following > patch to let me access the real I/O ports from the emulator to get to > the parallel port. > > With this patch, I can run "doscmd -x -b -i0x378:8 -o0x378:8" as root, > connect up the EMP-10, and the Needhams software directly accesses the > parallel port from the DOS emulator window. Nice! > > Would someone who knows this stuff better than me (not difficult) check > the mod for me, and if it's sane, please check it in? Thanks! > > -- Parag > > Index: port.c > =================================================================== > RCS file: /src/freebsd/src/usr.bin/doscmd/port.c,v > retrieving revision 1.1 > diff -c -r1.1 port.c > *** port.c 1997/08/09 01:42:54 1.1 > --- port.c 1998/10/29 00:48:31 > *************** > *** 59,73 **** > static void > iomap(int port, int cnt) > { > ! fatal("iomap not supported"); > } > > static void > iounmap(int port, int cnt) > { > ! fatal("iomap not supported"); > } > - > #else > static void > iomap(int port, int cnt) > --- 59,88 ---- > static void > iomap(int port, int cnt) > { > ! if (port + cnt >= MAXPORT) { > ! errno = ERANGE; > ! goto bad; > ! } > ! if (i386_set_ioperm(port, cnt, 1) < 0) { > ! bad: > ! perror("iomap"); > ! quit(1); > ! } > } > > static void > iounmap(int port, int cnt) > { > ! if (port + cnt >= MAXPORT) { > ! errno = ERANGE; > ! goto bad; > ! } > ! if (i386_set_ioperm(port, cnt, 1) < 0) { > ! bad: > ! perror("iounmap"); > ! quit(1); > ! } > } > #else > static void > iomap(int port, int cnt) -- NEEDHAM'S ELECTRONICS : (916) 924-8037 (Voice) Device Programmers : (916) 924-8065 (Fax) 4630 Beloit Drive, #20 : (916) 924-8094 (BBS) Sacramento, CA 95838 : http://www.needhams.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message