Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Oct 2013 03:46:11 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Frank Leonhardt <frank2@fjl.co.uk>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: How do I ring a bell?
Message-ID:  <20131008034611.6ff7d5c5.freebsd@edvax.de>
In-Reply-To: <52531508.7090206@fjl.co.uk>
References:  <52529CFF.9030105@fjl.co.uk> <20131007143637.653304bd.freebsd@edvax.de> <52531508.7090206@fjl.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 07 Oct 2013 21:09:44 +0100, Frank Leonhardt wrote:
> On 07/10/2013 13:36, Polytropon wrote:
> > > Is there any way to make a noise through the built in "bell" speaker
> > > found on an IBM PC compatible server box? Writing 007 to the BIOS cout
> > > routine might do it, but I've realised I haven't got a clue how to 
> > do that.
>  > Making it audible is part of the local terminal emulator,
>  > either the TTY (text mode) driver or via xterm (or the
>  > preferred alternative terminal emulator in X).
> 
> Yers, but I'm not running X. Or a character terminal come to that :-)

In that case, something line

	printf "\a" > /dev/console

should work - I've just tried it. You can do that from a
shell script or maybe even via fprintf() from your own code.



>  > See the following shell script as an example of what you
>  > can do: <snip>
> 
> Overkill. I have proper work to do rather than working out how to play 
> appropriate bit silly little tunes for every eventuality. Actually 
> spkr.c has some useful comments in it - apparently it works the same as 
> IBM PC BASIC. Now how do I make it polyphonic...

By adding more computers. This is the established solution
to _every_ IT-related problem. :-)

The code in /usr/src/sys/dev/speaker/spkr.c provides a more
streamlined interface to sound generation. It's even more
"bare metal" than what I remember from Borland Turbo-C:

	sound(1000);
	delay(2500);
	nosound();

It was important not to miss the 3rd line or the "fun" would
never end. :-)



>  > Always make sure that the system actually _has_ got an
>  > internal speaker! I assume that modern PC hardware could
>  > have it removed along with floppy drive connector, parallel
>  > port or power switch.
> 
> Remains to be seen, but most still seem to have one so the BIOS ROM can 
> make "beep" diagnostic codes if it can't do anything else.

This proves that it is present, even if it's not an attached
speaker anymore. Many mainboards contain a little piezo speaker
directly mounted (my ultracheap home PC does, for example).



>  >> P.S. "cdcontrol -f /dev/mycdrom eject" is the best I've come up with so
>  >> far for getting attention.
>  > That's a really clever idea, never heared of that. It has
>  > the advantage of being permanent because the drive will
>  > stay open when the sound of its motor has finished. :-)
> 
> I use it all the time, especially when directing a tech to the 
> appropriate server in a rack. "It's the one I just popped the CD drive 
> on". These days servers have the spring-loaded notebook drives instead 
> of the motorised trays, which is a pity. You could keep winding the 
> motorised ones in and out until someone spotted it.

This seems to be better than those "slot-in" drives I had
in one server: no moving parts to the outside.



> I suppose if you did 
> it energetically enough it might catch fire and set off the smoke alarm 
> (audible).

This procedure has been part of an independent quality test
of CD recorders, performed by a PC maganzine many years ago.
Interesting result: the cheapest drive would last longer than
the most expensive one in which the gears automatically had
disassembled. :-)



> Or leave it wound out with a tin can balanced on it; to make 
> a noise wind it back in and hear it clatter to the floor.

Interesting use for the "4X cup holder". :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131008034611.6ff7d5c5.freebsd>