* [U-Boot] ctrl-c detection (on 4xx platforms)
@ 2008-09-11 15:23 Matthias Fuchs
2008-09-11 20:55 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: Matthias Fuchs @ 2008-09-11 15:23 UTC (permalink / raw)
To: u-boot
Hi,
I noticed some strange CTRL-C behavior in a BSP command.
When I run my bsp command interactively everything is fine.
The command waits for a condition and displays a rotating cursor
(see board/esd/common/cmd_loadpci.c):
...
int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
...
char str[] = "\\|/-";
...
while(1) {
...
*ptr = 0xffffffff;
puts("\nWaiting for action from pci host -");
/*
* Wait for host to write the start address
*/
while (*ptr == 0xffffffff) {
count++;
if (!(count % 100)) {
count2++;
putc(0x08); /* backspace */
putc(str[count2 % 4]);
}
/* Abort if ctrl-c was pressed */
if (ctrlc()) {
puts("\nAbort\n");
return 0;
}
udelay(1000);
}
}
...
}
But when I call this bsp command as bootcmd CTRL-C does not stop the while loop. So CTRL-C
is not detected. Any idea?
Matthias
^ permalink raw reply [flat|nested] 6+ messages in thread* [U-Boot] ctrl-c detection (on 4xx platforms)
2008-09-11 15:23 [U-Boot] ctrl-c detection (on 4xx platforms) Matthias Fuchs
@ 2008-09-11 20:55 ` Wolfgang Denk
2008-09-12 7:00 ` Matthias Fuchs
0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2008-09-11 20:55 UTC (permalink / raw)
To: u-boot
Dear Matthias Fuchs,
In message <200809111723.54133.matthias.fuchs@esd-electronics.com> you wrote:
>
> I noticed some strange CTRL-C behavior in a BSP command.
> When I run my bsp command interactively everything is fine.
...
> But when I call this bsp command as bootcmd CTRL-C does not stop the while loop. So CTRL-C
> is not detected. Any idea?
Do you happen to have CONFIG_AUTOBOOT_KEYED set in your board
configuration?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Program maintenance is an entropy-increasing process, and even its
most skilfull execution only delays the subsidence of the system into
unfixable obsolescence. - Fred Brooks, "The Mythical Man Month"
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] ctrl-c detection (on 4xx platforms)
2008-09-11 20:55 ` Wolfgang Denk
@ 2008-09-12 7:00 ` Matthias Fuchs
2008-09-12 7:55 ` Matthias Fuchs
0 siblings, 1 reply; 6+ messages in thread
From: Matthias Fuchs @ 2008-09-12 7:00 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
yes I do have CONFIG_AUTOBOOT_KEYED enabled. It's the PMC440 board:
include/configs/PMC440.h:
...
#define CONFIG_AUTOBOOT_KEYED 1
#define CONFIG_AUTOBOOT_PROMPT \
"Press SPACE to abort autoboot in %d seconds\n", bootdelay
#undef CONFIG_AUTOBOOT_DELAY_STR
#define CONFIG_AUTOBOOT_STOP_STR " "
...
Matthias
On Thursday 11 September 2008 22:55, Wolfgang Denk wrote:
> Dear Matthias Fuchs,
>
> In message <200809111723.54133.matthias.fuchs@esd-electronics.com> you wrote:
> >
> > I noticed some strange CTRL-C behavior in a BSP command.
> > When I run my bsp command interactively everything is fine.
> ...
> > But when I call this bsp command as bootcmd CTRL-C does not stop the while loop. So CTRL-C
> > is not detected. Any idea?
>
> Do you happen to have CONFIG_AUTOBOOT_KEYED set in your board
> configuration?
>
> Best regards,
>
> Wolfgang Denk
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] ctrl-c detection (on 4xx platforms)
2008-09-12 7:00 ` Matthias Fuchs
@ 2008-09-12 7:55 ` Matthias Fuchs
2008-09-12 9:08 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: Matthias Fuchs @ 2008-09-12 7:55 UTC (permalink / raw)
To: u-boot
Hi,
when I disable CONFIG_AUTOBOOT_KEYED ctrl-c checking is not disabled.
We are using CONFIG_AUTOBOOT_KEYED to have a special key (SPACE) to
abort autoboot and not the 'any' key.
Is there any special reason why ctrl-c checking is disabled for CONFIG_AUTOBOOT_KEYED?
Matthias
On Friday 12 September 2008 09:00, Matthias Fuchs wrote:
> Hi Wolfgang,
>
> yes I do have CONFIG_AUTOBOOT_KEYED enabled. It's the PMC440 board:
>
> include/configs/PMC440.h:
> ...
> #define CONFIG_AUTOBOOT_KEYED 1
> #define CONFIG_AUTOBOOT_PROMPT \
> "Press SPACE to abort autoboot in %d seconds\n", bootdelay
> #undef CONFIG_AUTOBOOT_DELAY_STR
> #define CONFIG_AUTOBOOT_STOP_STR " "
> ...
>
> Matthias
>
>
> On Thursday 11 September 2008 22:55, Wolfgang Denk wrote:
> > Dear Matthias Fuchs,
> >
> > In message <200809111723.54133.matthias.fuchs@esd-electronics.com> you wrote:
> > >
> > > I noticed some strange CTRL-C behavior in a BSP command.
> > > When I run my bsp command interactively everything is fine.
> > ...
> > > But when I call this bsp command as bootcmd CTRL-C does not stop the while loop. So CTRL-C
> > > is not detected. Any idea?
> >
> > Do you happen to have CONFIG_AUTOBOOT_KEYED set in your board
> > configuration?
> >
> > Best regards,
> >
> > Wolfgang Denk
> >
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>
--
-------------------------------------------------------------------------
Dipl.-Ing. Matthias Fuchs
Head of System Design
esd electronic system design gmbh
Vahrenwalder Str. 207 - 30165 Hannover - GERMANY
Phone: +49-511-37298-0 - Fax: +49-511-37298-68
Please visit our homepage http://www.esd.eu
Quality Products - Made in Germany
-------------------------------------------------------------------------
Gesch?ftsf?hrer: Klaus Detering, Dr. Werner Schulze
Amtsgericht Hannover HRB 51373 - VAT-ID DE 115672832
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] ctrl-c detection (on 4xx platforms)
2008-09-12 7:55 ` Matthias Fuchs
@ 2008-09-12 9:08 ` Wolfgang Denk
2008-09-13 16:51 ` Matthias Fuchs
0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2008-09-12 9:08 UTC (permalink / raw)
To: u-boot
Dear Matthias Fuchs,
In message <200809120955.10866.matthias.fuchs@esd-electronics.com> you wrote:
>
> when I disable CONFIG_AUTOBOOT_KEYED ctrl-c checking is not disabled.
I think there is one "dis" ot "not" too many.
> We are using CONFIG_AUTOBOOT_KEYED to have a special key (SPACE) to
> abort autoboot and not the 'any' key.
I thought so.
> Is there any special reason why ctrl-c checking is disabled for CONFIG_AUTOBOOT_KEYED?
Excellent question. Next question, please.
I think the rationale behind this is to prevent users from getting an
interactive prompt by just pressing ^C - the intention of
CONFIG_AUTOBOOT_KEYED is similar to a login with password - without
the correct password you are denied access to an interactive inter-
face.
But if you could use ^C as soon as the bootcmd has started - what
should happen next? We cannot simply drop you into the interactive
shell?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When the ax entered the forest, the trees said, "The handle is one of
us!" -- Turkish proverb
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] ctrl-c detection (on 4xx platforms)
2008-09-12 9:08 ` Wolfgang Denk
@ 2008-09-13 16:51 ` Matthias Fuchs
0 siblings, 0 replies; 6+ messages in thread
From: Matthias Fuchs @ 2008-09-13 16:51 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
On Friday 12 September 2008 11:08:51 Wolfgang Denk wrote:
> Dear Matthias Fuchs,
>
> In message <200809120955.10866.matthias.fuchs@esd-electronics.com> you
wrote:
> > when I disable CONFIG_AUTOBOOT_KEYED ctrl-c checking is not disabled.
>
> I think there is one "dis" ot "not" too many.
:-)
>
> > We are using CONFIG_AUTOBOOT_KEYED to have a special key (SPACE) to
> > abort autoboot and not the 'any' key.
>
> I thought so.
>
> > Is there any special reason why ctrl-c checking is disabled for
> > CONFIG_AUTOBOOT_KEYED?
>
> Excellent question. Next question, please.
>
>
> I think the rationale behind this is to prevent users from getting an
> interactive prompt by just pressing ^C - the intention of
> CONFIG_AUTOBOOT_KEYED is similar to a login with password - without
> the correct password you are denied access to an interactive inter-
> face.
I see. This makes sense.
>
> But if you could use ^C as soon as the bootcmd has started - what
> should happen next? We cannot simply drop you into the interactive
> shell?
Ok, this will cancel the whole mechanism.
I only want to allow the space key to abort autoboot. With serial console
cables connected (with no PC on the other side) you sometimes receive some
noise characters because of crosstalk. These chars will stop autoboot -> not
good! We did never see this when restricting the stopkey to the space key.
Because I only need to abort my special bootcmd during testing I reenabled
ctrl-c checking in my loadpci command.
Thanks for pointing out the ..KEYED philosophy.
Matthias
>
> Best regards,
>
> Wolfgang Denk
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-09-13 16:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-11 15:23 [U-Boot] ctrl-c detection (on 4xx platforms) Matthias Fuchs
2008-09-11 20:55 ` Wolfgang Denk
2008-09-12 7:00 ` Matthias Fuchs
2008-09-12 7:55 ` Matthias Fuchs
2008-09-12 9:08 ` Wolfgang Denk
2008-09-13 16:51 ` Matthias Fuchs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox