On Tue, Feb 9, 2010 at 8:17 AM, Stefan Hajnoczi <span dir="ltr">&lt;<a href="mailto:stefanha@gmail.com">stefanha@gmail.com</a>&gt;</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 &lt;<a href="mailto:lucarx76@gmail.com">lucarx76@gmail.com</a>&gt; wrote:<br>
&gt; If I had interrupts, I could stop anything I&#39;m doing every time I get a new<br>
&gt; character and put it into a buffer and then go back to what I&#39;m doing. So I<br>
&gt; shouldn&#39;t miss any character.<br>
&gt; If I use polling, even if the loop is tight, if I get more characters while<br>
&gt; I&#39;m in the loop, I might miss something (when I poll the serial might be too<br>
&gt; late).<br>
&gt; But I might be wrong so having the interrupts would not change the<br>
&gt; 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&#39;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&#39;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>