windows port access

Jon Nicoll jkn at nicorp.f9.co.uk
Mon Jul 16 18:12:03 EDT 2001


Hi Chris

[...]
> 
> Unfortunately what Bryan is asking is not what you are answering.  He wants
> to access the I/O port 0x280, which he states is assigned to a "custom ISA
> card" which (I assume) is not using the standard parallel port interface,
> nor
> serial, etc. and for which he evidently has no driver.

This is exactly what my code can be used for - you can set it up to
get access to arbitary IO ports (via the ioperm mechanism in Linux),
and then read or write etc. as you like. Admittedly, it doesn't
currently cater for interrupts.

I originally started writing this to drive an ISA 8255/8253 card, and
although this project-ette is currently in limbo, the basics are all
there and working, if Bryan wants to do eg. polled access to an A/D
card etc.

> Under Linux, this can be done in C by following the instructions in the
> "IO Port Programming mini-HOWTO" (check any Linux portal, i.e. linux.com,
> for this document).

All done! ;-)

> [...]
 
> Under Win32 I'm not sure what the procedure is, but I suspect a VxD file
> will
> be needed.

You don't need a VxD (for W95 at least), although it's probably the
'better' way of doing things. My code is in C and turns into a little
'.PYD' (= .DLL) file. In NT, you need a kernel mode driver, which I
haven't yet got around to looking at.

I've just resurrected my code and am looking at using distutils to get
it in a form more easily distributed. Email me if would be of use to
you in the meantime.

	Jon N



More information about the Python-list mailing list