From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Focsd-0004N5-GM for mharc-grub-devel@gnu.org; Fri, 09 Jun 2006 05:02:11 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Focsb-0004Mq-SC for grub-devel@gnu.org; Fri, 09 Jun 2006 05:02:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FocsZ-0004M2-9u for grub-devel@gnu.org; Fri, 09 Jun 2006 05:02:08 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FocsZ-0004Lz-3a for grub-devel@gnu.org; Fri, 09 Jun 2006 05:02:07 -0400 Received: from [212.17.35.167] (helo=yzordderrex.lincor.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fod0Z-0006SU-DG for grub-devel@gnu.org; Fri, 09 Jun 2006 05:10:23 -0400 Received: from jumpgate ([84.203.137.218] helo=[192.168.2.25]) by yzordderrex.lincor.com with asmtp (Exim 3.35 #1 (Debian)) id 1FocsR-0005Qz-00 for ; Fri, 09 Jun 2006 10:01:59 +0100 Message-ID: <4489389D.7010903@draigBrady.com> Date: Fri, 09 Jun 2006 10:00:13 +0100 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: The development of GRUB 2 References: <4486048D.30405@emmenlauer.de> <87k67txs3j.wl%jeroen@vrijschrift.org> <4486FA90.6020604@emmenlauer.de> <873bef8g0g.wl%jeroen@vrijschrift.org> <4488C6CB.4080303@emmenlauer.de> In-Reply-To: <4488C6CB.4080303@emmenlauer.de> X-Enigmail-Version: 0.92.1.0 Content-Type: multipart/mixed; boundary="------------000604090508040703010103" Subject: Re: making grub completely silent X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jun 2006 09:02:10 -0000 This is a multi-part message in MIME format. --------------000604090508040703010103 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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. --------------000604090508040703010103 Content-Type: text/x-patch; name="grub-0.93-silent.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub-0.93-silent.diff" 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 --------------000604090508040703010103--