From 30817e1ce84f545cdb759fa5ed1b0f74eee78c3a Mon Sep 17 00:00:00 2001 From: okuji Date: Mon, 4 Feb 2002 23:01:38 +0000 Subject: [PATCH] 2002-02-05 Yoshinori K. Okuji * netboot/misc.c (twiddle): Go back to the bar progress, copied from etherboot-5.0.5/src/misc.c. Execute the code only if DEBUG is true. --- ChangeLog | 6 ++++++ NEWS | 7 +++++++ netboot/misc.c | 17 +++++++++++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0309195de..33e7f4e36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-02-05 Yoshinori K. Okuji + + * netboot/misc.c (twiddle): Go back to the bar progress, copied + from etherboot-5.0.5/src/misc.c. Execute the code only if DEBUG + is true. + 2002-02-05 Yoshinori K. Okuji * stage2/builtins.c (displaymem_func): Use hex digits to display diff --git a/NEWS b/NEWS index 54aa42f2e..4d10a3bb1 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ NEWS - list of user-visible changes between releases of GRUB +New in 0.92: +* The command "displaymem" uses only hex digits for consistency. +* The netboot code go backs to the progress bars instead of dots, for the + notation of data transfers. And, that is displayed only in debug mode, + that is to say, nothing is displayed by default. Remember that you can + turn on debug mode via the command "debug". + New in 0.91 - 2002-01-21: * Support for Linux DAC960 is added. * JFS and XFS support is added. diff --git a/netboot/misc.c b/netboot/misc.c index 10f189c25..28614fdc4 100644 --- a/netboot/misc.c +++ b/netboot/misc.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2000, 2001 Free Software Foundation, Inc. + * Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +34,20 @@ sleep (int secs) void twiddle (void) { - grub_putchar('.'); + static unsigned long lastticks = 0; + static int count = 0; + static const char tiddles[]="-\\|/"; + unsigned long ticks; + + if (debug) + { + if ((ticks = currticks ()) == lastticks) + return; + + lastticks = ticks; + grub_putchar (tiddles[(count++) & 3]); + grub_putchar ('\b'); + } } /* Because Etherboot uses its own formats for the printf family,