mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* can't interrupt when printing T T T T T
@ 2019-08-29 16:53 duhuanpeng
  2019-08-30  8:54 ` Ahmad Fatoum
  0 siblings, 1 reply; 2+ messages in thread
From: duhuanpeng @ 2019-08-29 16:53 UTC (permalink / raw)
  To: barebox

Hello, I boot my barebox by barebox from tftpserver. I poweroff my
switcher. and barebox began to print
- - - -
Booting entry 'net'
T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T IP 192.168.1.88 is not reachable
- - - -
I try to hit ctrl-c and some other keys. but I can't stop it printing 'T'.
so I added some piece of code to test it

fs/tftp.c
   static int tftp_poll(struct file_priv *priv)
 {
+
+       if(tstc()) {
+               printf("%s", __func__);
+               putchar(getchar());
+       }
+
        if (ctrlc()) {

net/net.c
 
 void net_poll(void)
 {
+       if(tstc()) {
+               printf("%s", __func__);
+               putchar(getchar());
+       }
+


net/eth.c

static int __eth_rx(struct eth_device *edev)
{
	int ret;

+       if(tstc()) {
+               putchar(getchar());
+               printf("|-_-|");
+       }
+
- - - - - - - -
the result:

Booting entry 'net'
T net_pollknet_polljnet_pollknet_polljk|-_-|net_polljT n|-_-|net_pollkj|-_-|net_pollsnet_pollknet_pollfnet_pollanet_polljT |-_-|net_poll|-_-||-_-|net_pollnet_
pollT T T T T net_pollfnet_pollfT net_pollff|-_-|f|-_-|net_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfT f|-_-|net_polldnet_pollfnet_pollsnet_p
olldnet_pollkf|-_-|net_polljnet_pollknet_pollsnet_polljd|-_-|net_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljT net_polljnet_polljnet_polljnet_p
olljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljj|-_-|net_polljT T T T T T T T net_pollfnet_po
llfnet_pollfT net_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollff|-_-|T net_pollfnet_polldnet_polldd|-_-|d|-_
-|T T T T T T T T T T T T T T T T T T T IP 192.168.1.88 is not reachable

I found it the routine (tftp_poll) didn't catch the key input.
mostly the input is catched by net_poll().
could anyone help to move the ctrlc() dection into the right place?

duhuanpeng.








_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: can't interrupt when printing T T T T T
  2019-08-29 16:53 can't interrupt when printing T T T T T duhuanpeng
@ 2019-08-30  8:54 ` Ahmad Fatoum
  0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Fatoum @ 2019-08-30  8:54 UTC (permalink / raw)
  To: barebox

Hello Duhuan (?),

On 8/29/19 6:53 PM, duhuanpeng wrote:
> Hello, I boot my barebox by barebox from tftpserver. I poweroff my
> switcher. and barebox began to print
> - - - -
> Booting entry 'net'
> T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T IP 192.168.1.88 is not reachable
> - - - -
> I try to hit ctrl-c and some other keys. but I can't stop it printing 'T'.
> so I added some piece of code to test it
> 
> fs/tftp.c
>    static int tftp_poll(struct file_priv *priv)
>  {
> +
> +       if(tstc()) {
> +               printf("%s", __func__);
> +               putchar(getchar());
> +       }
> +
>         if (ctrlc()) {
> 
> net/net.c
>  
>  void net_poll(void)
>  {
> +       if(tstc()) {
> +               printf("%s", __func__);
> +               putchar(getchar());
> +       }
> +
> 
> 
> net/eth.c
> 
> static int __eth_rx(struct eth_device *edev)
> {
> 	int ret;
> 
> +       if(tstc()) {
> +               putchar(getchar());
> +               printf("|-_-|");
> +       }
> +
> - - - - - - - -
> the result:
> 
> Booting entry 'net'
> T net_pollknet_polljnet_pollknet_polljk|-_-|net_polljT n|-_-|net_pollkj|-_-|net_pollsnet_pollknet_pollfnet_pollanet_polljT |-_-|net_poll|-_-||-_-|net_pollnet_
> pollT T T T T net_pollfnet_pollfT net_pollff|-_-|f|-_-|net_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfT f|-_-|net_polldnet_pollfnet_pollsnet_p
> olldnet_pollkf|-_-|net_polljnet_pollknet_pollsnet_polljd|-_-|net_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljT net_polljnet_polljnet_polljnet_p
> olljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljnet_polljj|-_-|net_polljT T T T T T T T net_pollfnet_po
> llfnet_pollfT net_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollfnet_pollff|-_-|T net_pollfnet_polldnet_polldd|-_-|d|-_
> -|T T T T T T T T T T T T T T T T T T T IP 192.168.1.88 is not reachable
> 
> I found it the routine (tftp_poll) didn't catch the key input.
> mostly the input is catched by net_poll().
> could anyone help to move the ctrlc() dection into the right place?

"startup: allow ctrl+c abort during boot sequence" on the barebox next branch
should fix this for you.

Cheers
Ahmad

> 
> duhuanpeng.
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-30  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 16:53 can't interrupt when printing T T T T T duhuanpeng
2019-08-30  8:54 ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox