Description
A number of operations is supported with the Generic I/O Library. This section describes the use and functionality on each one. To bring up the available operations select a script entry then Mouse right-click the operation field. With the current version of the Generic I/O DLL the following operations are available:
- Input
- Output
- Wait
- Event
- Goto Entry ID
- Port Offset
- Data Offset
The operation field should be the first field to be modified when configuring a script entry. Other fields check for the Operations field before setting up their data. For instance a Goto Entry ID operation does not use a mask or mask data while an Output operation does.
Input
Performs an I/O Read operation from the defined port using the data type specified in the type field, using the selected mask and mask-data, for the number of times shown in the loop field and waits for the delay specified. The mask applies to the data field at the end of the read operation. The delay is executed before the read operation. Note that when the loop field is 0 it specifies a single execution of a script line.
Example
Read from port 0x21 which is the first 8259 PIC interrupt mask register the script will be:


Output
Performs an I/O Write operation to the defined port using the data type specified in the type field, using the selected mask and mask-data for the number of times shown in the loop field and waits for the delay specified. The mask applies to the data field before the write operation. The delay is executed before the write operation. Note that when the loop field is 0 it specifies a single execution of a script line.
Example
Write to port 0xCF8 a DWORD select the ID register of the first device in the PCI Bus-0. The script line will be:


Wait
Performs a delay for the specified wait period under the Wait field in mSecs.
Event
Waits on an event for the specified wait time, by doing read operations from the specified port using the specified mask, mask data and data type and comparing the data read with the data specified in the data field. The mask is applied to the data read from the port. Read port access is continuous until the Wait interval expires.
Example
Wait for 5 seconds for the keyboard controller if it has data for the system. Will check port 0x64 which is the Keyboard Status Register. Pressing/Releasing a key or moving the mouse will activate this event (PS/2 devices). The script line will be:


Goto Entry ID
This is a loop based command that iterates through previous script lines. The Data field specifies the identifier to go to. The Loop field is the number of times this command will go to the specified script line. The Goto Entry ID command will not execute if the loop field is set 0. The other fields are ignored.
Port Offset
The port offset command searches previous script entries from its ID location (From current ID to the top of the table ID=0) for Input and Output operations. If such an operation is found it adjusts the port value by a signed offset specified in the port field and executes the same operation with the port value adjusted. The other fields for the Port Offset operation need to be specified (mask, mask data, delay etc as with the Input/Output operations) because only the port value is used. Only the first Input/Output operation found will be used by this command. The Port Offset operation can be best used with scripts that have Goto Entry ID operations and read from devices with multiple ports.
Example
Read the PIC mask registers for both 8259s using port offset:


Notice the Port value under the Port Offset operation is signed decimal value, while the Port value for the Input operation is in hex. In this example the Port Offset is calculated as 33+128 = 161 which is port 0xA1.
Data Offset
The data offset command searches previous script entries from its ID location (From current ID to the top of the table ID=0) for Output operations. If such an operation is found it adjusts the data value by a signed offset specified in the data field and executes the same operation with the data value adjusted. The other fields for the Data Offset operation need to be specified (mask, mask data, delay etc as with the Output operations) because only the data value is used. Only the first Output operation found will be used by this command. The Data Offset operation can be best used with scripts that have Goto Entry ID operations and write to devices with multiple ports.
Example
Read the first 16 registers of the first chipset device using DWORD data type. The script will be:


Notice the data field under the Data Offset operation is a signed decimal value, while the Data value for the Output operation is in hex. In this example the Data Offset is adjusted in increments of 4 writing to data to Port 0xCF8 the values 0x80000004, 0x80000008, 0x8000000C, 0x80000010. Notice the Goto Entry ID operation jumps to the input operation as going to ID 0 would reset the Data field to 0x80000000.
Controlling Entries
Editable fields within the script table can be changed by simply clicking the field and altering the number within it. Other fields like the data/mask types can be change by doing a right-click operation on the specific script entry and field. Such a user operation will invoke a popup menu with additional options. Some of the options already discussed in earlier section like the operations and mask types.
In addition to the field specific options the user may add, insert, remove, paste a script entry or clear the entire script table. These are the general script options and are always included with this menu.
Below there is a table that describes how to control script entries. Please note using the new entry option you may append or insert an entry inside the script table. A script can also be saved with the save and restored with the load option.
| New Entry |
To add a new entry to the script table do the following:
- Scroll down the list box to the end of the table and point the mouse on an empty cell.
- Mouse right-click.
- Select New Entry
|
| Insert an Entry |
To insert an entry to the script table do the following:
- Scroll down the list box and select the row you want to insert the entry
- Mouse right-click.
- Select New Entry
|
| Delete an Entry |
To delete an entry from the table do the following:
- Mouse left-click to select the entry you want to delete.
- Mouse right-click to bring up the options menu.
- Select Cut Entry
|
| Paste an Entry |
To paste an entry to the table do the following:
- Mouse right-click to bring up the options menu.
- Select Paste Entry
In a paste operation the entry goes at the end of the table. The entry stored is the one from the last Cut operation.
|
| Clear Table |
To clear the entire table do the following:
- Mouse right-click to bring up the options menu.
- Select Clear Table
|
| Change Operation |
To change the operation of a script entry do the following:
- Mouse left-click to select the entry you want to modify.
- Mouse right-click on the Operation column for this entry.
- Select the Operation needed
The Port Offset and Data Offset operations are not available for the first entry of the table.
|
| Change Mask |
To change the mask of a script entry do the following:
- Mouse left-click to select the entry you want to modify.
- Mouse right-click on the Mask column for this entry.
- Select the Mask needed
|
| Change Data Type |
To change the Data Type of a script entry do the following:
- Mouse left-click to select the entry you want to modify.
- Mouse right-click on the Type column for this entry.
- Select the Type needed
Note that the Type field has no meaning for the Goto Entry ID and Wait commands.
|
Data types
A number of Data Types are available for I/O operations. This section describes the use and functionality on each one. To bring up the available Data Types select a script entry then Mouse right-click the Type field. With the current version of the Generic I/O DLL the following data types are available:
- BYTE Interprets the Data and Mask fields as an unsigned 8-bit value.
- WORD Interprets the Data and Mask fields as an unsigned 16-bit value.
- DWORD Interprets the Data and Mask fields as an unsigned 32-bit value.
.