PXE Preboot Functions

The Pre boot functions are confined mostly to the control and global information types of functions.

pxenv_unload_stack()

Unloads the stack pointer. The UNDI driver must be shutdown before making this call. This function must fail if the free base memory has changed since the last pxenv_start_base() call. If this fails, you must increase the size of the available base memory.

pxenv_ret_code_t pxenv_unload_stack(struct pxenv_unload_stack_s stackptr);

stackptr

This is a pointer to a pre-initialized stack structure.

These are the fields in the pxenv_unload_stack_s structure that get set by this function before returning.

stackptr.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

These are all the fields of the pxenv_unload_stack_s structure.


      typedef struct pxenv_start_unload_stack_s {
          pxenv_status_t status;
          u_int8_t reserved[10];
      } pxenv_unload_stack_t;

      

pxenv_get_cached_info()

Gets the cached info. This returns one of three data items.

These are used to configure the client to be able to complete the network connection.

pxenv_ret_code_t pxenv_get_cached_info(struct pxenv_get_cached_info_s cinfo_ptr);

cinfo_ptr

This is a pointer to a pre-initialized s_pxenv_get_cached_info structure. The info gets written here before returning.

These are the fields in the pxenv_get_cached_info_s structure that get set by this function before returning.

cinfo_ptr.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

cinfo_ptr.pkt_type

the type of packet in the cache. The valid types are defined below.

cinfo_ptr.buffer_size

the size of the receive buffer in bytes.

cinfo_ptr.buffer

the buffer address in offset:segment format.

These are all the fields of the pxenv_get_cached_info_s structure.

      
      typedef struct pxenv_get_cached_info_s {
          pxenv_status_t status;
          u_int16_t pkt_type;
          u_int16_t buffer_size;
          segoff16_t buffer;
      } pxenv_get_cached_info_t;

      

pxenv_restart_tftp()

This function starts the TFTP connection with the boot server, and starts download the boot image over the network. As a note, this function never returns if the TFTP session is started. It also requires that the network be functioning for this so succeed.

pxenv_ret_code_t pxenv_restart_tftp(struct pxenv_restart_tftp_s session);

session

This is a pointer to a pre-initialized s_pxenv_restart_tftp structure. The buffer size is set to the number of bytes written in the recieve buffer.

These are the fields in the pxenv__s structure that must be set before calling this function.

session.filename

a NULL terminated string represnting the boot file name.

session.buffer_size

the size of the receive buffer in bytes.

session.buffer

the buffer address in offset:segment format.

session.server_ip

the IP address of the TFTP server in Big Endian format.

session.gw_ip

the IP address of gateway in Big Endian format.

session.mcast_ip

the multicast IP address in Big Endian format.

session.tftp_clnt_port

.the port the client listens to for a multicast.

session.tftp_srv_port

the port the server listens to for a multicast.

session.tftp_open_timeout

the timeout value in seconds used for receiving data. If zero, the default of TFTP timeout is used.

session.tftp_reopen_delay

the maximum wait delay time in seconds between ACK of a fast packet and a new TFTP open.

These are the fields in the pxenv_restart_tftp_s structure that get set by this function before returning.

session.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

session.packetnum

the packet sequence number.

session.buffer_size

he size of the packet received in the buffer.

These are all the fields of the pxenv_restart_tftp_s structure.


      typedef struct pxenv_restart_tftp_s {
          pxenv_status_t status;
	  u_int8_t filename[128];
	  u_int32_t buffer_size;
	  addr32_t buffer;
	  ip4_t server_ip;
	  ip4_t gw_ip;
	  ip4_t mcast_ip;
	  udp_port_t tftp_clnt_port;
	  udp_port_t tftp_srv_port;
	  u_int16_t tftp_open_timeout;
	  u_int16_t tftp_reopen_delay;
      } pxenv_restart_tftp_t;

      

pxenv_start_undi()

This function passes the BIOS parameter registers to the driver. It is the responsibility of the driver to save this information if it expects to talk to the hardware. This is also required to hook the 0x1a service function.

pxenv_ret_code_t pxenv_start_undi(struct pxenv_start_undi_s startundi);

startundi

This is a pointer to a pre-initialized pxenv_start_undi_s structure.

These are the fields in the pxenv_start_undi_s structure that must be set before calling this function.

startundi.ax

this is the value of the AX register.

startundi.bx

this is the value of the X register.

startundi.dx

this is the value of the DX register.

startundi.di

this is the value of the DI register.

These are the fields in the pxenv_start_undi_s structure that get set by this function before returning.

startundi.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

These are all the fields of the pxenv_start_undi_s structure.


      typedef struct pxenv_start_undi_s {
          pxenv_status_t status;
	  u_int16_t ax;
	  u_int16_t bx;
	  u_int16_t dx;
	  u_int16_t di;
	  u_int16_t es;
      } pxenv_start_undi_t;

      

pxenv_stop_undi()

This function is required to unhook the 0x1a service function, and must only be called once at the end of a boot ROM.

pxenv_ret_code_t pxenv_stop_undi(struct pxenv_stop_undi_s stopundi);

stopundi

This is a pointer to a pre-initialized pxenv_stop_undi_s structure.

These are the fields in the pxenv_stop_undi_s structure that get set by this function before returning.

stopundi.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

These are all the fields of the pxenv_stop_undi_s structure.


      typedef struct pxenv_stop_undi_s {
          pxenv_status_t status;
      } pxenv_stop_undi_t;

      

pxenv_start_base()

This function starts the boot connection. This connection must support the driver's creation of an IP stack and suficient to start DHCP.

pxenv_ret_code_t pxenv_start_base(struct pxenv_start_base_s startbase);

startbase

This is a pointer to a pre-initialized pxenv_start_base_s structure.

These are the fields in the pxenv_start_base_s structure that get set by this function before returning.

startbase.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

These are all the fields of the pxenv_start_base_s structure.


      typedef struct pxenv_start_base_s {
          pxenv_status_t status;
      } pxenv_start_base_t;

      

pxenv_stop_base()

This stops the boot connection. This requires that the connection already has been started by pxenv_start_base() function.

pxenv_ret_code_t pxenv_stop_base(struct pxenv_stop_base_s stopbase);

stopbase

This is a pointer to a pre-initialized pxenv_stop_base_s structure.

These are the fields in the pxenv_stop_base_s structure that get set by this function before returning.

.status

The exit status of this function. This is set to one of the PXENV_STATUS_xxx constants.

These are all the fields of the pxenv_stop_base_s structure.


      typedef struct pxenv_stop_base_s {
          pxenv_status_t status;
      } pxenv_stop_base_t;