Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Oct 1998 18:18:01 -0800
From:      Eric Cox <eric@needhams.com>
To:        Parag Patel <parag@cgt.com>
Cc:        current@FreeBSD.ORG, tjm@codegen.com
Subject:   Re: Mod to doscmd's port.c to directly access parallel ports
Message-ID:  <3637D059.80889AB6@needhams.com>
References:  <199810290057.QAA20847@pinhead.parag.codegen.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3637D059.80889AB6>