Boot manager beep (revisited)
Giorgos Keramidas
keramida at freebsd.org
Mon May 1 05:30:30 UTC 2006
On 2006-04-30 22:34, Eric Anderson <anderson at centtech.com> 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 <bsd.prog.mk>
More information about the freebsd-hackers
mailing list