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

next in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810290057.QAA20847>