[syslinux] Sending UDP packets from comboot

Kjetil.Mikkelborg at kongsberg.com Kjetil.Mikkelborg at kongsberg.com
Tue Jun 2 05:58:02 PDT 2009


Hi great with some examples for those of us who only works with C :)

Have you looked at how the same code would be for reading the responce (PXENV_UDP_READ) ??

--Kjetil

-----Original Message-----
From: syslinux-bounces at zytor.com [mailto:syslinux-bounces at zytor.com] On Behalf Of Stefan Thomanek
Sent: 30. mai 2009 22:17
To: For discussion of Syslinux and tftp-hpa
Subject: Re: [syslinux] Sending UDP packets from comboot

H. Peter Anvin schrieb:
> Stefan Thomanek wrote:
>   
>> struct teststruct {
>>    uint16_t var1;
>>    uint8_t var2;
>>    uint16_t var3; };
>>
>>     
>
> That's a 6-byte structure, unless you specify __attribute__((packed)).
>
>   
>> Could anyone please take a look inside the text file and tell me where
>> i've made mistakes?
>>     
>
> You're overwriting your test data structure with your parameter structure:
>
>
>     // Bounce testdata
>     memcpy(__com32.cs_bounce, &test, sizeof(test));
>
>    [...]
>
>     // Bounce send struct
>     memcpy(__com32.cs_bounce, &args, sizeof(args));
>
>
> One way to do this is to put both your args and your data structure into
> a bigger structure; another option is to calculate where in the bounce
> buffer you can put your data.  The former is easier when you have
> fixed-size data, the latter can be more general.
>
> 	-hpa
>
>   
Ok, got it. Stupid me ><..
Changed the 2nd call to

	memcpy(__com32.cs_bounce + sizeof(test), &args, sizeof(args));

and the SEG/OFFS call to

	inputRegs.es = SEG(__com32.cs_bounce + sizeof(test));
	inputRegs.edi.w[0] = OFFS(__com32.cs_bounce + sizeof(test));

It works :)

_______________________________________________
Syslinux mailing list
Submissions to Syslinux at zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.




More information about the Syslinux mailing list