The Adapter Description Program (ADP) is a very complex topic. The entire description including examples fills about 28 pages in the IBM PS/2 Hardware Interface Technical Reference Manual (see THIS 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.
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 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:
Cxxxx.ADF where xxxx is Adapter ID
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 contiguous 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:
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.
Non-system 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=XXXX0000b mem 0c0000h-0c3fffh Choice "Segment C400" pos=XXXX0001b mem 0c4000h-0c7fffh Choice "Segment C800" pos=XXXX0010b mem 0c8000h-0cbfffh Choice "Segment CC00" pos=XXXX0011b mem 0cc000h-0cffffh Choice "Segment D000" pos=XXXX0100b mem 0d0000h-0d3fffh Choice "Segment D400" pos=XXXX0101b mem 0d4000h-0d7fffh Choice "Segment D800" pos=XXXX0110b mem 0d8000h-0dbfffh Choice "Segment DC00" pos=XXXX0111b mem 0dc000h-0dffffh Choice "ROM Disabled" pos=XXXX1XXXb Choice "ROM Enabled" pos=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]."
Peter's 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.