Solved

Interruptions (Visual C++ 4.2)

Posted on 1997-03-03
4
245 Views
Last Modified: 2013-12-03
I have to control an own ISA card. I have programmed interruptions with BC++ but I tryed with VC++ but it didn't work. I tryed with C files.

I want to know what instructions I have to use and what options I have to choose when I compile.
0
Comment
Question by:jcordon
  • 2
4 Comments
 
LVL 3

Expert Comment

by:sperling
ID: 1334187
Is this win16, win95 or win nt? You cannot control HW inside an user-mode Win32 app, you'll need to write a VxD(95) or driver(NT)
0
 

Author Comment

by:jcordon
ID: 1334188
I'm working with windows 95.
Are you sure that this is the only way?

Can't I use rutines like in BC++ :
For example with "interrupt" , "intdosx" or something like that.
0
 

Author Comment

by:jcordon
ID: 1334189
I'm working with windows 95.
Are you sure that this is the only way?

Can't I use rutines like in BC++ :
For example with "interrupt" , "intdosx" or something like that.
0
 
LVL 2

Accepted Solution

by:
amartin030297 earned 100 total points
ID: 1334190
You are approaching your problem from a DOS perspective rather than Windows (err.. "User", "Client", or "Ring3").

What you are executing when you build a win32 application is
running is "User" space.  The whole concept of directly controlling interrupts doesn't apply to you. (Oh my God you say!). But when you think about it, what if someone starts
say.... two or three instances of your app! Or worse, what if
someone is sharing that interrupt w/you.

The answer? Well-- since you're using Windows 95, you'll need
to write a VxD (much more simple/documented than writing an
NT Driver IMHO).  I recommend you purchase either the MS Device Driver Kit, or but Vireo's VToolsD (www.vireo.com) for about $400.

So-- what happens is your VxD (which is just simple C or C++ code if you buy Vireo-- I wrote and I/O trapper in minutes!) actually traps the hardware interrupt, and virtualizes I/O's to your ISA card address (See VIOPort using Vireo).  Then whenever your "User" app (be or Dos or win32!) accesses the port, or uses DeviceIOCTL (just a call into your VxD), you setup a statemachine for that Virtual Machine (which is just a unique ID (err...pointer)) for whatever process sent whatever command.  Thus you can have multiple apps using your device, OR, you can not grant access to other processes when someone has "Opened" the device.. its your decision.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now