Home |
RTTarget-32 Programming Manual Function RTT_PNP_CallPnPBIOS System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTT_PNP_CallPnPBIOSThis function performs a PnP BIOS call: int RTT_PNP_CallPnPBIOS(void * Data, WORD DataSize, WORD Parameters[]); ParametersDataCan point to a data buffer through which the BIOS and the application can exchange information. All data to which pointers are passed to the BIOS must be located in this data area. DataSizeSpecifies the size of the buffer. RTTarget-32 will create an appropriate 16-bit segment spanning the data to be passed to the 16-bit BIOS. ParametersMust contain the WORD parameters to be passed to the BIOS in the order they appear in the BIOS function declaration. 16-bit FAR pointers must be expanded to offset:segment values according to the following rules: The segment to parameters in *Data is RTT_PNP_STUB16DS. Their offset is the offset relative to *Data. Parameter BiosSelector is RTT_PNP_BIOS16DS. return valueRTT_PNP_SUCCESS or an error code, see section Plug-and-Play BIOS. An example to call PnP BIOS function 0 (GetSystemNodes) follows. The PnP BIOS Specification declares function 0 as: 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 Thus, a total of 6 WORD parameters are required (each 16-bit far pointer needs a 16-bit offset and a 16-bit segment; each int needs 16-bits here). The parameters need to be filled as follows: P[0] = 0; // function number is zero P[1] = RTT_STRUCT_OFS(WorkSpace, Nodes); // offset Nodes P[2] = RTT_PNP_STUB16DS; // segment Nodes P[3] = RTT_STRUCT_OFS(WorkSpace, Size); // offset Size P[4] = RTT_PNP_STUB16DS; // segment Size P[5] = RTT_PNP_BIOS16DS; // BIOS data selector where WorkSpace is defined as: struct { WORD Nodes; WORD Size; } WorkSpace; The BIOS can then be called with: Result = RTT_PNP_CallPnPBIOS(&WorkSpace, sizeof(WorkSpace), P); Demo program BIOSDemo demonstrates how to call the PnP BIOS and contains additional examples of using function RTT_PNP_CallPnPBIOS.
|