* Re: making grub completely silent
[not found] ` <873bef8g0g.wl%jeroen@vrijschrift.org>
@ 2006-06-09 0:54 ` Mario Emmenlauer
2006-06-09 9:00 ` Pádraig Brady
0 siblings, 1 reply; 2+ messages in thread
From: Mario Emmenlauer @ 2006-06-09 0:54 UTC (permalink / raw)
To: grub-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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.
Cheers,
Mario Emmenlauer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEiMbLzxGsM4+WvrURAiLtAJwLAhCdCT8NMX2eGoQSgOToBGIKSwCfXLsj
9Euwpt9o6u5o6Ddh7DVtwz0=
=Ia7B
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: making grub completely silent
2006-06-09 0:54 ` making grub completely silent Mario Emmenlauer
@ 2006-06-09 9:00 ` Pádraig Brady
0 siblings, 0 replies; 2+ messages in thread
From: Pádraig Brady @ 2006-06-09 9:00 UTC (permalink / raw)
To: The development of GRUB 2
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-09 9:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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 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.