Plug and Play BIOS Specification

Plug and Play BIOS Specification 1.0A Page 31
4.5.1 Function 0 - Get Number of System Device Nodes
Synopsis:
int FAR (*entryPoint)(Function, NumNodes, NodeSize, BiosSelector);
int Function; /* PnP BIOS Function 0 */
unsigned char FAR *NumNodes; /* Number of nodes the BIOS will return */
unsigned int FAR *NodeSize; /* Size of the largest device node */
unsigned int BiosSelector; /* PnP BIOS readable/writable selector */
Description:
Required. This function will return the number of nodes that the system BIOS will return information for
in NumNodes. These nodes represent only the systemboard devices. In addition to the number of nodes,
the system BIOS will return the size, in bytes, of the largest System Device Node in NodeSize. This
information can be utilized by the system software to determine the amount of memory required to get all
of the System Device Nodes.
The BiosSelector parameter enables the system BIOS, if necessary, to update system variables that are
contained in the system BIOS memory space. If this function is called from protected mode, the caller
must create a data segment descriptor using the 16-bit Protected Mode data segment base address
specified in the Plug and Play Installation Check data structure, a limit of 64KB, and the descriptor must
be read/write capable. If this function is called from real mode, BiosSelector should be set to the Real
Mode 16-bit data segment address as specified in the Plug and Play Installation Check structure. Refer to
section 4.4 above for more information on the Plug and Play Installation Check Structure and the
elements that make up the structure.
The function is available in real mode and 16-bit protected mode.
Returns:
0 if successful - SUCCESS
!0 if an error (Bit 7 set) or a warning occurred - error code (The function return codes are described in
Appendix C)
The FLAGS and registers will be preserved, except for AX which contains the return code.
Example:
The following example illustrates how the 'C' style call interface could be made from an assembly
language module:
.
.
.
push Bios Selector
push segment/selector of NodeSize ; pointer to NodeSize
push offset of NodeSize
push segment/selector of NumNodes ; pointer to NumNodes
push offset of NumNodes
push GET_NUM_NODES ; Function 0
call FAR PTR entryPoint
add sp,12 ; Clean up stack
cmp ax,SUCCESS ; Function completed successfully?
jne error ; No-handle error condition
.
.
4.5.2 Function 1 - Get System Device Node
Synopsis:
int FAR (*entryPoint)(Function, Node, devNodeBuffer, Control, BiosSelector);
int Function; /* PnP BIOS Function 1 */
unsigned char FAR *Node; /* Node number/handle to retrieve */
struct DEV_NODE FAR *devNodeBuffer; /* Buffer to copy device node data to */