wideman-one 
Last edit: 05-03-17 Graham Wideman

Delphi

PortTest:  Test and Demo Program for Delphi I/O for NT
Article created: 98-06-01
Minor edits: 98-06-18

Main Form

To get started, follow the blue-outlined steps.  (You can skip 1 and 2 if you install the gwiopm.sys driver by some other means.)

PortTest_Main.gif (16772 bytes)

At clean-up time, you can follow the red-outlined steps.  However, it's interesting to observe what happens if you don't uninstall the driver.  Next time you start up, that driver is still installed, and still retains the port map as you last left it (as you can verify by using the IOPM form's readback function).


I/O Permissions Map Form

Use this form to set up a permissions map, and then pass it to the NT kernel.   Setting a bit to zero enables I/O (after the driver passes the map to the kernel).

PortTest_IOPM.gif (22496 bytes)


I/O Ports Form

Use this form to manipulate I/O ports.

PortTest_Ports.gif (17585 bytes)


Canned Tests

In both cases, you will need to load the gwiopm driver, start it and open the device before these test will succeed.  Also note that after you have clicked the "Enable Ports" button, these dialogs will update the driver's and kernel's maps, which the main IOPM window will not reflect. To sync the IOPM window's view, hit its "Readback" button.

PortTest_Spkr.gif (3703 bytes)

The PC Speaker test exercises ports on most PC motherboards that control a timer/counter that's used to send pulses to the built-in speaker. On some PCs you may not hear the result if a sound card is installed in a manner that defeats the speaker. Note that while testing, setting a low frequency (like 10 Hz) reduces annoyance to office mates or family members (though they may wonder what you ate for lunch...).

PortTest_VSync.gif (3939 bytes)

The VSync test polls and counts the "Vertical Sync Interrupt Pending" bit on most VGA-compatible cards for a precisely-timed 1 second. This video system was running at 70 frames per second.  (Note: this example demos the technique of reading the vsync interrupt-pending bit... but for other uses it may be a little more complicated than it seems here, as the OS also may be looking at this bit and clearing it behind the scenes.   In this example we get away with it because we hog the CPU.)


Go to:  wideman-one