Need to use hardware interrupts to handle I/O ports and DMA in Windows XP

Started by reiniersb, February 12, 2007, 10:04:44 PM

Previous topic - Next topic

reiniersb

Hello everyone

I need to know the way to handle hardware interruptions using MASM32. The thing is that I have to program an aplication that use the parallel port in ECP mode to control one A/D and one D/A converter and I have to handle the port interruption. Also have to use de DMA to manage data flow and control the frequency for data adquisition. I know that can't do it in the old way due to the application has to work under Windows XP, so the protected mode and the rings level are a wall to this subject. I will apreciate any help or clue you people can give me.

Thank's

hutch--

Sounds like you need to write a device driver for the OS version you have in mind. If you need reasonably high speed for he logging of data, the higher level APIs may not be fast enough or flexible enough.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

reiniersb

hi again

This is what I need: I need to develop an independent application that will work under Windows XP. This application is intended to implement the control for a simple process, so it will have to adquire and return data through a computer port. I'm planning to use the LPT port due to the A/D and D/A chips that are available have parallel interface. I need to do this in MASM so all I need to know is how I can capture the interruption event of the parallel port, the DMA controller and the timer module. I have done this in Win9x changing the interruptions vectors to my own interruption routines, wich is very simple, but in NT, 2000 and XP it will raice an exception. I wonder if the way is the use of APIs, the implementation of a system hook or something like that.
In MASM32 I will able to do that?
How?

MichaelW

Could this be done from a 16-bit DOS application running under Windows XP? I have doubts that the DMA would work, but on a fast system you might be able to implement a workable replacement in software.

eschew obfuscation

reiniersb

I already tried with 16 & 32 bits DOS applications. It equally raice exception because this appications have not permission to write in certain port addresses (for example the 378h-37Fh corresponding to parallel port). In order to solve this I used the port-talk application, which allow the use of I/O addresses directly from assembly instructions (this is done by the port-talk with a trick, it raices ones application and get its process name so it can change its I/O write permissions in system protected ports), with it I can handle the LPT port and configure the DMA controller, but still I'm unable to handle the interruption event in them.
I have heared about the use of a "gate descriptor", which is a way of doing something like the interruption vector change in real mode. This is something like to create a gate descriptor which points to my interruptions routines and then exchange it with the system interruption descriptor, but this is not so clear to me, and I wonder if XP will allow me to do that. What do you think?

GregL

reiniersb,

You need to use the Windows APIs (CreateFile, ReadFile and WriteFile) or a Device Driver.

Here's some info Parallel Port Central - Programming