[syslinux] comboot+PXE stack

H. Peter Anvin hpa at zytor.com
Mon Nov 29 15:22:06 PST 2004


H. Peter Anvin wrote:
>>
>> Firstly: how to put in ES:DI the address of PXE_INFO?
>> Secondly: is PXE_INFO properly filled up?
>>
> 
> No, that's not how you do it from com32.  You have to fill out a 
> structure of type com32sys_t (defined in <com32.h>) and then invoke 
> __intcall(0x22, &ireg, &oreg) where ireg is input registers and oreg is 
> output registers (can be NULL).
> 
> For the IP address you probably care more about the ACK (2) than cached 
> reply (3), since the latter might come from the standalone PXE server as 
> opposed to the DHCP server.
> 

In addition, and I forgot this: real-mode utilities can only access the 
bottom 1 MB of memory, which is not where your COM32 program runs.  You 
have, however, a "bounce buffer" in low memory, guaranteed to be at 
least 64K in size, accessible as __com32.cs_bounce (assuming, of course, 
you're using <com32.h> and the standard com32 startup code.)  The exact 
size, in case if ends up mattering to you, is available as 
__com32.cs_bounce_size.

So you copy your structure into the bounce buffer, and then you have to 
create ES:BX values.  To do that, use the SEG() and OFFS() macros in 
<com32.h>:

	ireg.ebx.w[0] = OFFS(__com32.cs_bounce);
	ireg.es       =  SEG(__com32.cs_bounce);

On the way back, you get a real-mode pointer to the data, use 
MK_PTR(seg,off) to convert that to a protected-mode pointer.

	-hpa





More information about the Syslinux mailing list