<div dir="ltr">HI Alex,<div><br></div><div>That means its sending an escape sequences but the <esc>] bit is being lost.<div><br></div><div>I believe this is due to only having a single character available to read from the serial UART (the last one received) after the system generates an interrupt to bring it out of it out of the cpu_nap sleep routine</div>


<div><br></div><div>That thing I tried was</div><div><br></div><div>ipxe/src/core/serial.c<br></div><div><br></div><div><div>        /* enable and reset fifos, set threshold to max for escape sequences */</div><div>        uart_writeb(0xc3, UART_BASE + UART_FCR)</div>


</div><div><br></div><div><br class="">This seems to work for me, holding down the arrow key can occasionally result in an esc being read on its own which causes a menu exit.<br></div><div><br></div><div>Enabling read interrupts has no effect but it doesn't break ipxe either.</div>

<div><br></div><div>If I get past that then holding down an arrow key in grub causes and exit from the menu I was editing (this is a grub problem not ipxe but is suggests that even this code isn't perfect - maybe rts/cts needs to beenabled but then that prevents boot if there's no serial connected)</div>

<div><br class="">Commenting out the cpu_nap i core/getkey.c should also work but that will cause the cpu to constantly poll for characters and use more power.<br></div><div><br></div><div><div>Michael Brown <a href="mailto:mcb30@ipxe.org">mcb30@ipxe.org</a>, had a concern over resetting the receive and transmit fifos by using 0x03 instead of 0x01 but the code immediately following it drains and pending characters anyway. 0xC0 octet sets the thresholds as high as possible but this is probably more about delaying interrupts than making the fifo buffer any quicker and as interrupts are disabled this probably has no effect.</div>

</div><div><br></div><div>values to tried all seem to work</div><div>0x01 enable fifos only (this is probably enough)</div><div>0x03 reset and enable fifos</div><div>0xc3 set fifo thresholds reset fifos and enable fifos.</div>

<div><br></div><div><br></div><div>My system is using a motherboard serial device accessed from a direct serial cable, you are using an Dell iDRAC via java or activex which has more things to go wrong I guess.</div><div>
<br>
</div><div>Jarrod Johnson <a href="mailto:jarrod.b.johnson@gmail.com">jarrod.b.johnson@gmail.com</a>, pointed out that some vt100 mode keys send <esc> O A instead of <esc> ] A this that is what is happening the ipxe will not recognise it but I thing you would get at least OA printed if the input routine sees all three chars of the escape sequence. I think the first problem is that its not seeing all the characters.<br>

</div><div><br></div><div>Michaels patch didn't work for me and I didnt try adjusting </div><div><span style="font-family:arial,sans-serif;font-size:13px">#define GETKEY_TIMEOUT ( TICKS_PER_SEC / 4 )</span><br></div>
<div>
<font face="arial, sans-serif">The suggestion was to change this to 2 which would make it 1/2 sec until read timout instead of 1/4 sec I don't think that will work as the problem is that 3 chars are received while waiting for an interrupt and only the last character received is seen as there is no buffer in the hardware, interrupts are not enabled and there is no isr even if they were (but it would trigger and immediate exit from cpu_sleep when a character is received but that still does not seem to be enough .</font></div>

<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Porting the interrupt driven serial code from linux is a lot of work and not worth the effort for input, as Michael pointed out keyboard input is not performance sensitive,  but perhaps output would be significantly faster -- still not many ppl spend all day in ipxe menus.</font></div>

<div><br></div><br class="">Thanks<div><br></div><div>Peter</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 April 2014 05:10, Alex Davies <span dir="ltr"><<a href="mailto:alex@davz.net" target="_blank">alex@davz.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class=""><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">

<span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">A, B, C and D. Here I pressed the key after each word (e.g. “u”, “p”, <up arrow”):</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">



<span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">iPXE> up A down B right C left D</span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">



<span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">up: command not found</span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">



<span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><br></span></p></div><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">The graphical console looked like the screenshot below when I entered the keys via SOL:</span></p>



<div><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><br></span></div><div><br></div><div><br></div><div><img src="cid:image001.png@01CF599A.711745E0"><br></div></div><div class="HOEnZb">

<div class="h5"><div class="gmail_extra">

<br><br><div class="gmail_quote">On Wed, Apr 9, 2014 at 11:48 AM, Peter Pickford <span dir="ltr"><<a href="mailto:peter@netremedies.ca" target="_blank">peter@netremedies.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div dir="ltr">If you exit the menu and got to the ipxe command line what do you get when you press the arrow keys?</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 9 April 2014 03:41, Alex Davies <span dir="ltr"><<a href="mailto:alex@davz.net" target="_blank">alex@davz.net</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>We had the same problem using SOL on Dell hardware.<div><br></div><div>I tried both your patch Michael and the divide by two suggested at the top of this thread, without joy.</div>







<div><br></div><div>Interestingly, pressing the arrow key does stop the countdown timer, but the menu selector does not move, so iPXE is getting something. What debug flag should I enable to see what it is getting?</div>






<div>
<br></div><div>The menu is working nicely with color and if I connect to the 'full console' via the DRAC, and move the arrow key, the SOL menu refreshes correctly.</div><div><br></div><div>Thanks!</div><div><br></div>







<div>-Alex</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Thu, Mar 27, 2014 at 2:46 PM, Michael Brown <span dir="ltr"><<a href="mailto:mcb30@ipxe.org" target="_blank">mcb30@ipxe.org</a>></span> wrote:<br>







</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div>On 27/03/14 08:36, Peter Pickford wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
The arrow keys would not work in my ipxe serial console.<br>
<br>
The following seems to fix it but causes a busy wait while reading<br>
escape sequences.<br>
<br></div>
<snip><br>
</blockquote>
<br>
Arrow keys over serial works for me.  Could you try the attached (untested) patch, which preserves the cpu_nap() while changing the ordering of events such that a keypress arriving during the cpu_nap() will be detected even if the timeout has expired?<br>








<br>
Thanks,<br>
<br>
Michael<br>
<br></div></div><div>_______________________________________________<br>
ipxe-devel mailing list<br>
<a href="mailto:ipxe-devel@lists.ipxe.org" target="_blank">ipxe-devel@lists.ipxe.org</a><br>
<a href="https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel" target="_blank">https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel</a><br>
<br></div></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Alex Davies<br><br><span style="font-size:x-small">This email and any files transmitted with it are confidential and<br>

intended solely for the use of the individual or entity to whom they<br>

are addressed. If you have received this email in error please notify<br>the sender immediately by e-mail and delete this e-mail permanently.</span>
</font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Alex Davies<br><br><span style="font-size:x-small">This email and any files transmitted with it are confidential and<br>intended solely for the use of the individual or entity to whom they<br>



are addressed. If you have received this email in error please notify<br>the sender immediately by e-mail and delete this e-mail permanently.</span>
</div>
</div></div></blockquote></div><br></div>