Compaq Computer Corporation Phoenix Technologies Ltd. Intel Corporation Plug and Play BIOS Specification Version 1.0A May 5, 1994 This specification has been made available to the public. You are hereby granted the right to use, implement, reproduce, and distribute this specification with the foregoing rights at no charge. This specification is, and shall remain, the property of Compaq Computer Corporation ("Compaq") Phoenix Technologies LTD ("Phoenix") and Intel corporation ("Intel").
Plug and Play BIOS Specification 1.0A 1.3.1 Bi-modal functionality 1.3.2 OS Independence 1.3.3 Expandability 1.4 Installation Structure Page 2 6 6 6 7 2.0 System BIOS Initialization __________________________________________________________7 2.1 System BIOS POST Requirements 7 2.1.1 System Board Storage Requirements 8 2.1.2 System BIOS Resource Management 9 2.1.3 Isolating Committed Resources 9 2.1.4 System BIOS Resource Allocation 9 2.2 Plug and Play ISA Card Support 11 2.2.
Plug and Play BIOS Specification 1.
Plug and Play BIOS Specification 1.0A Page 4 References _____________________________________ Plug and Play ISA Specification Version 1.0A May 5, 1994 Send email to plugplay@microsoft.com to obtain a copy. EISA Specification Version 3.12 Contact BCPR Services Inc to obtain a copy. Extended System Configuration Data Specification Version 1.02a Contact Intel Corporation to obtain a copy. Device Identifier Reference Table & Device Type Code Table Browse the PlugPlay forum on CompuServe to obtain a copy. 1.
Plug and Play BIOS Specification 1.0A Page 5 This is the key consideration in a system BIOS. It is considered unacceptable to change the architecture of a System BIOS to prevent the thousands of ISA cards and software programs that rely on the system BIOS for services. Eliminate resource conflicts during the POST procedure A common problem that plagues many ISA systems today is the fact that there are a lot more devices available than there are system resources.
Plug and Play BIOS Specification 1.0A Page 6 Hardware and Operating System independence The extensions to the system BIOS isolate the systemboard hardware through well defined interfaces and structures. The system device nodes represent devices that are controlled by the system BIOS. The operating system requires no specific knowledge of the systemboard in order to control these devices, and instead relies on the system BIOS to isolate it from the underlying hardware. 1.
Plug and Play BIOS Specification 1.0A Page 7 1.3 Elements of the Plug and Play BIOS architecture 1.3.1 Bi-modal functionality All Plug and Play BIOS Services which are accessible at runtime support a bi-modal interface. The two modes supported are 16-bit Real Mode and 16-bit Protected Mode. These two modes are sufficient to support a wide variety of operating environments. Real Mode interfaces are defined in terms of the segment and offset of the service entry point.
Plug and Play BIOS Specification 1.0A Page 8 2.0 System BIOS Initialization _____________________ The Power On Self Test (POST) procedure of a system BIOS is designed to identify, test, and configure the system in preparation for starting the operating system. At the completion of POST, the PC compatible system BIOS attempts to have all of the appropriate devices enabled in order for them to be properly recognized and functioning when the operating system loads.
Plug and Play BIOS Specification 1.0A • • • • Page 9 Configuration of all static devices known to system BIOS At a minimum, this includes system board devices. It can also include Plug and Play ISA Cards and devices located on EISA, ISA, PCI, or any of the other static bus architectures available. How this configuration is completed will be described in a later section. BIOS POST Resource arbitration The system BIOS must now be aware of system resource usage.
Plug and Play BIOS Specification 1.0A Page 10 2.1.3 Isolating Committed Resources The first step to resource management is to determine system resources that are statically allocated to devices in the system. These resources can be located on ISA cards, systemboard devices, or any other device present in the system. Unfortunately, it is very difficult, if not impossible, to accurately determine the resources used, unless these devices provide information about the system resources they will use.
Plug and Play BIOS Specification 1.0A Page 11 There are certain benefits that can be realized by supporting Static Resource Allocation. First, the configuration of every device in the system is saved in nonvolatile storage which allows the BIOS to allocate the appropriate resources to the devices in the system during POST. This allows the last working configuration to be maintained from boot to boot.
Plug and Play BIOS Specification 1.0A Page 12 On systems with a dynamic ISA bus, like portables, function 40h will be more flexible. When an ISA bus is present, the information returned by function 40h will always be valid after a cold boot. On a cold boot with no ISA bus present, function 40h will return zeros.
Plug and Play BIOS Specification 1.0A Page 13 and Play system BIOS. Once the option ROM has determined the environment it is installed in, it can perform the proper steps for initialization. In the first environment, which is a standard PC compatible system that does not have a Plug and Play compatible system BIOS, the ISA option ROM scan will be performed and the Plug and Play option ROM should initialize exactly as if it was a standard ISA option ROM.
Plug and Play BIOS Specification 1.0A Page 14 system through the Set Statically Allocated Resource Information function, the system BIOS will create an initial resource map based on this information. If the BIOS implementation provides support for saving the last working configuration and the system software has explicitly assigned system resources to specific devices in the system, then this information will be used to construct the resource map.
Plug and Play BIOS Specification 1.0A Step 4 Step 5 Step 6 Step 7 Step 8 Step 9 Page 15 Enable Input and Output Devices Select and enable the Input and Output Device. Compatibility devices in the system that are not configurable always have precedence. For example, a standard VGA adapter would become the primary output device. If configurable Input and Output Devices exists, then enable these devices at this time.
Plug and Play BIOS Specification 1.0A Page 16 3.1 Option ROM Header The Plug and Play Option ROM Header follows the format of the Generic Option ROM Header extensions described in Appendix A. The Generic Option ROM header is a mechanism whereby the standard ISA Option ROM header may be expanded with minimal impact upon existing Option ROMs. The pointer at offset 1Ah may point to ANY type of header.
Plug and Play BIOS Specification 1.0A Page 17 3.
Plug and Play BIOS Specification 1.0A Page 18 dependent upon the Base-Type code. The third byte defines the specific device programming interface, IF.-Type, based on the Base-Type and Sub-Type. Refer to Appendix B for a description of Device Type Codes. Device Indicators - This field contains indicator bits that identify the device as being capable of being one of the three identified boot devices: Input, Output, or Initial Program Load (IPL).
Plug and Play BIOS Specification 1.0A Reg On Entry AX ES:DI BX DX Page 19 Description Provides an indication as to which vectors should be hooked by specifying the type of boot device this device has been selected as. Bit 7..3 Reserved(0) Bit 2 1=Connect as IPL (INT 13h) Bit 1 1=Connect as primary Video (INT 10h) Bit 0 1=Connect as primary Input (INT 09h) Pointer to System BIOS PnP Installation Check Structure (See section 4.4) CSN for this card, ISA PnP devices only.
Plug and Play BIOS Specification 1.0A Field Size of the device node Device node number/handle Device product identifier Device type code Device node attribute bit-field Allocated resource configuration descriptor block Possible resource configuration descriptor block should only specify the END_TAG resource descriptor Compatible device identifiers Page 20 Size WORD BYTE DWORD 3 BYTES WORD VARIABLE 2 BYTES VARIABLE Refer to section 4.
Plug and Play BIOS Specification 1.
Plug and Play BIOS Specification 1.0A Page 22 INT 13h is called, the Option ROM may make the assumption that the base I/O address is the one that goes with that entry point. 3.
Plug and Play BIOS Specification 1.0A Page 23 4.0 Configuration Support ________________________ A Plug and Play system BIOS, in addition to providing a conflict free bootstrap process, also provides services to the operating system to assist with resource management during runtime. These services focus on extending Plug and Play support to non-Plug and Play systemboard devices and dynamic event notification. 4.
Plug and Play BIOS Specification 1.0A Field Size of the device node Device node number/handle Device product identifier Device type code Device node attribute bit-field Allocated resource configuration descriptor block Possible resource configuration descriptor block Compatible device identifiers Page 24 Size WORD BYTE DWORD 3 BYTES WORD VARIABLE VARIABLE VARIABLE Size of Device Node: This field contains the size, in bytes, of the device node.
Plug and Play BIOS Specification 1.0A Page 25 The device node attributes provide additional information about the state of the device and the capabilities of the device.
Plug and Play BIOS Specification 1.0A Page 26 be a static device, which means it is not configurable. If the information is provided in this descriptor block and in a configuration file, the possible resource selections must be specified in the same order that they are described in the configuration file.
Plug and Play BIOS Specification 1.0A OEM Device Identifier Real Mode 16-bit data segment address 16-Bit Protected Mode data segment base address Page 27 17h 1Bh 1Dh DWORD WORD DWORD Varies Varies Varies Signature is represented as the ASCII string "$PnP", where byte 0='$' (24h), byte 1='P' (50h),byte 2='n' (6Eh), and byte 3='P' (50h).
Plug and Play BIOS Specification 1.0A Page 28 access arguments on the stack as a 16-bit stack frame. Therefore, the caller must ensure that the function arguments are pushed onto the stack as 16-bit values and not 32-bit values. The stack parameter passing is illustrated in Figure 4.4.1 below. Figure 4.4.
Plug and Play BIOS Specification 1.0A Page 29 1. The Plug and Play Structure is valid. 2. Any calls made to the Plug and Play BIOS functions will either perform the function as described by Version 1.0 of this specification or return the FUNCTION_NOT_SUPPORTED error code. Plug and Play compliant systems are required to provide the support as outlined in the table below. 3. All of the runtime Plug and Play services will be contained in a contiguous 64K code segment.
Plug and Play BIOS Specification 1.
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.
Plug and Play BIOS Specification 1.0A unsigned int Control; unsigned int BiosSelector; Page 32 /* Control Flag */ /* PnP BIOS readable/writable selector */ Description: Required. This function will copy the information for the specified System Device Node into the buffer specified by the caller. The Node argument is a pointer to the unique node number (handle). If Node contains 0, the system BIOS will return the first System Device Node.
Plug and Play BIOS Specification 1.0A Page 33 4.5.3 Function 2 - Set System Device Node Synopsis: int FAR (*entryPoint)(Function, Node, devNodeBuffer, Control, BiosSelector); int Function; /* PnP BIOS Function 2 */ unsigned char Node; /* Node number/handle to set */ struct DEV_NODE FAR *devNodeBuffer; /* Buffer containing device node data */ unsigned int Control; /* Control Flag */ unsigned int BiosSelector; /* PnP BIOS readable/writable selector */ Description: Required.
Plug and Play BIOS Specification 1.0A Page 34 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 push push push push push call add cmp jne . . .
Plug and Play BIOS Specification 1.0A Page 35 When the system software is notified of an event by either mechanism, it can then call the BIOS runtime function to get the event which will return a message specifying the type of event. These events are specific to the system and do not represent events that can occur on the various expansion busses, such as PCMCIA insertion and removal events.
Plug and Play BIOS Specification 1.0A Page 36 Event Identifier ABOUT_TO_CHANGE_CONFIG Value 0001h DOCK_CHANGED 0002h SYSTEM_DEVICE_CHANGED 0003h CONFIG_CHANGE_FAILED 0004h UNKNOWN_SYSTEM_EVENT FFFFh OEM_DEFINED_EVENTS 8000h thru FFFEh Description This message provides the system with a mechanism whereby system software can obtain notification from the system BIOS when a change is about to be made to the system. This notification encompasses initiating a docking, or undocking, sequence.
Plug and Play BIOS Specification 1.0A Page 37 4.6.1 Function 3 - Get Event Synopsis: int FAR (*entryPoint)(Function, Message, BiosSelector); int Function; /* PnP BIOS Function 3 */ unsigned int FAR *Message; /* Storage for the event message */ unsigned int BiosSelector; /* PnP BIOS readable/writable selector */ Description: Required for Dynamic Event Management. This function will allow system software to retrieve a message specifying the type of event that has occurred on the system.
Plug and Play BIOS Specification 1.0A Page 38 Example: The following example illustrates how the 'C' style call interface could be made from an assembly language module: . push push push push call add cmp jne . . Bios Selector segment/selector of Message offset of Message GET_EVENT FAR PTR entryPoint sp,8 ax,SUCCESS error . . . ; pointer to Message ; Function 3 ; Clean up stack ; Function completed successfully? ; No-handle error condition 4.6.
Plug and Play BIOS Specification 1.0A Page 39 Response Messages 00h through 3Fh: Message Identifier OK ABORT Control Messages 40h through 7Fh: Message Identifier UNDOCK_DEFAULT_ACTION Value 00h 01h Value 40h POWER_OFF 41h PNP_OS_ACTIVE 42h PNP_OS_INACTIVE 43h OEM Defined Messages 8000h through FFFFh: Message Identifier Value Description Instructs the system to continue with the sequence which initiated the event.
Plug and Play BIOS Specification 1.0A OEM_DEFINED_MESSAGES Page 40 8000h thru FFFFh This message allows OEMs to define messages specific to their system implementation. These messages are only comprehended by the OEM. These messages are identified by the upper bit of the message. If the system BIOS does not support one of the specified messages, this function will return MESSAGE_NOT_SUPPORTED.
Plug and Play BIOS Specification 1.0A Page 41 4.6.3 Function 5 - Get Docking Station Information Synopsis: int FAR (*entryPoint)(Function, DockingStationInfo, BiosSelector); int Function; /* PnP BIOS Function 5 */ unsigned char FAR *DockingStationInfo; /* Pointer to docking station info structure */ unsigned int BiosSelector; /* PnP BIOS readable/writable selector */ Description: Required for Dynamic Event Management.
Plug and Play BIOS Specification 1.0A Page 42 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.
Plug and Play BIOS Specification 1.0A 4.6.4 Function 6 - Reserved This function has been reserved for future implementations and should return FUNCTION_NOT_SUPPORTED. 4.6.5 Function 7 - Reserved This function has been reserved for future implementations and should return FUNCTION_NOT_SUPPORTED. 4.6.6 Function 8 - Reserved This function has been reserved for future implementations and should return FUNCTION_NOT_SUPPORTED.
Plug and Play BIOS Specification 1.0A Page 44 4.7 Extended Configuration Services This section describes the optional extended services provided by the System BIOS on Plug and Play platforms. The extended configuration services are a mechanism whereby the system software may specify the system resources assigned to devices that have been installed in the system. This information will be maintained by the BIOS in some form of nonvolatile storage.
Plug and Play BIOS Specification 1.0A Page 45 4.7.1 Function 9 - Set Statically Allocated Resource Information Synopsis: int FAR (*entryPoint)(Function, ResourceBlock, BiosSelector); int Function; /* PnP BIOS Function 9 */ unsigned char FAR *ResourceBlock; /* Block of statically allocated resources */ unsigned int BiosSelector; /* PnP BIOS readable/writable selector */ Description: Optional.
Plug and Play BIOS Specification 1.0A Page 46 . . A BIOS implementor is only required to follow the interface described by this function. The format of the data passed by the system software must follow the Plug and Play ISA resource descriptor definition. How the statically allocated resource information is actually stored is left up to the BIOS implementor.
Plug and Play BIOS Specification 1.0A Page 47 4.7.2 Function 0Ah - Get Statically Allocated Resource Information Synopsis: int FAR (*entryPoint)(Function, ResourceBlock, BiosSelector); int Function; /* PnP BIOS Function 0Ah */ unsigned char FAR *ResourceBlock; /* Block of resources statically allocated to devices */ unsigned int BiosSelector; /* PnP BIOS readable/writable selector */ Description: Optional.
Plug and Play BIOS Specification 1.0A Page 48 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 the Resource Block ; Pointer to the data struct of isa resources push offset of Resource Block push GET_STATICALLY_ALLOCATED_RESOURCES ; Function 0Ah call FAR PTR entryPoint add sp,8 ; Clean up stack cmp ax,SUCCESS ; Function completed successfully? jne error ; No-handle error condition . 4.
Plug and Play BIOS Specification 1.0A Page 49 ISA Read Data Port: The ISA Read Data Port is used to read information from the Plug and Play registers. The value represented here is the I/O port that was determined by the system BIOS to not conflict with another ISA I/O port. Refer to the ISA Plug and Play Specification for more information on the ISA Read Data Port.
Plug and Play BIOS Specification 1.0A Page 50 data segment descriptor with a limit of 64K and read/write access. This will enable the Plug and Play system BIOS to read and write the memory mapped nonvolatile storage in a protected mode environment. If the nonvolatile storage is not memory mapped the value returned in NVStorageBase should be 0. It is assumed that the size of the nonvolatile storage that contains the ESCD will not exceed 32K bytes.
Plug and Play BIOS Specification 1.0A Page 51 4.8 Power Management Services The following subsections describe the Plug and Play support for allowing interaction with Advanced Power Management (APM) 1.1 and greater. 4.8.
Plug and Play BIOS Specification 1.0A Page 52 specified in the Plug and Play Installation Check data structure, a limit of 64K, 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.
Plug and Play BIOS Specification 1.
Plug and Play BIOS Specification 1.0A Page 54 Appendix B: Device Driver Initialization Model_______ Please Note: The Device Driver Initialization Model (DDIM) is provided as an extension of the current option ROM model. Current bus devices cannot be guaranteed that the systems in which they are installed will support DDIM. Therefore, current bus device Option ROMs (ISA, EISA, MCA, PCMCIA) must support the standard initialization model, and may optionally support the DDIM.
Plug and Play BIOS Specification 1.0A Page 55 Appendix C: Return Codes _______________________ The following table represents the return codes for the BIOS functions. Bit 7 set indicates an error has occurred.
Plug and Play BIOS Specification 1.0A HARDWARE_ERROR Page 56 8Fh This return code indicates that the system BIOS detected a hardware failure.