From nicolas@narr.dyn.dhs.org  Mon Feb 11 02:35:17 2002
Return-Path: <nicolas@narr.dyn.dhs.org>
Received: from mailout04.sul.t-online.com (mailout04.sul.t-online.com [194.25.134.18])
	by hub.freebsd.org (Postfix) with ESMTP id 8CE9837B402
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 11 Feb 2002 02:35:16 -0800 (PST)
Received: from fwd07.sul.t-online.de 
	by mailout04.sul.t-online.com with smtp 
	id 16aDnn-0004Rm-09; Mon, 11 Feb 2002 11:35:15 +0100
Received: from pc5.abc (520067998749-0001@[217.233.119.135]) by fmrl07.sul.t-online.com
	with esmtp id 16aDnW-1X3hEOC; Mon, 11 Feb 2002 11:34:58 +0100
Received: (from nicolas@localhost)
	by pc5.abc (8.11.6/8.11.6) id g1BAYvi07954;
	Mon, 11 Feb 2002 11:34:57 +0100 (CET)
	(envelope-from nicolas)
Message-Id: <200202111034.g1BAYvi07954@pc5.abc>
Date: Mon, 11 Feb 2002 11:34:57 +0100 (CET)
From: Nicolas Rachinsky <list@rachinsky.de>
Reply-To: Nicolas Rachinsky <list@rachinsky.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: FreeBSD should be able to beep after shutdown
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         34820
>Category:       kern
>Synopsis:       FreeBSD should be able to beep after shutdown
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 11 02:40:03 PST 2002
>Closed-Date:    Thu Oct 16 23:57:33 PDT 2003
>Last-Modified:  Thu Oct 16 23:57:33 PDT 2003
>Originator:     Nicolas Rachinsky
>Release:        FreeBSD 4.5-RELEASE i386
>Organization:
>Environment:
System: FreeBSD pc5.abc 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Sat Feb 9 15:45:34 CET 2002 nicolas@pc5.abc:/usr/obj/usr/src/sys/NR i386


	
>Description:

FreeBSD should be able to beep after shutdown, that you know when
it's safe to turn off the machine.  This is particularly usefull
for headless machines. And there are still people using older
machines which cannot turn the power off via APM/ATX.

>How-To-Repeat:


>Fix:

The following patch applies cleanly to 4.{3,4,5}-RELEASE, I think it
will work only for i386.

--- sys/i386/conf/LINT.orig	Thu Aug 30 14:29:56 2001
+++ sys/i386/conf/LINT	Sun Nov 25 00:08:38 2001
@@ -914,6 +914,10 @@
 # Size of the kernel message buffer.  Should be N * pagesize.
 options 	MSGBUF_SIZE=40960
 
+# Makes the Kernel beep after shutdown (when you are allowed
+# to turn the machine off)
+options		SHUTDOWN_BEEP
+
 
 #####################################################################
 # HARDWARE DEVICE CONFIGURATION
--- sys/i386/isa/clock.c.orig	Thu Apr 19 01:17:41 2001
+++ sys/i386/isa/clock.c	Sun Nov 25 00:08:38 2001
@@ -509,7 +509,7 @@
 #endif
 }
 
-static void
+void
 sysbeepstop(void *chan)
 {
 	outb(IO_PPI, inb(IO_PPI)&0xFC);	/* disable counter2 output to speaker */
--- sys/i386/include/clock.h.orig	Wed Dec 29 05:32:58 1999
+++ sys/i386/include/clock.h	Sun Nov 25 00:08:38 2001
@@ -44,6 +44,7 @@
 int	release_timer1 __P((void));
 #endif
 int	sysbeep __P((int pitch, int period));
+void	sysbeepstop __P((void *chan));
 void	i8254_restore __P((void));
 
 #endif /* _KERNEL */
--- sys/kern/kern_shutdown.c.orig	Thu Aug 23 12:32:29 2001
+++ sys/kern/kern_shutdown.c	Sun Nov 25 00:08:38 2001
@@ -43,6 +43,7 @@
 #include "opt_hw_wdog.h"
 #include "opt_panic.h"
 #include "opt_show_busybufs.h"
+#include "opt_kern_shutdown.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -329,6 +330,13 @@
 		printf("\n");
 		printf("The operating system has halted.\n");
 		printf("Please press any key to reboot.\n\n");
+
+#ifdef SHUTDOWN_BEEP
+		sysbeep(500,1);
+		DELAY(500000);
+		sysbeepstop(NULL);
+#endif /*SHUTDOWN_BEEP*/
+
 		switch (cngetc()) {
 		case -1:		/* No console, just die */
 			cpu_halt();
--- sys/conf/options.orig	Fri Aug  3 02:47:27 2001
+++ sys/conf/options	Sun Nov 25 00:08:38 2001
@@ -101,6 +101,7 @@
 UCONSOLE
 ICMP_BANDLIM
 VFS_AIO
+SHUTDOWN_BEEP	opt_kern_shutdown.h
 
 # POSIX kernel options
 P1003_1B			opt_posix.h


>Release-Note:
>Audit-Trail:

From: Kris Kennaway <kris@obsecurity.org>
To: freebsd-gnats-submit@FreeBSD.org, list@rachinsky.de
Cc:  
Subject: Re: kern/34820
Date: Fri, 10 Oct 2003 22:38:34 -0700

 See also kern/43577 which contains an alternative implementation.  One
 of these two should probably be closed.
 
 Kris
 

From: Nicolas Rachinsky <list@rachinsky.de>
To: Kris Kennaway <kris@obsecurity.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/34820
Date: Sat, 11 Oct 2003 11:46:34 +0200

 * Kris Kennaway <kris@obsecurity.org> [2003-10-10 22:38 -0700]:
 > See also kern/43577 which contains an alternative implementation.  One
 > of these two should probably be closed.
 
 I think 34820 should be closed since 43577 seems far more flexible.
 
 Nicolas
 
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Thu Oct 16 23:29:51 PDT 2003 
State-Changed-Why:  
Closed at submitter request, see 43577 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34820 
>Unformatted:
