Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Feb 2002 11:34:57 +0100 (CET)
From:      Nicolas Rachinsky <list@rachinsky.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/34820: FreeBSD should be able to beep after shutdown
Message-ID:  <200202111034.g1BAYvi07954@pc5.abc>

next in thread | raw e-mail | index | archive | help

>Number:         34820
>Category:       kern
>Synopsis:       FreeBSD should be able to beep after shutdown
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 11 02:40:03 PST 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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