From: "Pádraig Brady" <P@draigBrady.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: making grub completely silent
Date: Fri, 09 Jun 2006 10:00:13 +0100 [thread overview]
Message-ID: <4489389D.7010903@draigBrady.com> (raw)
In-Reply-To: <4488C6CB.4080303@emmenlauer.de>
[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]
Mario Emmenlauer wrote:
>
> Hello,
>
> this is a continued thread from bug-grub@gnu.org. I have taken
> it here (thanks Jerome) where it seems to suit better.
>
> A short abstract:
> I'd like to have an option to make grub be less verbose.
> I was thinking about an numeric verbosity level that would
> control how 'severe' a message needs to be to be shown.
>
> I spent an hour thinking how to convince you that this will
> prove useful, and wrote a long and boring passage :-)
>
> The short essence is: why not? I'm creating an embedded device,
> and the message just bugs me. Other users might agree. Maybe
> not. But I would implement it myself, and unless you mind the
> ten to fifteen lines of extra code I hope you will think about
> taking it into grub? It would supersede the 'silent'-function,
> so it might even make some code redundant.
>
> I'm hoping for a discussion and for some guidance on how you
> would want it implemented.
For reference I did the attached diff
against grub1 to shut it up.
Pádraig.
[-- Attachment #2: grub-0.93-silent.diff --]
[-- Type: text/x-patch, Size: 3679 bytes --]
diff -Naur -Naru grub-0.93/stage1/stage1.S grub-0.93-pb/stage1/stage1.S
--- grub-0.93/stage1/stage1.S 2002-09-08 01:58:08.000000000 +0000
+++ grub-0.93-pb/stage1/stage1.S 2005-08-15 07:14:25.000000000 +0000
@@ -30,7 +30,8 @@
#define ABS(x) (x-_start+0x7c00)
/* Print message string */
-#define MSG(x) movw $ABS(x), %si; call message
+#define MSG(x)
+#define MSGERR(x) movw $ABS(x), %si; call message
/* XXX: binutils-2.9.1.0.x doesn't produce a short opcode for this. */
#define MOV_MEM_TO_AL(x) .byte 0xa0; .word x
@@ -364,24 +365,24 @@
* BIOS Geometry translation error (past the end of the disk geometry!).
*/
geometry_error:
- MSG(geometry_error_string)
+ MSGERR(geometry_error_string)
jmp general_error
/*
* Disk probe failure.
*/
hd_probe_error:
- MSG(hd_probe_error_string)
+ MSGERR(hd_probe_error_string)
jmp general_error
/*
* Read error on the disk.
*/
read_error:
- MSG(read_error_string)
+ MSGERR(read_error_string)
general_error:
- MSG(general_error_string)
+ MSGERR(general_error_string)
/* go here when you need to stop the machine hard after an error condition */
stop: jmp stop
@@ -457,7 +458,7 @@
/*
* Floppy disk probe failure.
*/
- MSG(fd_probe_error_string)
+ MSGERR(fd_probe_error_string)
jmp general_error
fd_probe_error_string: .string "Floppy"
diff -Naur -Naru grub-0.93/stage2/char_io.c grub-0.93-pb/stage2/char_io.c
--- grub-0.93/stage2/char_io.c 2002-12-02 23:49:07.000000000 +0000
+++ grub-0.93-pb/stage2/char_io.c 2005-08-15 07:18:22.000000000 +0000
@@ -94,9 +94,9 @@
if (errnum > ERR_NONE && errnum < MAX_ERR_NUM)
#ifndef STAGE1_5
/* printf("\7\n %s\n", err_list[errnum]); */
- printf ("\nError %u: %s\n", errnum, err_list[errnum]);
+ grub_printf_error ("\nError %u: %s\n", errnum, err_list[errnum]);
#else /* STAGE1_5 */
- printf ("Error %u\n", errnum);
+ grub_printf_error ("Error %u\n", errnum);
#endif /* STAGE1_5 */
}
@@ -150,7 +150,7 @@
}
void
-grub_printf (const char *format,...)
+grub_printf_error (const char *format,...)
{
int *dataptr = (int *) &format;
char c, str[16];
diff -Naur -Naru grub-0.93/stage2/shared.h grub-0.93-pb/stage2/shared.h
--- grub-0.93/stage2/shared.h 2002-12-02 23:15:12.000000000 +0000
+++ grub-0.93-pb/stage2/shared.h 2005-08-15 07:14:25.000000000 +0000
@@ -362,6 +364,9 @@
#define strcpy grub_strcpy
#endif /* WITHOUT_LIBC_STUBS */
+#undef printf
+#define printf(x, ...)
+#define grub_printf(x, ...)
#ifndef ASM_FILE
/*
@@ -849,7 +854,7 @@
#endif
/* C library replacement functions with identical semantics. */
-void grub_printf (const char *format,...);
+void grub_printf_error (const char *format,...);
int grub_sprintf (char *buffer, const char *format, ...);
int grub_tolower (int c);
int grub_isspace (int c);
diff -Naur -Naru grub-0.93/stage2/start.S grub-0.93-pb/stage2/start.S
--- grub-0.93/stage2/start.S 2001-12-30 08:23:16.000000000 +0000
+++ grub-0.93-pb/stage2/start.S 2005-08-15 07:14:25.000000000 +0000
@@ -38,7 +38,8 @@
#endif /* STAGE1_5 */
/* Print message string */
-#define MSG(x) movw $ABS(x), %si; call message
+#define MSG(x)
+#define MSGERR(x) movw $ABS(x), %si; call message
.file "start.S"
@@ -323,17 +440,17 @@
* BIOS Geometry translation error (past the end of the disk geometry!).
*/
geometry_error:
- MSG(geometry_error_string)
+ MSGERR(geometry_error_string)
jmp general_error
/*
* Read error on the disk.
*/
read_error:
- MSG(read_error_string)
+ MSGERR(read_error_string)
general_error:
- MSG(general_error_string)
+ MSGERR(general_error_string)
/* go here when you need to stop the machine hard after an error condition */
stop: jmp stop
prev parent reply other threads:[~2006-06-09 9:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4486048D.30405@emmenlauer.de>
[not found] ` <87k67txs3j.wl%jeroen@vrijschrift.org>
[not found] ` <4486FA90.6020604@emmenlauer.de>
[not found] ` <873bef8g0g.wl%jeroen@vrijschrift.org>
2006-06-09 0:54 ` making grub completely silent Mario Emmenlauer
2006-06-09 9:00 ` Pádraig Brady [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4489389D.7010903@draigBrady.com \
--to=p@draigbrady.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.