The Adapter Description Program (ADP) is a very complex theme. The entire description including examples fills about 28 pages in the IBM PS/2 Hardware Interface Technical Reference Manual (see Chapter 8 for the sources).
Due to the limited space and the complexity I will give just a basic explanation for ADPs as described in the first chapter of the HITM.
Adapter Description Program
The Adapter Description Program (ADP) is a program used to configure memory space on an adapter that cannot be handled by normal ADF syntax. Memory adapters that require initialization of more than their POS values, however, should use an initialization program, not an ADP. The ADP is called when the item selected in the ADF contains the appropriate keyword.
Two basic types of memory can be assigned addresses within the memory address space:
- system memory and
- nonsystem memory
System memory is memory that is managed and allocated by the primary operating system. It remains assigned or fixed in the 4GB physical address space, and its content can be accessed or modified only by an independent master (bus master, system master or DMA controller).
Nonsystem memory is memory that is not managed or allocated by the primary operating system. It is made up of memory-mapped I/O devices, memory on adapter that can be directly modified by the adapter, or memory that can be relocated within the address space, such as bank switched and EMS (expanded memory specifications).
The ADP initializes its POS data in the POS array and updates the parameter block. It must be in an EXE program format, should not exceed 10KB, and start its code at offset hex 100. The filename for the ADP is
C{card-ID}.ADF
Notes:
- Memory address space is the only system resource that can be allocated by an ADP.
- The Set Configuration program does not include support for memory adapters that have translation tables.
- ADPs should not output directly to the display or prompt the user for input; unpredicatable results will occur.
- To ensure system integrity, ADPs must not write directly to locations in nonvolatile RAM.
Syntax for ADPs
There are three keywords in the ADF that define an ADP:
SysMem is used to assign address space to system memory, Exec is used to assign address space to nonsystem memory.
System Memory ADPs
The SysMem keyword in the ADF indicates that the adapter contains system memory and that an ADP is used to configure the adapter's POS data and the amount of its system memory.
Adapters should not split their memory between 1MB to 16MB range and the 16MB to 4GB range unless the memory is contigous across the 16MB address.
System memory is the first resource allocated by the Set Configuration program. The system memory ADPs are run before other resources are allocated in the following priority:
- System board memory
- Memory address size (24-bit address followed by 32-bit)
- Memory granularity (larger blocks first)
- Slot number starting with connector 1
If the ADP is not found by the Set Configuration program, the user is prompted to insert the appropriate disk into drive A. If the ADP still is not found, the adapter is disabled.
Nonsystem Memory ADPs
An ADP can be used by adapters that want to map nonsystem memory into the address space above 1MB. The memory on these adapters does not get included as part of the top of memory value stored in CMOS RAM. This memory must be mapped starting at the highest addressable location and counting down.
The Exec keyword, included within a NamedItem in the ADF, indicates that the adapter has an ADP. It should be the last Choice of the NamedItem list. The ADP is run at the time that Choice is selected. If the ADP cannot be found by the Set Configuration program the user is prompted to insert the appropriate disk into drive A. If the ADP still cannot be found, the adapter will be disabled if that Choice is selected. When the Exec keyword is used, POS bits that are set by the ADP are indicated by X's.
The following example shows how the Exec keyword is used:
nameditem
Prompt "Adapter Memory Location"
Choice "Segment C000"
pos[1]=XXXX0000b mem 0c0000h-0c3fffh
Choice "Segment C400"
pos[1]=XXXX0001b mem 0c4000h-0c7fffh
Choice "Segment C800"
pos[1]=XXXX0010b mem 0c8000h-0cbfffh
Choice "Segment CC00"
pos[1]=XXXX0011b mem 0cc000h-0cffffh
Choice "Segment D000"
pos[1]=XXXX0100b mem 0d0000h-0d3fffh
Choice "Segment D400"
pos[1]=XXXX0101b mem 0d4000h-0d7fffh
Choice "Segment D800"
pos[1]=XXXX0110b mem 0d8000h-0dbfffh
Choice "Segment DC00"
pos[1]=XXXX0111b mem 0dc000h-0dffffh
Choice "ROM Disabled"
pos[1]=XXXX1XXXb
Choice "ROM Enabled"
pos[1]=xxxxxxxxb exec
Help
"To configure this adapter you must choose the memory
location the adapter will use for it's BIOS ROM.
There are eight memory locations that can be selected.
Under normal circumstances, select [Segment C800]."
Maintainers' Note about ADPs
If you want to know more about the programming of the ADPs it is recommended to have the IBM PS/2 Hardware Interface Technical Reference Manual and the IBM PS/2 PC BIOS Interface Technical Reference Manual at hand.
The above introduction is followed by another 25 pages of programming considerations and examples in the HITR-Manual - but I don't want to bother you with this stuff.
I thought it were important to basically know what ADPs are and how they are invoked in the ADF and how to recognize that an ADF requires an ADP. And I'm confident that the part written above will do for that purpose.
|