Re: XP drivers for I/O?

From: David Lindauer (spamtrap_at_crayne.org)
Date: 10/16/04


Date: Sat, 16 Oct 2004 17:48:27 +0000 (UTC)

I found a gotcha when I compiled it with something other than visual studio...
the interface structure used in the DEVIOCTL call is declared with 12 bytes,
but VS apparently pads it out to 16. So unless you are using a
microsoft-compatible compiler or you recompile the service code as well you
need to declare it as 16 bytes and pass 16 bytes as the size in the DEVIOCTL.
The service apparently checks the size. Other than that it worked great....

David

Dave W wrote:

> David,
>
> Thanks I'll check it out in detail. At first glance this looks very
> promising.
>
> Dave W.
>
> "David Lindauer" <spamtrap@crayne.org> wrote in message
> news:41698418.6720BD05@bluegrass.net...
> > hi,
> >
> > I just found a WINNT service that allows you to access both I/O ports and
> > physical memory from Win32 user space. It works ok on XP. The code for
> the
> > service, and load and unload functions are there, as well as a C++ dll
> (visual
> > studio) that interacts with the service and some demo programs. Just
> looking at
> > the code for the DLL, it would be *extremely* easy to convert the code to
> C or
> > assembly, it basically boils down to C++ class wrappers around WIN32 api
> calls
> > that access the service. The IO is direct from user space, but you need
> > DevIOCTL calls to map and unmap physical memory.
> >
> > here it is:
> >
> > http://www.bbdsoft.com/iomemory.html
> >
> > there seem to be versions of win9x as well :)
> >
> > David
> > Dave W wrote:
> >
> > > I've been teaching a college level course on and off thru the years on
> x86
> > > asm and arch. Last time I taught we had Win 98 and of course this OS
> > > allowed anyone to access the PC I/O like serial ports, ISA bus, printer
> > > ports,etc. Of course the new OSs like XP don't allow that. I've been
> > > looking into writing a driver for an ISA proto board at the school, but
> it
> > > appears Win driver development with the MS DDK is not a trivial task -
> > > especially if you wanted to stay in assembly. Has anyone seen a hack
> ( a
> > > driver in assembly) or other workaround for this problem? Don't get me
> > > wrong, I agree with the need for drivers in the newer OSs, and I'm not
> > > trying to open this up to a discussion about the need for drivers for
> > > hardware access. But for teaching, a driver is a distraction. For
> now, I
> > > believe we will just scrounge up some Win 95/98 boxes and run with it.
> But
> > > eventually it would be nice to develop code and control I/O on the
> something
> > > like Win2K or XP.
> > >
> > > Thanks,
> > >
> > > Dave
> >