From owner-freebsd-current Wed Oct 28 17:15:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA01628 for freebsd-current-outgoing; Wed, 28 Oct 1998 17:15:26 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from pinhead.parag.codegen.com (ppp-pm3-02--072.sirius.net [205.134.231.72]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA01602 for ; Wed, 28 Oct 1998 17:15:20 -0800 (PST) (envelope-from parag@pinhead.parag.codegen.com) Received: from pinhead.parag.codegen.com (localhost.parag.codegen.com [127.0.0.1]) by pinhead.parag.codegen.com (8.9.1/8.8.8) with ESMTP id QAA20847; Wed, 28 Oct 1998 16:57:31 -0800 (PST) (envelope-from parag@pinhead.parag.codegen.com) Message-Id: <199810290057.QAA20847@pinhead.parag.codegen.com> X-Mailer: exmh version 2.0.2 2/24/98 To: current@FreeBSD.ORG cc: tjm@codegen.com, eric@needhams.com Subject: Mod to doscmd's port.c to directly access parallel ports X-Face: =O'Kj74icvU|oS*<7gS/8'\Pbpm}okVj*@UC!IgkmZQAO!W[|iBiMs*|)n*`X ]pW%m>Oz_mK^Gdazsr.Z0/JsFS1uF8gBVIoChGwOy{EK=<6g?aHE`[\S]C]T0Wm X-URL: http://www.codegen.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 28 Oct 1998 16:57:31 -0800 From: Parag Patel Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message