From owner-freebsd-hackers@FreeBSD.ORG Mon May 1 05:30:30 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D4E2316A580 for ; Mon, 1 May 2006 05:28:23 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18E5D43D46 for ; Mon, 1 May 2006 05:28:22 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.pc (aris.bedc.ondsl.gr [62.103.39.226]) (authenticated bits=128) by igloo.linux.gr (8.13.6/8.13.6/Debian-1) with ESMTP id k415RpHG017835 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 1 May 2006 08:27:53 +0300 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.6/8.13.6) with ESMTP id k415RtFw089082; Mon, 1 May 2006 08:27:55 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.pc (8.13.6/8.13.6/Submit) id k415Rto1089081; Mon, 1 May 2006 08:27:55 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Mon, 1 May 2006 08:27:55 +0300 From: Giorgos Keramidas To: Eric Anderson Message-ID: <20060501052755.GA88897@gothmog.pc> References: <445581DE.50901@centtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <445581DE.50901@centtech.com> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.832, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.57, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: freebsd-hackers@freebsd.org Subject: Re: Boot manager beep (revisited) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2006 05:30:30 -0000 On 2006-04-30 22:34, Eric Anderson wrote: > This thread: > http://lists.freebsd.org/pipermail/freebsd-stable/2005-December/020572.html > > mentions a patch to disable the boot manager beep, and also > discusses having it optional. I don't have enough asm-fu to make > that option happen, but I can tell you, that on laptops, that beep > is really annoying, and amazingly loud. Is this just waiting for an > able minded person to code up the options and submit? I don't like the beep either, so I usually patch my systems manually to include something very similar: # Index: boot0.S # =================================================================== # --- boot0.S (.../branches/ncvs/src/sys/boot/i386/boot0) (revision 45) # +++ boot0.S (.../trunk/src/sys/boot/i386/boot0) (revision 45) # @@ -201,9 +201,7 @@ # /* # * Start of input loop. Beep and take note of time # */ # -main.10: movb $ASCII_BEL,%al # Signal # - callw putchr # beep! # - xorb %ah,%ah # BIOS: Get # +main.10: xorb %ah,%ah # BIOS: Get # int $0x1a # system time # movw %dx,%di # Ticks when # addw _TICKS(%bp),%di # timeout Since this is asm, and it runs very very early in the boot process, we don't have the luxury of making this tunable in `/boot/loader.conf', but there's nothing wrong with making it tunable through an option in our modern `/etc/src.conf' option system. We could use something like the following: WITHOUT_BOOTEASY_BEEP= yes and then we can add the necessary Makefile-foo in `/usr/src/sys/boot' to turn this to a preprocessor #define. Does something like the following sound reasonable (I haven't had a chance to run this through a build-test, so use with care). The default behavior should be to *include* a beep, but it can be turned off by setting WITHOUT_BOOTEASY_BEEP in `/etc/src.conf'. # Index: boot0.S # =================================================================== # --- boot0.S (.../branches/ncvs/src/sys/boot/i386/boot0) (revision 47) # +++ boot0.S (.../trunk/src/sys/boot/i386/boot0) (revision 47) # @@ -201,8 +201,11 @@ # /* # * Start of input loop. Beep and take note of time # */ # -main.10: movb $ASCII_BEL,%al # Signal # +main.10: # +#ifdef BOOTEASY_BEEP # + movb $ASCII_BEL,%al # Signal # callw putchr # beep! # +#endif # xorb %ah,%ah # BIOS: Get # int $0x1a # system time # movw %dx,%di # Ticks when # Index: Makefile # =================================================================== # --- Makefile (.../branches/ncvs/src/sys/boot/i386/boot0) (revision 47) # +++ Makefile (.../trunk/src/sys/boot/i386/boot0) (revision 47) # @@ -54,6 +54,10 @@ # -DTICKS=${BOOT_BOOT0_TICKS} \ # -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} # # +.if !defined(WITHOUT_BOOTEASY_BEEP) || (${WITHOUT_BOOTEASY_BEEP} != "no" && ${WITHOUT_BOOTEASY_BEEP} != "NO") # +CFLAGS+=-DBOOTEASY_BEEP # +.endif # + # LDFLAGS=-N -e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-S,--oformat,binary # # .include