By Güerino Palacios
Two simple function for acces i/o ports skiping H.A.L
Introduction
I write this DLL for direct access i/o ports in windows NT/2K/Xp
Background
For compile all project you need VC71-2003. For compile kioport.sys you may have to install DDK. Kioport is based in PortTalk.sys from article: “Beyond Logic Port Talk I/O Port Driver”, http://www.beyondlogic.org/, and “A DDK's project wizard for VC2003” article http://www.thecodeproject.com/macro/ddkwizard.asp .
Using the code
1 - Copy kioport.sys in /windows/system32/drivers
2 - Add kioport.reg to register windows
3 - Reboot windows for activate service in register of windows.
4 - Add kport.h in your project and kport.lib
5 - Put Kport.dll in your same directory of application.
Using the Kport-DLL
is so easy. Here is the function definition and the explanation follows:
// Returns a value from specific ports. BYTE Inportb(WORD PortNum); // Write a value to specific ports. void Outportb(WORD PortNum, BYTE byte);
PortNum: is a number port for example 0x378 ( LPT1).
BYTE: data to send for specific PortNum in Ouportb, and data received in Inportb.
How use Sample-Dlg
1 – Write a number bellow text “Write Value( )”, and click in Write button.
2 - Click in Read button.
History
First version april 3/2005.