From owner-freebsd-bugs Mon Feb 11 2:40:18 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1F4AB37B41A for ; Mon, 11 Feb 2002 02:40:03 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1BAe3f71966; Mon, 11 Feb 2002 02:40:03 -0800 (PST) (envelope-from gnats) 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 ; 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 Reply-To: Nicolas Rachinsky To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/34820: FreeBSD should be able to beep after shutdown Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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 #include @@ -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