On Tue, Feb 9, 2010 at 8:17 AM, Stefan Hajnoczi <span dir="ltr"><<a href="mailto:stefanha@gmail.com">stefanha@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Tue, Feb 9, 2010 at 3:05 PM, Luca <<a href="mailto:lucarx76@gmail.com">lucarx76@gmail.com</a>> wrote:<br>
> If I had interrupts, I could stop anything I'm doing every time I get a new<br>
> character and put it into a buffer and then go back to what I'm doing. So I<br>
> shouldn't miss any character.<br>
> If I use polling, even if the loop is tight, if I get more characters while<br>
> I'm in the loop, I might miss something (when I poll the serial might be too<br>
> late).<br>
> But I might be wrong so having the interrupts would not change the<br>
> situation.<br>
<br>
</div>When I say a tight receive loop, I mean a loop that reads characters<br>
from serial into memory. The loop terminates once all data has been<br>
received. Execution of gPXE is blocked while this loop runs and<br>
step() is not being called.<br>
<br>
Have you implemented the serial code using a process - a step()<br>
function that polls the serial port? In this case I can imagine it<br>
dropping characters.<br>
<br></blockquote><div>I could use loop if all messages have same size. But even if I'm in that case, if I just use a loop and for any reason I miss a character (not because of gPXE) then I would never exit the loop.<br>
For instance if I'm in a loop waiting for 40 characters but I miss 1, then gPXE will wait forever for the last one (without exiting the loop because I cannot implement a timeout mechanism).<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888">
Stefan<br>
</font></blockquote></div><br>