[syslinux] Jumping to PXE boot from DOS

Oscar Gueta ogueta at yahoo.com
Tue Nov 23 14:55:41 PST 2004


Hello all,

     I want to create a program that runs from a
pxe-loaded virtual floppy (using memdisk + keeppxe) to
call again PXE boot.

     I took a piece of code form NILO to look for PXE
data structures and the call to function
PXENV_START_BASE from PXE spec as follows:

lower = (unsigned char *)LOWER_PXE_MEM;
upper = (unsigned char *)UPPER_PXE_MEM;

for (i=upper; i>lower;i--) {
        if (memcmp (i, sig, size) == 0) {
            /* We found it. Now see if it's usable. */
            /* Look for the version number. As the
names of this field
               are different for the PXE and PXENV
structures, we use an
               offset of 6 bytes, which is the same
for both structures. */
            if (*(i+6) != rev) {
                printf ("PXE version 0x%02x too
low.\r\n", *(i+6));
            } else {
                printf ("Found the %s data structure
at 0x%04x\r\n",
                                (type == PXE) ? "!PXE"
: "PXENV+", i);
                return (i);
            }
        }

However, this function never finds the PXE signatures.
Does anybody has any suggestion to make it work? After
finding the structure, I need to call function to see
if it returns to PXE boot again:


pxe_data_struct->entry16point (PXENV_START_BASE ,
(void *)0)


where pxe_data_struct looks as follows:


typedef struct pxe_s {
    u_int8_t signature[4];	/* Structure signature is
not NULL */
				/* terminated. FIXME: this was 4 */
    u_int8_t structlength;	/* Length of this structure
in */
				/* bytes. */
    u_int8_t structcksum;	/* Use to make byte checksum
of this */
				/* structure == zero. */
    u_int8_t structrev;		/* Structure format revision
number. */
    u_int8_t reserved1;		/* must be zero */
    undi_romid_t *undi;	        /* Far pointer to UNDI
ROMID */
    bc_romid_t *base;	        /* Far pointer to
base-code ROMID */
    u_int16_t (*entry16point)(u_int16_t func, void
*param);
                                /* 16bit stack segment
API entry */
				/* point.  This will be seg:off in */
				/* real mode and sel:off in 16:16 */
				/* protected mode. */
    u_int16_t (*entry32point)(u_int16_t func, void
*param);
				/* 32bit stack segment API entry */
				/* point.  This will be sel:off. */
				/* In real mode, sel == 0 */
    u_int16_t (*statuscallout)(u_int16_t param);
				/* Address of DHCP/TFTP status */
				/* callout routine. */
    u_int8_t reserved2;		/* must be zero */
    u_int8_t segdesccnt;	/* Number of segment
descriptors in */
				/* this structure. */
    u_int16_t firstselector;	/* First segment
descriptor in GDT */
				/* assigned to PXE. */
    newsegdesc_t stack;
    newsegdesc_t undidata;
    newsegdesc_t undicode;
    newsegdesc_t undicodewrite;
    newsegdesc_t bc_data;
    newsegdesc_t bc_code;
    newsegdesc_t bc_codewrite;
} pxe_t;


Any ideas?
Thanks

/Oscar


		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 




More information about the Syslinux mailing list