[syslinux] Sending UDP packets from comboot

Stefan Thomanek stefan at thomanek.eu
Wed Jun 3 08:34:37 PDT 2009


I was able to "fix" it, i forgot to copy the data back .... (head > wall)
I've attached the source code for receiving udp packets, it should work now

-Stefan

Stefan Thomanek schrieb:
> Yes i did, see the attached text file for the source. However, it 
> doesn't work.
> It does react on UDP packets, but the buffer is remains empty. Nothing 
> is written to it at all.
>
> Maybe someone is able to fix it, i'm sure its not a very big problem.
> If so, reply it to the mailing list please :)
>
>
> Kjetil.Mikkelborg at kongsberg.com schrieb:
>> 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.
>>
>> _______________________________________________
>> 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.
>>
>>   
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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.
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pxe_udp_read.txt
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20090603/b37ca814/attachment.txt>


More information about the Syslinux mailing list