Preboot Execution Environment (PXE) Specification
Preboot Execution Environment (PXE) Specification
(PXE) Specification
Version 2.1
This document is for informational purposes only. INTEL MAKES NO WARRANTIES, EXPRESS OR
IMPLIED, IN THIS DOCUMENT.
Intel Corporation may have patents or pending patent applications, trademarks, copyrights, or other
intellectual property rights covering subject matter in this document. The furnishing of this document does
not give you any license to the patents, trademarks, copyrights, or other intellectual property rights except
as expressly provided in any written license agreement from Intel Corporation.
Intel does not make any representation or warranty regarding specifications in this document or
any product or item developed based on these specifications. INTEL DISCLAIMS ALL EXPRESS
AND IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OR
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND FREEDOM FROM
INFRINGEMENT. Without limiting the generality of the foregoing, Intel does not make any warranty
of any kind that any item developed based on these specifications, or any portion of a
specification, will not infringe any copyright, patent, trade secret or other intellectual property
right of any person or entity in any country. It is your responsibility to seek licenses for such
intellectual property rights where appropriate. Intel shall not be liable for any damages arising out
of or in connection with the use of these specifications, including liability for lost profit, business
interruption, or any other damages whatsoever. Some states do not allow the exclusion or
limitation of liability or consequential or incidental damages; the above limitation may not apply to
you.
† Other product and corporate names may be trademarks of other companies and are used only for
explanation and to the owners’ benefit, without intent to infringe.
Copyright © 1998, 1999 Intel Corporation. All rights reserved.
Table of Contents
1. INTRODUCTION................................................................................................................................4
1.1 Structure of this Document..........................................................................................................5
1.2 Related Documents .......................................................................................................................5
1.2.1 Wired for Management ..........................................................................................................5
1.2.2 BIOS Specifications................................................................................................................6
1.2.3 UUID Documents ...................................................................................................................6
1.2.4 Other PC System Documents .................................................................................................6
1.3 Data Types and Terms Used in This Guide................................................................................6
1.4 Required vs. Recommended Features ........................................................................................9
1.5 Overview......................................................................................................................................10
1.5.1 PXE Protocol ........................................................................................................................10
1.5.2 PXE APIs ..............................................................................................................................11
2. PXE CLIENT / SERVER PROTOCOL ..........................................................................................12
2.1 Relationship to the Standard DHCP Protocol .........................................................................12
2.2 Protocol Details ...........................................................................................................................12
2.2.1 PXE Boot...............................................................................................................................13
2.2.2 Protocol Timeouts.................................................................................................................15
2.2.3 Proxy DHCP .........................................................................................................................16
2.3 DHCP Tags used for PXE Protocol ..........................................................................................18
2.4 Client Behavior ...........................................................................................................................23
2.4.1 PXE Option Precedence .......................................................................................................23
2.4.2 DHCPDISCOVER................................................................................................................23
2.4.3 DHCPOFFER ......................................................................................................................24
2.4.4 Boot Server Discovery ..........................................................................................................25
2.4.5 Boot Server Reply .................................................................................................................26
2.4.6 Network Bootstrap Program (NBP) Download...................................................................28
2.4.7 NBP Authentication .............................................................................................................28
2.4.8 Boot Server Credentials Reply .............................................................................................29
2.4.9 NBP Execution .....................................................................................................................31
2.4.10 MTFTP Operation................................................................................................................31
2.5 Server Behavior ..........................................................................................................................35
2.5.1 Redirection Service Behavior...............................................................................................35
2.5.2 Boot Service Behavior ..........................................................................................................35
2.5.3 Response to DHCPREQUEST.............................................................................................35
3. PXE APIS ...........................................................................................................................................39
3.1 PXE Installation Check..............................................................................................................40
3.1.1 Real mode (Int 1Ah Function 5650h) .................................................................................40
3.1.2 PXENV+ Structure ...............................................................................................................40
3.1.3 Protected mode (Scanning base memory) ...........................................................................41
3.1.4 !PXE Structure .....................................................................................................................42
3.2 PXE API Calling Convention ....................................................................................................44
3.3 Early UNDI API Usage ..............................................................................................................45
3.4 PXE API Service Descriptions...................................................................................................47
3.4.1 Preboot API Service Descriptions........................................................................................47
3.4.2 TFTP API Service Descriptions...........................................................................................52
List of Tables
1. Introduction
A common problem faced by IT managers is to ensure that client systems in their enterprises can
boot appropriate software images using appropriate configuration parameters. These selected boot
images and configuration parameters must be acquired from selected servers in the enterprise as
dictated by the needs of the particular environment, the capabilities or mission of the user, the
resources available within the client, etc. Furthermore, these clients should boot consistently and in
an interoperable manner regardless of the sources or vendors of the software and the hardware of
both client and server machines.
This goal can be accomplished only through a uniform and consistent set of pre-boot protocol
services within the client that ensure that network-based booting is accomplished through industry
standard protocols used to communicate with the server. In addition, to ensure interoperability, the
downloaded Network Bootstrap Program (NBP) must be presented with a uniform and consistent
pre-boot operating environment within the booting client, so it can accomplish its task independent
of, for example, the type of network adapter implemented in the system. This capability is useful in
enhancing the manageability of the client machine in several situations; for example:
! Remote new system setup. If the client does not have an OS installed on its hard disk, or the
client has no hard disk at all, downloading an NBP from a server can help automate the OS
installation and other configuration steps.
! Remote emergency boot. If the client machine fails to boot due to a hardware or software
failure, downloading an executable image from a server can provide the client with a specific
executable that enables remote problem notification and diagnosis.
! Remote network boot. In instances where the client machine has no local storage, it can
download its system software image from the server in the course of normal operation.
This document specifies the Preboot Execution Environment (PXE). PXE embodies three
technologies that will establish a common and consistent set of pre-boot services within the boot
firmware of Intel Architecture systems:
! A uniform protocol for the client to request the allocation of a network address and
subsequently request the download of an NBP from a network boot server.
! A set of APIs available in the machine’s pre-boot firmware environment that constitutes a
consistent set of services that can be employed by the NBP or the BIOS.
! A standard method of initiating the pre-boot firmware to execute the PXE protocol on the
client machine.
In summary, using the capabilities described above, a newly installed networked client machine
should be able to enter a heterogeneous network, acquire for itself a network address from a DHCP
server, and then download an NBP to set itself up. This sets the stage to enable IT managers to
customize the manner in which their network client machines go through a network-based booting
process.
BEV Acronym for Boot Entry Vector. A field in the Plug and Play (PnP)
Header of a device with an associated option ROM. PXE is
implemented as a BEV option ROM.
BIOS Acronym for Basic Input/Output System, also known as ROM BIOS
when resident in Read Only Memory or ROM.
BOOTP This is an earlier IETF-defined booting protocol that is much less
flexible than DHCP. However, DHCP has been defined to be
upwardly compatible with BOOTP and both these protocols can co-
exist and function simultaneously in the same network. RFC 1534
defines how DHCP and BOOTP must be implemented to ensure they
can co-exist in the same network and inter-operate
Bootstrap Also known as the Initial Program Load (IPL). The initial code
loaded by the BIOS to initiate a client operating environment.
BUSD Bus/Device. A BUSD option ROM may contain code to locate and
initialize devices on a bus that is not supported in the BIOS Core.
The BUSD API calls are used by the UNDI IPL routine and NBPs to
enable and disable bus components and devices.
Client In this document, the Client is usually the machine receiving the
NBP. The client machine hosts the PXE boot ROM.
DDIM Device Driver Initialization Model. Under this model, all Option
ROMs installed in a Plug and Play system which indicate that they
support DDIM will be copied into RAM by the System BIOS.
Documented in the [PnP] specification
DHCP Dynamic Host Configuration Protocol. An industry standard Internet
protocol defined by the IETF. DHCP was defined to dynamically
provide communications-related configuration values such as
network addresses to network client computers at boot time. DHCP is
specified by IETF RFCs 1534, 2131, and 2132
Extended Memory Typically used to describe memory on an Intel architecture system
above 1 MB.
GUID Globally unique identifier; a synonym for UUID.
IETF Internet Engineering Task Force. The open industry body that owns
the technical specifications for Internet standards (protocols, APIs,
etc.)
IPL Acronym for Initial Program Load, also known as the bootstrap or
boot process
MTFTP Multicast Trivial File Transfer Protocol. PXE implements a
proprietary implementation of MTFTP.
NBP Acronym for Network Bootstrap Program. The remote boot image
downloaded by the PXE client via TFTP or MTFTP.
Option ROM ROM associated with a plug and play device. May be located on the
device or in non-volatile storage on a system.
1.5 Overview
The description of PXE Client / Server Protocol assumes knowledge of the standard DHCP/BOOTP
protocols.
DHCP / Proxy
DHCP Ack reply to Port 68 DHCP Server
Step 4
PXE
Step 5 Client
Boot Service Discover to port 67 or 4011
Contains: “PXEClient” extension tags
+ [Other DHCP option tags]
Step 6 Boot
PXE Boot Service Ack reply to client source port Service
Step 7 Client Contains: [ PXE Server extension tags]
(contains Network Bootstrap Program file name)
Execute
Downloaded
Boot Image Network Bootstrap Program download
request to TFTP port 69 or MTFTP port M/TFTP
Step 9 PXE (from Boot Service Ack) Service
Client
Network Bootstrap Program Download to
PXE Client Client's port Boot Server
client and any other parameters that the administrator might have configured on the DHCP or Proxy
DHCP Service.
The timeout for a reply from a DHCP server is standard. The timeout for re-broadcasting to receive a
DHCPOFFER with PXE extensions, or a Proxy DHCPOFFER is based on the standard DHCP
timeout but is substantially shorter to allow reasonable operation of the client in standard BOOTP or
DHCP environments that do not provide a DHCPOFFER with PXE extensions. (See below.)
Step 3. From the DHCPOFFER(s) that it receives, the client records the following:
! The Client IP address (and other parameters) offered by a standard DHCP or BOOTP Service.
! The Boot Server list from the Boot Server field in the PXE tags from the DHCPOFFER.
! The Discovery Control Options (if provided).
! The Multicast Discovery IP address (if provided).
Step 4. If the client selects an IP address offered by a DHCP Service, then it must complete the
standard DHCP protocol by sending a request for the address back to the Service and then waiting for
an acknowledgment from the Service. If the client selects an IP address from a BOOTP reply, it can
simply use the address.
Step 5. The client selects and discovers a Boot Server. This packet may be sent broadcast (port 67),
multicast (port 4011), or unicast (port 4011) depending on discovery control options included in the
previous DHCPOFFER containing the PXE service extension tags. This packet is the same as the
initial DHCPDISCOVER in Step 1, except that it is coded as a DHCPREQUEST and now contains
the following:
! The IP address assigned to the client from a DHCP Service.
! A tag for client identifier (UUID)
! A tag for the client UNDI version.
! A tag for the client system architecture.
! A DHCP option 60, Class ID, set to “PXEClient:Arch:xxxxx:UNDI:yyyzzz”.
! The Boot Server type in a PXE option field
Step 6. The Boot Server unicasts a DHCPACK packet back to the client on the client source port.
This reply packet contains:
! Boot file name.
! MTFTP1 configuration parameters.
! Any other options the NBP requires before it can be successfully executed.
Step 7. The client downloads the executable file using either standard TFTP (port69) or MTFTP
(port assigned in Boot Server Ack packet). The file downloaded and the placement of the
downloaded code in memory is dependent on the client’s CPU architecture.
Step 8. The PXE client determines whether an authenticity test on the downloaded file is required. If
the test is required, the client sends another DHCPREQUEST message to the boot server requesting a
credentials file for the previously downloaded boot file, downloads the credentials via TFTP or
MTFTP, and performs the authenticity test.
Step 9. Finally, if the authenticity test succeeded or was not required, then the PXE client initiates
execution of the downloaded code
1
Multicast Trivial File Transfer Protocol as defined by this document through the use of DHCP encapsulated
vendor options.
Version 2.1 September 20, 1999
Copyright © 1998, 1999 Intel Corporation. All rights reserved.
Preboot Execution Environment (PXE) Specification 15
Broadcast DHCP DHCP Discover will be retried four times. The four
Discover packet. timeouts are 4, 8, 16 and 32 seconds respectively.
Did
Bootserver / BINL we hear our
Request. Bootserver Request will be
retried four times. The four file?
timeouts are 1, 2, 3, and 4
seconds respectively No
Yes
Wait for
Bootserver / BINL MTFTP Open
Reply.
The MTFTP Open timeout
is controlled by DHCP
options. Yes Yes
Are PXE PDK uses 2 seconds.
we doing
MTFTP? Did
Yes MTFTP Open
fail?
No
Done Done
Proxy DHCP service occurs after completing the standard DHCP protocol. Proxy DHCP uses port
(4011) because it cannot share port (67) with the DHCP service. The PXE client knows to interrogate
the Proxy DHCP service because the DHCPOFFER from the DHCP service contains an Option #60
“PXEClient” tag without corresponding Option #43 tags or a boot file name.
Proxy
DHCP Request to Port 4011 DHCP
PXE Contains "PXEClient" extension tags Service
Client
Extended DHCP Offer to client port contains:
PXE client extension tags Proxy DHCP
PXE
Client Server
Boot Service Discovery
Contains "PXEClient" extension tags
+ [Other DHCP option tags]
Boot
PXE Service
Boot Service Ack reply to Client's Port
Client
Contains: PXE Client extension tags
Execute + NBP file name
Downloaded
Boot Image NBP Download
Request to TFTP port 69 M/TFTP
PXE Service
Client
NBP Download to
PXE Client Client's port Boot Server
Figure 2-3 PXE Client Response to DHCP Server Containing a Proxy DHCP Service
Figure 2-4 illustrates the case of a Proxy DHCP service and the DHCP service on different servers. In
this case, the Proxy DHCP service listens to UDP port (67) and responds in parallel with the DHCP
service.
Figure 2-4 PXE Client Response to DHCP Server Supplying Boot Service Discovery Code
Note #2
MTFTP is recommended. These options define the client/server port numbers and open/re-open
timeouts that must be used in MTFTP open/read requests.
MTFTP IP Addr is the multicast IP address the client must use to receive the image file.
MTFTP Client UDP is the port the client must listen on to receive the image file.
MTFTP Server UDP is the port the client must use to communicate with the MTFTP service. The
client binds to the MTFTP UDP port and waits for the duration of the MTFTP transmission start
delay to receive packets.
MTFTP Start Delay is the timeout to begin receiving image file packets before attempting to become
the MTFTP acknowledging client (master client) upon initial connection to the MTFTP service.
MTFTP Timeout Delay is the delay multiplied by the percentage of the file received, the client must
wait before attempting to become the MTFTP acknowledging client (master client) upon cessation of
packet transmissions during an ongoing MTFTP transfer.
Note #3
These options control the type of boot server discovery mechanisms used by clients. Clients must use
discovery methods in this order:
1. Multicast. If the client supports multicast discovery and multicast discovery is enabled
(PXE_DISCOVERY_CONTROL, option #43 tag #6 does exist OR it does exist and bit1 is not
set.) and a multicast discovery IP address is available. (DISCOVERY_MCAST_ADDR exists.)
2. Broadcast. If broadcast discovery is enabled, (PXE_DISCOVERY_CONTROL, option #43 tag
#6 doesn’t exist OR it does exist and bit 0 is not set).
3. Unicast. If a Boot Server list is available, (PXE_BOOT_SERVERS, Option #43 tag #8).
If PXE_DISCOVERY_CONTROL bit 2 is set, the client may still use multicast and broadcast
discovery (if it is permitted by bits 0 and 1); but the client may only accept replies from servers that
are identified in the PXE_BOOT_SERVERS option.
Note #4
These options define the information, if any, displayed by the client during a network boot.
Note #5
The client must fill in this option when requesting credentials (MSbit in layer number is set). Boot
servers must not respond if they do not support the requested credential type. Clients requesting
credentials must ignore any server response that does not have the credential option. Clients must
include all the supported credential types when doing a layer zero discovery. Clients must use the
same credential type, selected in the layer zero discovery, for all subsequent layers. If the client lists
more than one credential type in the discover request, the boot server must respond with the one
credential type that will be used.
Note #6
This option is required to discover Boot Servers. Only the client may change the type field; either the
client or the server may change the layer field. Layer 0 always indicates the first boot file for a
particular Boot Server type. Boot Servers capable of providing the boot file requested in the
PXE_BOOT_ITEM must respond. Boot Servers not capable of providing the boot file requested
must not respond.
2.4.2 DHCPDISCOVER
To initiate the interchange between the client and server, the client broadcasts a DHCPDISCOVER
packet to the standard DHCP server UDP port (67). The contents of this message must be as
described in RFC 2131 for a DHCPDISCOVER message, with the addition of PXE Client option
fields. The format of these options is specified in Table 2-2; fields marked with an asterisk contain
unspecified values.
DHCP Header
Field (length) Value Comment
op (1) 1 Code for BOOTP REQUEST
htype (1) *
hlen (1) *
hops (1) *
xid (4) *
secs (2) *
flags (2) *
ciaddr (4) 0.0.0.0 PXE client always sets this value to 0.0.0.0
yiaddr (4) * Client’s IP address. Provided by server
siaddr (4) * Next bootstrap server IP address
giaddr (4) *
chaddr (16) xx-xx-xx-xx-xx-xx-xx-xx Client’s MAC address
sname (64) * Can be overloaded if using Opt 66
bootfile (128) * Can be overloaded if using Opt 67
99.130.83.99 (Magic Cookie)
DHCP Options
Tag Name Tag # Length Data Field
Client UUID/GUID 97 & 61 17 Type(1) UUID(16)
0 = UUID
Client Network Type 94 3 1 = UNDI
Client System 93 2 Architecture Type(2)
Architecture
Parameter Request 9 Varies This parameter request list is the minimum that must be
List implemented by PXE BC option ROMs.
subnet(1), router(3), vendor(43), class(60)
DHCP Message Type 53 1 1 = DHCPDISCOVER
Message Length 57 2 Max DHCP message length(2)
Class Identifier 60 32 “PXEClient:Arch:xxxxx:UNDI:yyyzzz”
After sending the DHCPDISCOVER message, the client must be prepared to receive replies as
described in the following section.
2.4.3 DHCPOFFER
In this state, the client is prepared to receive one or more extended DHCPOFFER replies from
servers on the standard DHCP client UDP port (68). Sending a PXE Server message requires the use
of DHCP Options. The format of these options is shown in Table 2-3; fields marked with an asterisk
contain unspecified values.
DHCP Header
Field (length) Value Comment
op (1) 2 Code for BOOTP REPLY
htype (1) *
hlen (1) *
hops (1) *
xid (4) *
secs (2) *
flags (2) *
ciaddr (4) 0.0.0.0 Server always sets this value to 0.0.0.0
yiaddr (4) a0, a1, a2, a3 Client’s IP address. Provided by server
siaddr (4) a0, a1, a2, a3 Next bootstrap server IP address
giaddr (4) *
chaddr (16) * Client’s MAC address
sname (64) * Can be overloaded if using Opt 66
bootfile (128) * Can be overloaded if using Opt 67
99.130.83.99
DHCP Options
Tag Name Tag # Length Data Field
DHCP Message Type 53 1 2= DCHPOFFER
Server Identifier 54 4 a1, a2, a3, a4
Client Machine 97 17 Type(1) UUID(16)
Identifier 0 = UUID
Class Identifier 60 9 “PXEClient”
Vendor Options 43 Varies Encapsulated options below.
PXE_DISCOVERY_C 6 1
ONTROL
DISCOVERY_ 7 4 Multicast IP-addr(4)
MCAST_ADDR
PXE_BOOT_ 8 varies Boot Server type(2), IPcnt(1), IP-addr-list(IPcnt*4),
SERVERS Boot Server type(2)…
PXE_BOOT_ 9 varies Boot Server type(2), desclen(1), “description”, Boot
MENU Server type(2)….
PXE_MENU_ 10 varies timeout(1), “prompt”
PROMPT
PXE_END 255 None None
In this state, the client must also be prepared to receive one or more standard DHCPOFFER
messages from servers. Each of these messages will contain configuration information as specified in
RFC 2131. Each extended DHCPOFFER message can also contain configuration information as
specified in RFC 2132. Which, of these configurations, if any, is used by the client is not defined by
this specification. If the client decides to accept one of the configurations offered, then it must
engage in further communications with the server as specified in RFC 2132.
more Boot Servers. The client discovers one of these Boot Servers by sending a DHCPREQUEST
message to the boot server using either unicast, multicast, or broadcast per the discovery instructions
in Option #43, Tag #6 (PXE_DISCOVERY_CONTROL). Table 2-4 lists the required values in the fields
of this message; fields marked with an asterisk contain unspecified values.
DHCP Header
Field (length) Value Comment
op (1) 1 Code for BOOTP REQUEST
htype (1) *
hlen (1) *
hops (1) *
xid (4) *
secs (2) *
flags (2) *
ciaddr (4) a0, a1, a2, a3 PXE client sets this value to the clients IP address if
the client has an IP address
yiaddr (4) 0.0.0.0 Must be 0.
siaddr (4) 0.0.0.0 Must be 0.
giaddr (4) 0.0.0.0
chaddr (16) *xx-xx-xx-xx-xx-xx-xx- Client’s MAC address
xx
sname (64) * Can be overloaded if using Opt 66
bootfile (128) * Can be overloaded if using Opt 67
99.130.83.99
DHCP Options
Tag Name Tag # Length Type Data Field
Client UUID/GUID 97 & 61 17 Type (1) UUID(16)
0 = UUID
Client Network 94 3 Type (1) = 1 UNDI – Major Ver(1), Minor Ver(1)
Device Interface
Type
Message Type 53 1 3 = DHCPREQUEST
8 = DHCPINFORM
Client System 93 2
Architecture
Class Identifier 60 32 “PXEClient Arch:xxxxx:UNDI:yyyzzz”
Vendor Options 43 varies Encapsulated options below
PXE_BOOT_ITEM 71 4 Boot Server type(2), layer(2)
PXE_END 255 None
DHCP Header
Field (length) Value Comment
op (1) 2 Code for BOOTP REPLY
htype (1) *
hlen (1) *
hops (1) *
xid (4) *
secs (2) *
flags (2) *
ciaddr (4) 0.0.0.0 Server always sets this value to 0.0.0.0
yiaddr (4) a0, a1, a2, a3 Client’s IP address. Provided by server
siaddr (4) a0, a1, a2, a3 Next bootstrap server IP address
giaddr (4) *
chaddr (16) * Client’s MAC address
sname (64) * Can be overloaded if using Opt 66
bootfile (128) * Can be overloaded if using Opt 67
99.130.83.99
DHCP Options
Tag Name Tag # Length Type Data Field
DHCP Message Type 53 1 5 = DHCPACK
Server Identifier 54 4 a1, a2, a3, a4
Client UUID/GUID 97 & 61 17 Type (1) UUID(16)
0 = UUID
Class Identifier 60 9 “PXEClient”
Vendor Options 43 varies Encapsulated options below
MTFP IP Addr 1 4 a0, a1, a2, a3
MTFTP Client UDP 2 2 Port Number (Intel order)
MTFTP Server UDP 3 2 Port Number (Intel order)
MTFTP Start Delay 4 1
MTFTP Timeout Delay 5 1
PXE_BOOT_ITEM 71 4 Boot Server type(2), layer(2)
PXE_END 255 None
The options fields in this message must, at a minimum, include the following:
! The siaddr field should be null. (The Boot Server should include the MTFTP service. If not, it
is the responsibility of the boot server to insure the availability of the MTFTP server to which
the client has been redirected. In general it is strongly recommended that the MTFTP service
reside on the bootserver to insure that a response to a client will inherently include the
guarantee of boot file availability.)
! The boot file name (PXE_BOOT_ITEM) must be included.
! DHCP message type (DHCPACK).
! The Server Identifier (address of the responding Boot Server) must be included.
! Class Identifier (“PXEClient”).
! Boot Server Type and Layer the server is providing to the client.
The MTFTP options must be included if the client is to perform a multicast file transfer. After
receiving this message, the client moves to the executable download state.
DHCP Header
Field (length) Value Comment
op (1) 1 Code for BOOTP REQUEST
htype (1) *
hlen (1) *
hops (1) *
xid (4) *
secs (2) *
flags (2) *
ciaddr (4) a0.a1.a2.a3 PXE client sets this value to the client’s IP
address if the client has an IP address
yiaddr (4) a0, a1, a2, a3 Client’s IP address. Provided by DHCP
server
siaddr (4) a0, a1, a2, a3 Server’s IP address
giaddr (4) 0.0.0.0
chaddr (16) *xx-xx-xx-xx-xx-xx-xx- Client’s MAC address
xx
sname (64) * Can be overloaded if using Opt 66
bootfile (128) bootfile name NBP name sent by boot server
99.130.83.99
DHCP Options
Tag Name Tag # Length Type Data Field
Client UUID/GUID 97 17 Type (1) UUID(16)
0 = UUID
Client Network 94 3 1 = UNDI Type 1 = Major Ver(1),
Device Interface Minor Ver(1)
Type
DHCP Message 53 1 3 = DHCPREQUEST
Type
Client System 93 2
Architecture
Class Identifier 60 9 “PXEClient:Arch:xxxxx:UNDI:yyyzzz”
DHCP_VENDOR 43 Varies Encapsulated options below
PXE_PAD 0 None None
PXE_BOOT_ITEM 71 4 Boot Server type(2), layer(2)
PXE_CREDENTIAL 12 Varies Credential types (4)
_TYPES
PXE_END 255 None
Note: In the PXE_BOOT_ITEM option in this message, the MSB of the layer data field is 1. This
distinguishes a request for credentials from a request for the boot file itself.
Note: The bootfile field of this message must contain the boot file name exactly as the client received
it from the boot server.
Credentials Reply state, the client must be prepared to receive an extended DHCPACK message from
the Boot Service. The following table lists the required values in the fields of this message:
Table 2-7 Boot Server Credentials ACK Packet
DHCP Header
Field (length) Value Comment
op (1) 2 Code for BOOTP REPLY
htype (1) *
hlen (1) *
hops (1) *
xid (4) *
secs (2) *
flags (2) *
ciaddr (4) 0.0.0.0 Server always sets this value to
0.0.0.0
yiaddr (4) a0, a1, a2, a3 Client’s IP address. Provided by server
siaddr (4) a0, a1, a2, a3 Next bootstrap server IP address
giaddr (4) *
chaddr (16) * Client’s MAC address
sname (64) * Can be overloaded if using Opt 66
bootfile (128) * Can be overloaded if using Opt 67
99.130.83.99
DHCP Options
Tag Name Tag # Length Type Data Field
DHCP Message Type 53 1 5 = DHCPACK
Server Identifier 54 4 a1, a2, a3, a4
Client UUID/GUID 97 & 61 17 Type (1) UUID(16)
0 = UUID
Class Identifier 60 9 “PXEClient”
DHCP_VENDOR 43 Varies Encapsulated options below
PXE_PAD 0 None None
MTFP IP Addr 1 4 a0, a1, a2, a3
MTFTP Client UDP 2 2 Port Number (Intel order)
MTFTP Server UDP 3 2 Port Number (Intel order)
MTFTP Start Delay 4 1
MTFTP Timeout Delay 5 1
PXE_BOOT_ITEM 71 4 Boot Server type(2), layer(2)
PXE_CREDENTIAL_TY 12 4 Credential types (4)
PES
PXE_END 255 None
The options fields in this message must include the following:
! The siaddr field must be null. (The Boot Server must include the MTFTP service.)
! Server Identifier (address of the responding Boot Server).
! The name of the credentials file in the bootfile field.
After receiving this message, the client downloads the credentials file and performs the authenticity
test on the boot file as described previously. If the client is unable to obtain a credentials file, the
authenticity test is deemed to have failed.
Return
Call
Has Inside from
MTFTP Is listen to be
listen timer Yes MTFTP MTFTP
Open continued?
expired? Open Open
No No Yes
The format of a MTFTP data packet is the same
as the TFTP data packet defined in RFC 1350. Goto
Was a packet ---------+---------+--------- Cont
No
received? | 2 bytes | 2 bytes | n bytes |
| Opcode | Block # | Data |
---------+---------+---------
Yes OpCode is 0x0003.
Yes
Did packet
The following items must match
belong to our
" IP destination address must match MTFTP
session?
multicast IP address.
" MTFTP destination port must match MTFTP
Yes client UDP port.
" IP source address must match boot server IP
address.
Read all packets
that belong to our
session. The longest delay between packets belonging to
this MTFTP session is the MTFTP transmission
timeout delay. After each session packet is
received start a timer based on this timeout delay.
If no more packets are received before the timer
Are any expires, go on to the next step.
packets
missing?
End MTFTP
Listen
MTFTP
Open
The format of a MTFTP open request packet is the same as the TFTP RRQ packet
defined in RFC 1350.
---------+----------+--------+---------+--------
| 2 bytes | n bytes | 1 byte | n bytes | 1 byte |
Send MTFTP | OpCode | Filename | 0x00 | Mode | 0x00 |
open request ---------+----------+--------+---------+--------
packet to MTFTP OpCode is 0x0001. Filename is the client bootfile name. Mode is "Octet".
server UDP port.
Start a MTFTP
transmission
Yes
timeout delay
timer. Retry MTFTP open two more
times. If you do not get any
replies, switch to TFTP.
No
Was a
Have all
multicast data
packets been
packet
received?
received?
The format of a MTFTP data packet is the same
Yes as the TFTP data packet defined in RFC 1350.
---------+---------+---------
| 2 bytes | 2 bytes | n bytes |
Have all
Continue | Opcode | Block # | Data |
packets been No
MTFTP ---------+---------+---------
received?
Listen. OpCode is 0x0003.
Yes
Return to Do not continue
MTFTP MTFTP Listen.
Yes Listen
Do not continue
MTFTP Listen.
Start MTFTP
transmission
timeout delay
timer.
No
Has the timer Resend ack
Yes
expired? packet?
No No No
All packets have not
been received.
Return to
Was a packet MTFTP
received? Open
Yes
The format of a MTFTP data packet is the same
as the TFTP data packet defined in RFC 1350.
Was this the ---------+---------+---------
last packet? | 2 bytes | 2 bytes | n bytes |
| Opcode | Block # | Data |
---------+---------+---------
Yes OpCode is 0x0003.
If the MSB of the layer data field is 0, then the Boot Service must respond by sending to the
initiating client a DHCPACKNOWLEDGE message as described in the Boot Server Reply section.
The file name in this message must be the complete path name of an executable appropriate to the
client. The client must download the file from the Boot Server using MTFTP.
If the MSB of the layer data field is 1, then the Boot Service must respond by sending to the
initiating client a DHCPACKNOWLEDGE message as described in the Boot Server Reply section.
The file name in this message must be the complete path name of a file containing credentials for the
boot file previously downloaded by the client. The format of the credentials file must be as described
in [BIS]. The server must select the credentials file on the basis of
! The boot file name sent by the client in the bootfile field of the received message; and
! The appropriate credentials type. The Boot Service must determine the appropriate credentials
type by examining the received message for a PXE_CREDENTIALS_TYPES option. If a
PXE_CREDENTIALS_TYPES option is found, then Boot Service must examine the list of
types in the data field of the option. In this case, the appropriate credentials type is the first
type in the list that is among the types supported by the Boot Service. If no
PXE_CREDENTIALS_TYPES option is found, then the appropriate credentials type is 1024-
bit DSA / SHA-1, as described in [BIS].
The Boot Service must support at least the following credentials types as described in [BIS]:
! 1024-bit DSA / SHA-1; and
! 512-bit RSA / MD5.
The client must download the file credentials from the Boot Server using MTFTP
The Boot Service must be prepared to receive unicast, multicast, or broadcast messages. Multicast
should be supported if a Multicast Boot Server Discovery address is provided.
The Boot Server may attempt to configure itself with a Multicast Boot Server Discovery address by
executing a DHCPREQUEST or DHCPINFORM with an Option tag #60 set to “PXEServer”. The
boot server should expect to receive an Option tag #60 “PXEServer” followed by tag #43 and subtag
#7 (DISCOVERY_MCAST_ADDR) and subtag #11 (PXE_MCAST_ADDRS_ALLOC).
DHCP Header
Field (length) Value Comment
op (1) 2 Code for BOOTP REPLY
htype (1) *
hlen (1) *
hops (1) *
xid (4) *
secs (2) *
flags (2) *
ciaddr (4) 0.0.0.0 Server always sets this value to 0.0.0.0
yiaddr (4) a0, a1, a2, a3 Client’s IP address. Provided by DHCP server
siaddr (4) a0, a1, a2, a3 Server IP address
giaddr (4) 0.0.0.0
chaddr (16) *xx-xx-xx-xx-xx-xx-xx- Client’s MAC address
xx
sname (64) * Can be overloaded if using Opt 66
bootfile (128) * Can be overloaded if using Opt 67
99.130.83.99
DHCP Options
Tag Name Tag # Length Type Data Field
DHCP Message Type 53 1 5 = DHCPACK
Client System 93 2
Architecture
Class Identifier 60 9 “PXEServer”
DHCP_VENDOR 43 varies Encapsulated options below
PXE_PAD 0 None None
DISCOVERY_ 7 4 Multicast IP-addr
MCAST_ADDR Boot Server discovery multicast IP address.
Boot Servers capable of multicast discovery must
listen on this multicast address.
PXE_MCAST_ 11 8 McastIPbase(4), MIPblock(2), MIPrange(2)
ADDRS_ALLOC McastIPBase is the starting address for multicast
addresses.
MIPblock = total size of multicast block.
MIPrange = max number of multicast addresses
available to any one Boot Server.
MIPrange MAY equal MIPblock.
Boot service must randomly pick an address within the
range defined by McastIPBase through
McastIPBase+MIPblock-MIPrange as the base
number for their MIPrange number of IP addresses.
The Boot service manages base addresses for each
boot tree internally.
PXE_END 255 None
3. PXE APIs
To enable the interoperability of clients and downloaded bootstrap programs, the client PXE code
must provide a set of services for use by a downloaded bootstrap. (It also must ensure certain aspects
of the client state at the point in time when the bootstrap begins executing, which is discussed in
Section 4 PXE Initial Program Load (IPL).) The API services that must be provided by PXE for use
by the bootstrap program are as follows:
! Preboot API. Contains several global control and information functions.
! Trivial File Transport Protocol (TFTP) API. Enables opening and closing of TFTP
connections, and reading packets from and writing packets to a TFTP connection.
! User Datagram Protocol (UDP) API. Enables opening and closing UDP connections, and
reading packets from and writing packets to a UDP connection.
! Universal Network Driver Interface (UNDI) API. Enables basic control of and I/O through
the client’s network interface device.
In a PXE Split ROM implementation, the Preboot, TFTP, and UDP APIs are provided in the BC
(Base-Code) ROM. The UNDI API is provided in the UNDI ROM. (The BUSD ROM provides the
BUSD API. These APIs are covered in Section 4.4.1.2 CardBus ROM Scan & Init, and section
4.4.2.2 Enable BUSD.
BINL
TFTP/MTFTP Socket Layer
DHCP
The PXE APIs are available to the bootstrap only if the Option #60 "PXEClient" is present in the
DHCPOFFER message
Note: The descriptions in subsequent sections are specific to Intel-architecture PCs. A processor
architecture-independent description of these interface and state specifications is probably possible,
but has not been attempted.
Example-1: !PXE API call from Microsoft 16-bit C/C++ v1.52c, using __cdecl parameter convention
(16-bit stack segment):
(far __cdecl * PXE->EntryPointSP)(PXENV_TFTP_OPEN, &tftp_open_param);
Example-2: !PXE API call from Microsoft 16-bit Assembler v6.12, using __cdecl parameter
convention (16- or 32-bit stack segments):
Note: When using a 32-bit stack segment do not push 32-bit words onto the stack. The PXE API
services will not work, unless there are three 16-bit parameters pushed onto the stack.
push DS ;Far pointer to parameter structure
push offset tftp_open_param ;is pushed onto stack.
push PXENV_TFTP_OPEN ;UINT16 is pushed onto stack.
call dword ptr (s_PXE ptr es:[di]).EntryPointSP
add sp, 6 ;Caller cleans up stack.
Figure 3-2 shows an example Base-Code (BC) API call being made from an NBP into the UNDI API
dispatch routine and then being passed into the BC API dispatch routine.
Perform
Check result in AX Yes Base-Code API
and Status field
Perform UNDI API No
Setup stack for
Base-Code API
The calling call Set AX register
must provide the and Status field
Set AX register
Interrupt Service and Status field
Routine Far call to
Base-Code API
entry point Far return to caller
Restore registers
from stack
Example-4: API call being transferred from the UNDI driver to the BC runtime using Microsoft 16-
bit C/C++ v1.52c, using __cdecl parameter convention:
PXEptr = MK_FP(sreg.cs, PXEoffset);
(far __cdecl * PXE->EntryPointSP)(PXENV_TFTP_OPEN, (void far
*)&tftp_open_param, PXEptr);
Example-5: API call being transferred from the UNDI driver to the BC runtime using Microsoft 16-
bit Assembler v6.12, using __cdecl parameter convention:
push CS ;UNDI code segment
push offset cs:PXE ;!PXE offset
push DS ;UNDI data segment
push offset ds:tftp_open_param ;Param offset
push PXENV_TFTP_OPEN ;UINT16 is pushed onto stack.
call dword ptr (s_PXE ptr es:[di]) ;EntryPointSP
add sp, 10 ;Caller cleans up stack.
Prepare for
Early UNDI
Do transmit/receive as needed.
Continue
BIOS must locate and allocate resources (IRQ, POST
memory, I/O) to an UNDI supported device. Once
Early UNDI initialized, the UNDI option ROM initialization image
ROM Scan must be copied to UMB. Call PXENV_UNDI_CLOSE,
Shutdown PXENV_UNDI_SHUTDOWN
UNDI option ROMs must have a static ROM ID UNDI
structure and UNDI Loader routine within the option
Verify UNDI ROM initialization image.
ROM ID Structure
Start
Unload
base-code. Check the exit and status codes. It is possible that
the memory cannot be freed or re-used.
No
Insert unused
Failure? Yes memory into
memory chain.
No
Memory cannot
Keep all? Yes
be released.
No
Stop
UINT32 flags;
UINT8 pad[56];
} v;
} vendor;
} BOOTPLAYER;
RESTART TFTP
Op-Code: PXENV_RESTART_TFTP (0073h)
Input: Far pointer to a t_PXENV_RESTART_TFTP parameter structure that has been initialized by the
caller. The t_PXENV_RESTART_TFTP parameter structure is identical to the
t_PXENV_TFTP_OPEN parameter structure.
Output: If TFTP cannot be restarted, PXENV_EXIT_FAILURE must be returned and CF must be set. The
status field in the parameter structure must be set to one of the values represented by the
PXENV_STATUS_xxx constants. If TFTP is restarted, control is never returned to the caller.
Description: This service tries to establish a new TFTP connection with the server and to start a download of a
new NBP. The NBP to be downloaded will be determined by the previously downloaded NBP.
Once the NBP is downloaded into memory, control is passed to the NBP entry point.
The download address and entry point for x86 PC/AT architecture is 0:7C00h. No other system
memory is changed or initialized.
Note: It is the responsibility of the caller to make sure the network connection is in a valid state before
trying to restart TFTP. The existing network connection with the server needs to be maintained or
restored. The existing TFTP connection needs to be closed.
Service cannot be used in protected mode.
START UNDI
Op-Code: PXENV_START_UNDI (0000h)
Input: Far pointer to a t_PXENV_START_UNDI parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: This service is used to pass the BIOS parameter registers to the UNDI driver. The UNDI driver is
responsible for saving the information it needs to communicate with the hardware.
This service is also responsible for hooking the Int 1Ah service routine
Note: This API service must be called only once during UNDI Option ROM boot.
The UNDI driver is responsible for saving this information and using it every time
PXENV_UNDI_STARTUP is called.
Service cannot be used in protected mode.
typedef struct s_PXENV_START_UNDI { Set before calling API service
PXENV_STATUS Status; AX, BX, DX, DI, ES: BIOS initialization parameter registers. These
UINT16 AX; fields should contain the same information passed to the option ROM
UINT16 BX; initialization routine by the Host System BIOS. Information about the
UINT16 DX; contents of these registers can be found in the [PnP], [PCI] and
UINT16 DI; [BBS] specifications.
UINT16 ES; Returned from API service
} t_PXENV_START_UNDI; Status: See the PXENV_STATUS_xxx constants.
STOP UNDI
Op-Code: PXENV_STOP_UNDI (0015h)
Input: Far pointer to a t_PXENV_STOP_UNDI parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: This routine is responsible for unhooking the Int 1Ah service routine.
Note: This API service must be called only once at the end of UNDI Option ROM boot. One of the valid
status codes is PXENV_STATUS_KEEP. If this status is returned, UNDI must not be removed from
base memory. Also, UNDI must not be removed from base memory if BC is not removed from base
memory.
Service cannot be used in protected mode.
START BASE
Op-Code: PXENV_START_BASE (0075h)
Input: Far pointer to a t_PXENV_START_BASE parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: This API service is used to start the BC. The BC will make calls to UNDI as needed to implement
an IP stack and start the DHCP client software.
Service cannot be used in protected mode.
Note: The UNDI driver must be started first. Refer to the START UNDI API call.
typedef struct s_PXENV_START_BASE Set before calling API service
{
N/A
PXENV_STATUS Status;
} t_PXENV_START_BASE; Returned from API service
Status: See the PXENV_STATUS_xxx constants.
STOP BASE
Op-Code: PXENV_STOP_BASE (0076h)
Input: Far pointer to a t_PXENV_STOP_BASE parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: This API service is used to stop the BC. The BC will make calls to UNDI as needed.
Note: The BC must be started first. Refer to the START_BASE API call. One of the valid status codes is
PXENV_STATUS_KEEP. If this status is returned, BC must not be removed from base memory.
Service cannot be used in protected mode.
typedef struct s_PXENV_STOP_BASE Set before calling API service
{
N/A
PXENV_STATUS Status;
} t_PXENV_STOP_BASE; Returned from API service
Status: See the PXENV_STATUS_xxx constants.
TFTP OPEN
Op-Code: PXENV_TFTP_OPEN (0020h)
Input: Far pointer to a t_PXENV_TFTP_OPEN parameter structure that has been initialized by the caller.
The IP addresses and port numbers in this structure are to be stored in big endian (Motorola)
format.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: Opens a TFTP connection for reading/writing. At any one time there can be only one open
connection. The connection must be closed before another can be opened.
TFTP CLOSE
Op-Code: PXENV_TFTP_CLOSE (0021h)
Input: Far pointer to a t_PXENV_TFTP_CLOSE parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: Closes the previously opened TFTP connection.
Note: Service cannot be used if there is not an active MTFTP connection.
Service cannot be used in protected mode if the StatusCallout field in the !PXE structure is set to
zero.
Service cannot be used with a 32-bit stack segment.
typedef struct s_PXENV_TFTP_CLOSE Set before calling API service
{
N/A
PXENV_STATUS Status;
} t_PXENV_TFTP_CLOSE; Returned from API service
Status: See the PXENV_STATUS_xxx constants.
TFTP READ
Op-Code: PXENV_TFTP_READ (0022h)
Input: Far pointer to a t_PXENV_TFTP_READ parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants. When a read is successful, the PacketNumber and Packet Lengths must also be filled
in.
Description: Reads one packet from the open TFTP connection.
Note: Service cannot be used if there is not an active MTFTP connection.
Service cannot be used in protected mode if the StatusCallout field in the !PXE structure is set to
zero.
Service cannot be used with a 32-bit stack segment.
TFTP_GET_FILE_SIZE
Op-Code: PXENV_TFTP_GET_FSIZE (0025h)
Input: Far pointer to a t_PXENV_TFTP_GET_FSIZE parameter structure that has been initialized by the
caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in the
parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants. When the call is successful, the FileSize field must be filled in.
Description This service will query the server for the size of the given file using TFTP option extension protocol.
This service will not and hence must not be used to open a TFTP connection for the given file.
Note: Service cannot be used if a MTFTP or UDP connection is active.
Service cannot be used in protected mode if the StatusCallout field in the !PXE structure is set to
zero.
Service cannot be used with a 32-bit stack segment.
typedef struct s_PXENV_TFTP_GET_FSIZE Set before calling API service
{ ServerIPAddress: IP address of TFTP server.
PXENV_STATUS Status; GatewayIPAddress: IP address of relay agent. If this address is set
IP4 ServerIPAddress; to zero, the IP layer will resolve this using its own routing table.
IP4 GatewayIPAddress;
Filename: Name of file on TFTP server. Null terminated.
UINT8 FileName[128];
UINT32 FileSize;
Returned from API service
} t_PXENV_TFTP_GET_FSIZE; Status: See the PXENV_STATUS_xxx constants.
Filesize: Size of the file in bytes.
UDP OPEN
Op-Code: PXENV_UDP_OPEN (0030h)
Input: Far pointer to a t_PXENV_UDP_OPEN parameter.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: Opens a UDP connection for reading and writing. There can only be one open connection at a time.
Note: Service cannot be used if a MTFTP or UDP connection is active.
Service cannot be used in protected mode if the StatusCallout field in the !PXE structure is set to
zero.
Service cannot be used with a 32-bit stack segment.
typedef struct s_PXENV_UDP_OPEN Set before calling API service
{ SrcIP: IP address of this station.
PXENV_STATUS status; Returned from API service
IP4 src_ip; Status: See the PXENV_STATUS_xxx constants.
} t_PXENV_UDP_OPEN;
UDP CLOSE
Op-Code: PXENV_UDP_CLOSE (0031h)
Input: Far pointer to a t_PXENV_UDP_CLOSE parameter.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: Closes the previously opened UDP connection.
Note: Service cannot be used if a MTFTP is active, or if there is no active UDP connection.
Service cannot be used in protected mode if the StatusCallout field in the !PXE structure is set to
zero.
Service cannot be used with a 32-bit stack segment.
typedef struct s_PXENV_UDP_CLOSE Set before calling API service
{ N/A
PXENV_STATUS status; Returned from API service
} t_PXENV_UDP_CLOSE; Status: See the PXENV_STATUS_xxx constants.
UDP WRITE
Op-Code: PXENV_UDP_WRITE (0033h)
Input: Far pointer to a t_PXENV_UDP_WRITE parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: Writes one packet to the specified IP address on the open UDP connection.
Note: Service cannot be used if a MTFTP is active, or if there is no active UDP connection.
Service cannot be used in protected mode if the StatusCallout field in the !PXE structure is set to
zero.
Service cannot be used with a 32-bit stack segment.
typedef struct s_PXENV_UDP_WRITE Set before calling API service
{ IP: Destination IP address.
PXENV_STATUS status; GW: IP address of relay agent. If this address is set to zero, the IP
IP4 ip; layer will resolve this using its own routing table.
IP4 gw;
SrcPort: Source UDP port. Assigned 2069 if set to zero.
UDP_PORT src_port;
UDP_PORT dst port;
DstPort: Destination UDP port.
UINT16 buffer_size; BufferSize: Length of the packet in bytes.
SEGOFF16 buffer; Buffer: Segment:Offset of the packet buffer.
} t_PXENV_UDP_WRITE;
Returned from API service
Status: See the PXENV_STATUS_xxx constants.
UDP READ
Op-Code: PXENV_UDP_READ (0032h)
Input: Far pointer to a t_PXENV_UDP_READ parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
This API function is non-blocking and returns the same values as
PXENV_UNDI_TRANSMIT_PACKET.
PXENV_EXIT_SUCCESS/PXENV_STATUS_SUCCESS is returned if a packet has been
transferred into the caller’s buffer.
PXENV_EXIT_FAILURE/PXENV_STATUS_FAILURE is returned if no packet is available to
transfer.
Description: Reads one packet from the opened UDP connection.
Note: Service cannot be used if a MTFTP is active, or if there is no active UDP connection.
Service cannot be used in protected mode if the StatusCallout field in the !PXE structure is set to
zero.
Service cannot be used with a 32-bit stack segment.
UNDI STARTUP
Op-Code: PXENV_UNDI_STARTUP (0001h)
Input: Far pointer to a t_PXENV_UNDI_STARTUP parameter structure that has been initialized by the
caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the
PXENV_STATUS_xxx constants.
Description: This API is responsible for initializing the contents of the UNDI code & data segment for proper
operation. Information from the !PXE structure and the first PXENV_START_UNDI API call is used
to complete this initialization. The rest of the UNDI APIs will not be available until this call has
been completed.
Note: PXENV_UNDI_STARTUP must not be called again without first calling
PXENV_UNDI_SHUTDOWN.
PXENV_UNDI_STARTUP and PXENV_UNDI_SHUTDOWN are no longer responsible for
chaining interrupt 1Ah. This must be done by the PXENV_START_UNDI and
PXENV_STOP_UNDI API calls.
This service cannot be used in protected mode.
typedef struct s_PXENV_UNDI_STARTUP Set before calling API service
{
N/A
PXENV_STATUS Status;
} t_PXENV_UNDI_STARTUP; Returned from API service
Status: See the PXENV_STATUS_xxx constants.
UNDI CLEANUP
Op-Code: PXENV_UNDI_CLEANUP (0002h)
Input: Far pointer to a t_PXENV_UNDI_CLEANUP parameter structure.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field
in the parameter structure must be set to one of the values represented by the
PXENV_STATUS_xxx constants.
Description: This call will prepare the network adapter driver to be unloaded from memory. This call must be
made just before unloading the Universal NIC Driver. The rest of the API will not be available
after this call executes.
This service cannot be used in protected mode.
typedef struct s_PXENV_UNDI_CLEANUP { Set before calling API service
PXENX_STATUS Status; N/A
} t_PXENV_UNDI_CLEANUP;
Returned from API service
Status: See the PXENV_STATUS_xxx constants.
UNDI INITIALIZE
Op-Code: PXENV_UNDI_INITIALIZE (0003h)
Input: Far pointer to a t_PXENV_UNDI_INITIALIZE parameter structure that has been initialized by the
caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: This call resets the adapter and programs it with default parameters. The default parameters used
are those supplied to the most recent UNDI_STARTUP call. This routine does not enable the
receive and transmit units of the network adapter to readily receive or transmit packets. The
application must call PXENV_UNDI_OPEN to logically connect the network adapter to the network.
This call must be made by an application to establish an interface to the network adapter driver.
Note: When the PXE code makes this call to initialize the network adapter, it passes a NULL pointer for
the Protocol field in the parameter structure.
typedef struct Set before calling API service
s_PXENV_UNDI_INITIALIZE { ProtocolIni: Physical address of a memory copy of the driver
PXENV_STATUS Status; module from the ‘protocol.ini’ file obtained from the protocol manager
ADDR32 ProtocolIni; driver (refer to the NDIS 2.0 specification). This parameter is
UINT8 reserved[8]; supported for the universal NDIS driver to pass the information
} t_PXENV_UNDI_INITIALIZE; contained in the ‘protocol.ini’ file to the NIC driver for any specific
configuration of the NIC. (Note that the module identification in the
‘protocol.ini’ file was done by NDIS.) This value can be NULL for any
other application interfacing to the universal NIC driver
Returned from API service
Status: See the PXENV_STATUS_xxx constants.
UNDI SHUTDOWN
Op-Code: PXENV_UNDI_SHUTDOWN (0005h)
UNDI OPEN
Op-Code: PXENV_UNDI_OPEN (0006h)
Input: Far pointer to a t_PXENV_UNDI_OPEN parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: This call activates the adapter’s network connection and sets the adapter ready to accept packets
for transmit and receive.
typedef struct s_PXENV_UNDI_OPEN Set before calling API service
{ OpenFlag: This is an adapter specific input parameter. This is
PXENV_STATUS Status; supported for the universal NDIS 2.0 driver to pass in the open flags
UINT16 OpenFlag; provided by the protocol driver. (See the NDIS 2.0 specification.)
UINT16 PktFilter; This can be zero.
#define FLTR_DIRECTED 0x0001 PktFilter: Filter for receiving packets. This can be one, or more, of
#define FLTR_BRDCST 0x0002 the FLTR_xxx constants. Multiple values are arithmetically or-ed
#define FLTR_PRMSCS 0x0004 together.
#define FLTR_SRC_RTG 0x0008 “Directed” packets are packets that may come to your MAC address
or the multicast MAC address.
t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf: See definition in UNDI RESET ADAPTER (0004h).
R_Mcast_Buf;
Returned from API service
} t_PXENV_UNDI_OPEN;
Status: See the PXENV_STATUS_xxx constants.
UNDI CLOSE
Op-Code: PXENV_UNDI_CLOSE (0007h)
Input: Far pointer to a t_PXENV_UNDI_CLOSE parameter.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: This call disconnects the network adapter from the network. Packets cannot be transmitted or
received until the network adapter is open again.
typedef struct s_PXENV_UNDI_CLOSE Set before calling API service
{
N/A
PXENV_STATUS Status;
} t_PXENV_UNDI_CLOSE; Returned from API service
Status: See the PXENV_STATUS_xxx constants.
Description: This call, if successful, provides the NIC-specific information necessary to identify the network
adapter that is used to boot the system.
Note: The application first gets the DHCPDISCOVER packet using GET_CACHED_INFO and checks if
the UNDI is supported before making this call. If the UNDI is not supported, the NIC-specific
information can be obtained from the DHCPDISCOVER packet itself.
PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE must be called
before the information provided is valid.
typedef s_PXENV_UNDI_GET_NIC_TYPE Set before calling API service
{ N/A
PXENV_STATUS Status; Returned from API service
UINT8 NicType; Status: See the PXENV_STATUS_xxx constants.
#define PCI_NIC 2
NICType: Type of NIC information stored in the parameter
#define PnP_NIC 3 structure.
#define CardBus_NIC 4
Info: Information about the fields in this union can be found
in the [PnP] and [PCI] specifications
Union {
Struct {
UINT16 Vendor_ID;
UINT16 Dev_ID;
UINT8 Base_Class;
UINT8 Sub_Class;
UINT8 Prog_Intf;
UINT8 Rev;
UINT16 BusDevFunc;
UINT16 SubVendor_ID;
UINT16 SubDevice_ID;
} pci, cardbus;
struct {
UINT32 EISA_Dev_ID;
UINT8 Base_Class;
UINT8 Sub_Class;
UINT8 Prog_Intf;
UINT16 CardSelNum;
} pnp;
} info;
} t_PXENV_UNDI_GET_NIC_TYPE;
UNDI ISR
Op-Code: PXENV_UNDI_ISR (0014h)
Input: Far pointer to a t_PXENV_UNDI_ISR parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
constants.
Description: This API function will be called at different levels of processing the interrupt. The FuncFlag field in
the parameter block indicates the operation to be performed for the call. This field is filled with the
status of that operation on return.
Is this our
No Yes
interrupt?
Send EOI to PIC.
Interrupt Complete Flag strategy thread
to start
No
yes Is
Copy data. flag=3 this a receive
(receive) int?
No
Yes Is
Release transmit flag=2
this a transmit
buffer (if any) (transmit
complete) int?
No
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =*/
/* Exit codes returned in AX by a PXENV API service.
*/
#define PXENV_EXIT_SUCCESS 0x0000
#define PXENV_EXIT_FAILURE 0x0001
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
/* Status codes returned in the status word of PXENV API parameter
* structures. Some of these codes are also used to return status
* from an NBP to the boot ROM. */
/* Generic API status & error codes that are reported by the loader */
4.1 Overview
Understanding the Initial Program Load (IPL) process requires some background on the evolution of
Intel Processor Architecture because the IPL process has evolved and become more complex over
time. This section identifies the initial system architecture and the evolutionary steps related to IPL
that have occurred since the first IBM PC was introduced in 1981.
The original IBM PC used an Intel 8088 processor with a 20-bit addressable memory space or 1MB.
This processor uses a segmented architecture where a segment may begin on any 16-byte boundary.
To reach a particular memory location requires two 16-bit registers within the processor: a segment
register and an offset register. The segment register is set to the upper 16-bits of a 20-bit address and
the offset register is used to access anywhere within a 64KB address range from the base address set
by the segment register.
The 1MB address space is also subdivided into several functional areas. When an x86 processor is
reset, it begins execution 16 bytes from the top of memory. To handle reset vectoring, a ROM-based
Basic Input Output System or BIOS is placed at the top of memory. Since the BIOS is typically in
Read-Only Memory it is often referred to as ROM BIOS. The BIOS provides a standard software
interface to system hardware and Power On Self Test or POST processing. Initially, the top 64KB
were reserved for the BIOS.
The first 1KB of address space is used as vectors for the 256 levels of interrupts supported by Intel
x86 processors. Several of these vectors are used for traditional hardware event notification. The x86
processor also supports the concept of a software interrupt invoked explicitly by the software INT
instruction.
The software interrupt feature permits a process in one area of memory to invoke a second process in
another area without having to know the address of the second process. In addition, if the second
process performs a well-defined function, another process may replace the interrupt vector with the
address of a local routine to filter or completely replace the first process. The ROM BIOS uses
software interrupts as the method for entering most BIOS-provided services.
After power-on or reset, the ROM BIOS POST process first initializes BIOS-aware system hardware
to a known state. POST also establishes a number of system interrupt vectors, both hardware and
software. The software vectors serve as a means of invoking BIOS services using the INT instruction.
After the interrupt vectors, the rest of the lower 640KBof address space is typically used for BIOS
scratch pad storage, the operating system and temporary program space. The next 128KB are set
aside for memory mapped video buffers. The remaining address space below the ROM BIOS and
above the video buffers was initially reserved for the use of Option ROMs. Over time this area has
come to be called Upper Memory.
An Option ROM is used to extend the services or capabilities of the BIOS prior to IPL. It is the only
way, other than directly modifying the BIOS, that new devices may be added to the IPL process.
During POST, the BIOS scans the Upper Memory area for Option ROMs that have been mapped into
Version 2.1 September 20, 1999
Copyright © 1998, 1999 Intel Corporation. All rights reserved.
Preboot Execution Environment (PXE) Specification 72
this space by adapter cards plugged into a system expansion bus. A valid Option ROM begins on a
2KB boundary and contains a data structure with a signature, the length of the Option ROM and an
entry point for initialization code.
If a valid Option ROM is located by the BIOS, the ROM’s initialization code is invoked. Option
ROMs replace or filter standard BIOS services by replacing the BIOS initialized interrupt vectors.
The original IPL sources for the first Intel architecture system (the IBM PC) included cassette tape
and floppy drives. Fixed disks were added to the standard IPL process with the introduction of the
IBM XT, though several vendors had previously provided proprietary approaches. The IBM XT used
an Option ROM on the fixed disk controller to re-vector the diskette support routine in the BIOS and
install additional routines for supporting partitioned fixed disk drives. Within the IBM definition of
IPL, only the first floppy drive or the first fixed drive was bootable.
The IBM AT followed the IBM XT. The IBM AT introduced a new Intel processor, the 80286. This
processor was backward compatible with the 8086 when operated in what was called real mode. Real
mode was the default mode when the processor was reset or first powered-on. The 80286 also offered
an additional mode of operation called protected mode. Protected mode expanded the addressable
memory space to 24 bits or 16MB. Support for protected mode on the 80286 was limited, but it did
allow simple storage of data above 1 megabyte in what was termed extended memory. Routines
added to the ROM BIOS and still available today provide simple methods to access Extended
Memory.
Subsequent Intel Architecture systems have added more powerful processors with even larger
address spaces of 32 bits or 4GB and new modes of operation. However, for backward compatibility,
real mode continues to be used for IPL.
Until the widespread acceptance of Windows, most operating systems also continued to use real
mode. This meant most applications were limited to the amount of system memory left after loading
the operating system and any additional device drivers into System Memory. As the operating system
and associated device drivers became more complex they required more System Memory. To relieve
what came to be called RAM cram, the Upper Memory area became the location where hardware
“windows” were created to bank switch Expansion Memory, really an entirely separate address
space, into the 1 megabyte address space of real mode. Initially, this required special hardware and
worked best for data storage. As the technology evolved, Expansion Memory began to be used to
store executable programs, especially device drivers that had been taking up precious system
memory.
At some point, system vendors realized that copying Option ROMs into RAM improved overall
system performance. This was due to the fact that the access speed for RAM devices was much faster
than ROM devices. So ROM BIOS was again extended, this time to copy Option ROMs into special
Shadow RAM that was then mapped over the Option ROM. After copying, the Shadow RAM was
write-protected to make sure it exhibited the same characteristics as the original Option ROM.
It became apparent that Shadow RAM could also be used to provide some of the same benefits of
Expansion Memory. In particular, if Shadow RAM was mapped into a vacant Upper Memory space,
the same device drivers previously moved into Expansion Memory could be moved into Shadow
RAM without requiring the specialized Expansion Memory hardware.
At the same time systems were increasing in memory size and processor speed, more and faster
peripherals were being added and the expansion bus was becoming a limiting factor for system
performance. The speed of the initial Industry Standard Architecture or ISA bus was increased from
4.77 MHz to 6 MHz and beyond and then replaced or augmented by a range of buses known as Micro
Channel, EISA and VESA. Though these expansion busses may have been electrically different, the
IPL process remained the same, until the Peripheral Component Interconnect or PCI bus.
The PCI bus affected IPL in two ways. First, Option ROMs were no longer hardware-mapped into
the Upper Memory area. Instead, Option ROM images on PCI cards were copied into Shadow RAM
for initialization. This allowed the image copied into Shadow RAM to shrink by discarding
initialization code after initialization. The initialization code simply updates the length in the Option
ROM header also copied into Shadow RAM. The BIOS POST also provided bus specific information
about the device to the initialization code. This allowed multiple devices of the same type to be
resident in the system, each with their own Option ROM support.
The [PnP] Specification also defines a method for Option ROMs on non-PCI devices to indicate they
support being copied into Shadow RAM in Upper Memory. The Device Driver Interface Module
(DDIM) is a single page at the end of the [PnP] specification that describes how an Option ROM can
identify this capability.
The second way the PCI bus affected IPL was the corresponding [PnP] Specification. This
specification defined Plug and Play headers in the Option ROM. These headers provide additional
information that includes IPL-related information. In particular, there are two fields that contain
pointers to special extended initialization routines:
! Boot Connection Vector (BCV)
! Bootstrap Entry Vector (BEV)
The BCV is used for devices that replace or supplement the BIOS disk IPL services to be a bootable
device. The BEV is used for devices that have an alternative IPL method not related to the BIOS disk
services. Thus, PCI and the Plug and Play BIOS specification provided some of the initial framework
required to organize bootable devices. In 1996, Compaq, Intel and Phoenix introduced the [BBS]
Specification. The [BBS] uses information from the multiple specifications related to IPL and
attempts to present a unified definition for BIOS Boot technology. The [BBS] identifies different
categories of boot devices:
! BIOS Aware IPL Devices (BAID)
! Boot Connection Vector (BCV) devices
! Bootstrap Entry Vector (BEV) devices
The BIOS maintains an IPL Table listing all of the possible IPL sources. BIOS Aware IPL Devices
have all the code necessary to perform IPL resident in the system BIOS. BAID devices include
floppy or fixed drives.
BCV and BEV devices use Option ROMs associated with the IPL device to extend the IPL Table.
These Option ROMs may be resident on the associated device or in non-volatile storage on the
motherboard. PXE is implemented as a BEV device.
The BIOS adds IPL devices to the BBS IPL Table already containing the BAIDs. These devices are
identified during the BIOS Option ROM scan process. If the device hardware is detected and the rest
of Option ROM initialization is successful (in other words, the Option ROM initialization code and
loader code are placed in upper memory), control is returned to the BIOS indicating the Option ROM
manages an IPL device. Within the ROM, a Plug and Play Expansion header will be present for each
bootable device supported by the Option ROM. Each PnP Expansion header for a PXE IPL device
will have a non-zero BEV.
Once Option ROM scan is complete, the BIOS builds a list of bootable devices using the information
obtained during the scan. According to the [BBS], the priority list for these devices is established by
the enduser through BIOS setup.
PXE
PCI
Init & Loader
Code
(~ 6K)
Monolithic PXE
PXE NIC Specific
(~ 29K) Code
(~ 9K)
PXE
Base Code
(~ 15K)
The BUSD ROM provides bus support for CardBus-based network interface cards. BUSD is only
required if supporting CardBus. Unlike the Base-Code and UNDI ROMs, BUSD’s call mechanism
must be added to the BIOS.
BC Initialize
Structures " $PnP Struct UNDI Option ROMs " $PnP Struct Structures
" 'UNDI' ROMID Struct The top portion of these ROMs is " 'UNDI' ROMID Struct
" UNDI Loader Code static and must reside within the " UNDI Loader Code
" UNDI Init Code memory defined in the option ROM " UNDI Init Code
header.
BUSD API
(~1K)
Power-On
Option ROM Base-Code Runtime
Scan and Init UNDI H/W init &
enable Interrupt
BBS must be supported in a PXE UNDI ROM UNDI & BUSD option ROM initialization code does
compliant BIOS. not know if there will be a Base-Code at this time. Service Routine
Scan & Init
(ISR)
Return Control to BIOS Call UNDI IPL All PXE UNDIs are IPL devices.
Discover
Remote.0
PXENV_RESTART
UNDI IPL BUSD_ENABLE _TFTP
Install & Start Download & Call
(Initial Program Load) Remote.0
BUSD UNDI Boot code scans UMB for the PXE Loader
portion of the Base-Code option ROM.
UNDI may use its own Base-Code if it has one. Base-Code will push a 32bit far
Offset 16h in a Base-Code option ROM will point pointer to the !PXE structure and load
Scan UMB for BC at the Base-Code ROM ID structure. ES:BX with the address of the
Loader If no Base-Code ROM is found, UNDI device fails PXENV+ structure before making a far
call to Remote.0 at 0:7C00h.
Stop & the boot and returns control to the BIOS.
BUSD_DISABLE
Remove BUSD
Call BC Loader
UNDI passes pointer to its ROM ID structure to the Remote.0 Execute
PXE Loader portion of the Base-Code.
Remote.0.
Downloaded Discover &
BC Loader (UMB portion of Base-Code) to 0:7C00h MTFTP Remote.1
Save BIOS CPU stack so control can Switch to PXE Use the larger of the stack segment sizes from the
be returned if remote boot fails. CPU Stack ROM ID structures. PXENV_STOP_UNDI Stop UNDI
If UNDI is removed,
Installation is done by UNDI Loader in the
Call UNDI Loader UNDI UMB image.
then Remote.1 will not Remove UNDI
be able to use it.
UNDI Option What is saved (or needs to be saved) here depends on the
ROM Init hardware being controlled by the UNDI. For PnP, PCI and
CardBus devices, the parameter registers (AX, BX, DX, DI
& ES) must be saved so they can be used during IPL.
Save parameter If the BIOS and UNDI option ROM support DDIM, the
registers for IPL. initialization code should be removed from upper memory.
If the BIOS supports PMM and the UNDI runtime image is
in UMB, the runtime image must be relocated to extended
memory.
Conserve UMB
Refer to the [BBS] for information on registering an option
ROM as an IPL device.
Table 4-3 Memory Map after UNDI ROM Transferred to UMB from BIOS ROM
Table 4-5 Memory Map after BUSD ROM Transferred to UMB from BIOS ROM
hardware. It is to be transferred to UMB and initialized. The BC option ROM requires DDIM
support.
Table 4-7 Memory Map after BC ROM Transferred to UMB from BIOS ROM
Base-Code
Option ROM Init
Checkpoints:
" Offset 0x16 of the option ROM header contains
the offset of the Base-Code ROM ID structure.
Place BC Loader
portion in UMB " The Base-Code ROM ID structure contains the
offset of the installation procedure.
" The installation procedure knows how to load
the Base-Code into base memory.
Place Base-Code
Runtime in PMM
if available
If the BIOS and Base-Code option ROM support
DDIM, the initialization code should be removed from
upper memory.
Conserve UMB
If the BIOS supports PMM and the Base-Code
runtime image is in UMB, the runtime image must be
relocated to extended memory.
Return control
to BIOS
Was matching
BUSD found?
Yes
UNDI ROM boot code must scan UMB for a BUSD ROM
ID structure with a matching bus ID string. If one is found,
Call
No UNDI must call the BUSD_ENABLE
BUSD_ENABLE
If UNDI does not have its own BC, scan UMB for $BC$
ROM ID structure. Validate the $BC$ ROM ID structure
Call BC Loader
before calling the BC loader.
Was matching
BUSD found?
Yes
Call
No
BUSD_DISABLE
Return control
to BIOS
4.4.4 BC Runtime
The three possibilities for PXE API combinations left in memory are:
! Base-Code and UNDI are instructed to be removed from base memory. In this case, the NBP
has returned AX == PXENV_STATUS_SUCCESS.
! Base-Code is instructed to be removed, but UNDI is to be kept in base memory. In this case,
the NBP returned AX == PXENV_STATUS_KEEP_UNDI.
! Base-Code and UNDI are instructed to be kept in base memory. In this case, the NBP returned
AX == PXENV_STATUS_KEEP_ALL.
! Any other value in AX is the same as PXENV_STATUS_SUCCESS.
The initial Network Bootstrap Program (NBP) size should not exceed 32KB. While it is possible to
download a larger program as the initial NBP, the 32K size limit provides the advantage of being
able to clean up and fail gracefully if it is determined the system is not adequate for the intended
application or OS image. For example, when remote booting an operating system, it is strongly
recommended that the load be broken into at least two files, where the first executable is not larger
than 32K. It should be the purpose of this executable to determine whether the client system has
adequate resources to successfully boot the OS in question. If not, this executable should fail the
boot.
This memory map shows the NBP “Remote.0” being loaded into memory (and some memory being
reserved for a subsequent remote DOS boot [“Remote.1”]).
! Clean up the CPU stack after control is returned from the BC loader routine.
! Return control to the Host System BIOS.
4.5.1.5 UNDI Driver
The UNDI driver may be included within the memory defined by the option ROM header. An UNDI
driver must be able to:
!Operate in real mode.
!Operate in 16:16 protected mode with a 16-bit (SP) stack segment.
! Operate in 16:16 protected mode with a 32-bit (ESP) stack segment.
An UNDI driver must:
! Always set AX and Status field for all UNDI APIs on success or failure.
! Call the Base-Code API entry point for all non-UNDI APIs.
! Before making this far call, the UNDI driver must push the following parameters (in this
order) onto the stack:
! !PXE segment (16-bit)
! !PXE offset (16-bit)
! Param segment (16-bit)
! Param offset (16-bit)
! Function (16-bit)
! Clean up the stack.
! Return Base-Code AX/Status without changes to caller.
UNDI driver API specifications, parameter passing and status/result codes are covered in other
sections in this document.
BUSD Disable
Op-Code: BUSD_DISABLE (0000h)
Input: Far pointer to a t_BUSD_DISABLE parameter structure that has been initialized by the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status
field in the parameter structure must be set to one of the values represented by the
PXENV_STATUS_xxx constants.
Description: This service is used to disable a configured bridge. This is done byte the UNDI IPL before
returning control to the BIOS IPL selection routine when a remote boot has been aborted.
NBPs that need to enable a driver that expects to have the bridge disabled can also do this.
Typedef struct s_BUSD_DISABLE { Set before calling API service
PXENV_STATUS Status; AX, BX, DX, DI, ES: Register values passed by the BIOS
UINT16 AX; to the UNDI option ROM initialization entry point.
UINT16 BX; UNDI_ROMID: Segment and offset of the UNDI ROMID
UINT16 DX; structure.
UINT16 DI; Returned from API service
UINT16 ES; Status: PXENV_STATUS_SUCCESS or one of the PXE
SEGOFF16 UNDI_ROMID; error codes.
} t_BUSD_DISABLE;
BUSD Enable
Op-Code: BUSD_ENABLE (0001h)
Input: Far pointer to a t_PXENV_BUSD_ENABLE parameter structure that has been initialized by
the caller.
Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status
field in the parameter structure must be set to one of the values represented by the
PXENV_STATUS_xxx constants.
Description: This service is used by the UNDI_IPL to reconfigure a bridge at the beginning of the UNDI
IPL. The UNDI loader routine and the UNDI driver expect the bridge to be configured before
they are called.
Typedef struct s_BUSD_ENABLE { Set before calling API service
PXENV_STATUS Status; AX, BX, DX, DI, ES: Register values passed by the BIOS
UINT16 AX; to the UNDI option ROM initialization entry point.
UINT16 BX; UNDI_ROMID: Segment and offset of the UNDI ROMID
UINT16 DX; structure.
UINT16 DI; Returned from API service
UINT16 ES; Status: PXENV_STATUS_SUCCESS or one of the PXE
SEGOFF16 UNDI_ROMID; error codes.
} t_BUSD_ENABLE;
! Call the following PXE APIs, with the required parameters, in this order:
PXENV_START_UNDI, PXENV_START_BASE, PXENV_STOP_BASE,
PXENV_STOP_UNDI.
! Clean up, and release allocated base memory, if required.
The Base-Code loader requires:
!The UNDI IPL routine to make a far call to the BC loader routine passing a far pointer to the
BC loader parameter structure.
! The UNDI IPL routine is also responsible for removing the parameters from the stack.
BC Loader Parameter Structure
Typedef struct s_BC_LOADER {
PXENV_STATUS Status; Pass/Fail status: See PXENV_STATUS_xxx #defines
UINT16 AX; In: AX passed to UNDI initialization routine
UINT16 BX; In: BX passed to UNDI initialization routine
UINT16 DX; In: DX passed to UNDI initialization routine
UINT16 DI; In: DI passed to UNDI initialization routine
UINT16 ES; In: ES passed to UNDI initialization routine
SEGOFF16 UNDI_ROMID; In: Offset of UNDI ROMID structure
} t_BC_LOADER;
4.5.3.4 BC Runtime
The BC runtime must be capable of executing in real mode and 16:16 protected mode with a 16-bit
(SP) stack segment. The BC runtime does not need to support a 32-bit (ESP) stack segment.
The BC runtime starts when the PXENV_START_BASE API is called from the BC loader. Control
is not returned to the BC loader unless remote boot fails, at which time PXENV_STOP_BASE and
PXENV_STOP_UNDI will be called.
The BC runtime must:
! Call the PXENV_UNDI_GET_INFORMATION API.
! Provide an ISR that calls PXENV_UNDI_ISR.
! Implement DHCP and TFTP client protocols, as defined in this specification.
! Provide the Preboot, UDP and TFTP APIs.
This section discusses host system BIOS support required for PXE compliance and how PXE boot
devices (ROMs) and PXE Network Boot Programs (NBPs) use it.
5.2.2.1 Detection
PXE-compliant NBPs should implement two methods of Remote Wake-Up source detection to
enable legacy system support.
! Reading table-based SMBIOS structures
! Reading SMBIOS structures through the PnP function interface
5.2.3 Bootstraps
PXE-compliant boot ROMs must support the PnP/BBS bootstrap mechanism. If the PXE
implementation is to reside on a NIC, it should also support Int 18h and Int 19h bootstrap:
Note: Bootstrap interrupts 18h and 19h are mutually exclusive.