2

Is there any chance how I could write something to ISA card in Visual Basic .Net for Windows XP and higher? (I know Win XP and higher have restriction so U cant directly write data to port)

I have also done some research and if I understand the situation I have only 2 options:

  1. Write driver (very problematic option :)) or

  2. Try to use existing driver in kernel32 like driver to serial/paralel port.

If there arent any other options, how I have to modify "using of serial/paralel port" to use it for ISA port?

Jonas
  • 121,568
  • 97
  • 310
  • 388
astromedia
  • 75
  • 7
  • Are you trying to write to the ISA bus in general, or are you trying to communicate with a specific ISA card? If so, what card is it? – J... Nov 04 '12 at 12:56
  • Im trying to write to specific ISA Card (Controling some kind of LED Panel) but im not sure what type it is, old HW is not my domain :) – astromedia Nov 04 '12 at 13:13
  • So...how do you expect to communicate with it if you don't know what it is? Do you have a communication protocol? Documentation about its functions? – J... Nov 04 '12 at 18:39
  • I dont expected i must know specific type, i know hexa addresses and bytes what i have to write on to light led on specific address, also i know some inicialization for reset - write core program to card - test it ... if i have to know something else i could try to find it somwhere, i expected there arent so diferent types of ISA Cards, so what info i have to get? – astromedia Nov 04 '12 at 21:01

1 Answers1

1

Modern versions of Windows will not allow direct port I/O from a user application. Your program is running in Ring 3, not Ring 0. You need some kind of driver to do the port I/O on your application's behalf.

The first thing to do would be to contact the card manufacturer and see if they made a Windows driver for your board.

If a Windows driver is not available, and you are only looking to do basic reigster reads and writes (no interrupts or DMA), there are some freely-downloadable libraries that you can download to do port I/O. Basically, the library includes a dummy "driver" that sits in Ring 0 and does the I/O for you. I have the most experience with WinIO.

WinIO has a C/C++ API, nothing .Net/CLR. You will need to use P/Invoke to call the WinIO functions from managed code.

If you search around, you may find a toolkit similar to WinIO that provides APIs for managed code. (Edit: Here is one I have bookmarked called DirectIO.)

The biggest problem with WinIO is that you are limited to basic register reads/writes. If you need interrupts or DMA, you are out of luck. At that point, you will need to write a "real" driver.

Writing a driver can be a pretty major task for the uninitiated (there is a lot you will screw up). You will need to start by getting a copy of the Windows Driver Kit, and studying Microsoft's Kernel Mode Driver Framework. You could also look into purchasing a copy of Jungo WinDriver. WinDriver is a third party tool that simplifies driver development considerably, but it is quite expensive for a one-off project.

myron-semack
  • 6,259
  • 1
  • 26
  • 38
  • 1
    Thx for answer, im pretty sure there isnt any driver, i have done some research in WDK and sample driver as you said for worst option but as you saing its a pretty major task and there is lot of to screw up :) ... If WinIO could write and read to/from ISA card it will solve my problem becouse i think i dont need nothing more. I will test it as soon as I could (i must get some old computer with isa slot and some isa card i could destroy if somethink went wrong - i dont want to destroy target device for my project :) ) and I will report here how thing going. (I hope i translated it right :) ) – astromedia Nov 06 '12 at 21:40