NetBSD Problem Report #1361

From gnats  Tue Aug 15 13:06:10 1995
Received: from eightball.banyan.com (eightball.banyan.com [131.100.105.80]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id NAA19076 for <gnats-bugs@gnats.netbsd.org>; Tue, 15 Aug 1995 13:06:09 -0400
Message-Id: <199508151659.MAA00316@eightball.banyan.com>
Date: Tue, 15 Aug 1995 12:59:08 -0400
From: rafal@scofflaw.banyan.com
Reply-To: rafal@scofflaw.banyan.com
To: gnats-bugs@gnats.netbsd.org
Subject: i386 speaker driver not converted to config.new
X-Send-Pr-Version: 3.2

>Number:         1361
>Category:       port-i386
>Synopsis:       i386 speaker driver still thinks it's dealing with old config
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 15 13:20:01 +0000 1995
>Closed-Date:    Thu Feb 22 05:52:13 +0000 1996
>Last-Modified:  Thu Feb 22 05:54:32 +0000 1996
>Originator:     Rafal Boni
>Release:        all -currents
>Organization:
	...not recently...
>Environment:

System: NetBSD eightball.banyan.com 1.0A NetBSD 1.0A (EIGHTBALL) #1: Tue Aug 15 11:34:00 EDT 1995 rafal@eightball.banyan.com:/home/scofflaw/src/netbsd/sys/arch/i386/compile/EIGHTBALL i386


>Description:
	The i386 speaker driver was never beat into submission when the port
	went to config.new, hence one cannot build a kernel that uses it..

>How-To-Repeat:
	Try to build a kernel with "spkr0 at isa? port 0x61" in it.
>Fix:

	Patch the following files in /sys/arch/i386:
			(1) isa/spkr.c
			(2) conf/files.i386
			(3) i386/conf.c

	Add "spkr0 at isa? port 0x61" to config-file, re-config and re-build
	Use speaker...

	Patches follow:

*** spkr.orig	Tue Aug 15 12:53:28 1995
--- spkr.c	Tue Aug 15 12:55:27 1995
***************
*** 8,32 ****
   *      386bsd only clean version, all SYSV stuff removed
   *      use hz value from param.c
   */

! #include "speaker.h"
! #if NSPEAKER > 0

  #include <sys/param.h>
  #include <sys/kernel.h>
  #include <sys/errno.h>
  #include <sys/buf.h>
  #include <sys/uio.h>

  #include <machine/cpu.h>
  #include <machine/pio.h>
  #include <machine/spkr.h>

! #include <i386/isa/isareg.h>
  #include <i386/isa/timerreg.h>
  #include <i386/isa/spkrreg.h>

  /**************** MACHINE DEPENDENT PART STARTS HERE *************************
   *
   * This section defines a function tone() which causes a tone of given
   * frequency and duration from the 80x86's console speaker.
--- 8,44 ----
   *      386bsd only clean version, all SYSV stuff removed
   *      use hz value from param.c
   */

! #include "spkr.h"
! #if NSPKR > 0

  #include <sys/param.h>
  #include <sys/kernel.h>
  #include <sys/errno.h>
+ #include <sys/device.h>
  #include <sys/buf.h>
  #include <sys/uio.h>

  #include <machine/cpu.h>
  #include <machine/pio.h>
  #include <machine/spkr.h>

! #include <dev/isa/isareg.h>
  #include <i386/isa/timerreg.h>
  #include <i386/isa/spkrreg.h>

+ int spkrprobe __P((struct device *, void *, void *));
+ void spkrattach __P((struct device *, struct device *, void *));
+ 
+ struct spkr_softc {
+ 	struct device sc_dev;
+ };
+ 
+ struct cfdriver spkrcd = {
+ 	NULL, "spkr", spkrprobe, spkrattach, DV_TTY, sizeof(struct spkr_softc)
+ };
+ 
  /**************** MACHINE DEPENDENT PART STARTS HERE *************************
   *
   * This section defines a function tone() which causes a tone of given
   * frequency and duration from the 80x86's console speaker.
***************
*** 43,54 ****
   * Magic numbers for timer control. 
   */
  #define PIT_MODE	(TIMER_SEL2|TIMER_16BIT|TIMER_SQWAVE)

- void
- speakerattach()
- {
- }

  static int endtone()
  /* turn off the speaker, ending current tone */
  {
--- 55,62 ----
***************
*** 400,407 ****
--- 408,425 ----
   */

  static int spkr_active;	/* exclusion flag */
  static struct buf *spkr_inbuf; /* incoming buf */
+ 
+ int spkrprobe (struct device *parent, void *match, void *aux)
+ {
+ 	return 1;
+ }
+ 
+ void spkrattach (struct device *parent, struct device *self, void *aux)
+ {
+ 	printf("\n");
+ }

  int spkropen(dev)
  dev_t	dev;
  {


*** /home/scofflaw/rafal/tmp/conf.c.orig	Tue Aug 15 11:46:22 1995
--- conf.c	Tue Aug 15 10:36:15 1995
***************
*** 142,150 ****
  cdev_decl(ch);
  dev_decl(fd,open);
  #include "bpfilter.h"
  cdev_decl(bpf);
! #include "speaker.h"
  cdev_decl(spkr);
  #ifdef LKM
  #define	NLKM	1
  #else
--- 142,150 ----
  cdev_decl(ch);
  dev_decl(fd,open);
  #include "bpfilter.h"
  cdev_decl(bpf);
! #include "spkr.h"
  cdev_decl(spkr);
  #ifdef LKM
  #define	NLKM	1
  #else
***************
*** 197,205 ****
  	cdev_bpftun_init(NBPFILTER,bpf),/* 23: Berkeley packet filter */
  	cdev_notdef(),			/* 24 */
  	cdev_notdef(),			/* 25 */
  	cdev_notdef(),			/* 26 */
! 	cdev_spkr_init(NSPEAKER,spkr),	/* 27: PC speaker */
  	cdev_lkm_init(NLKM,lkm),	/* 28: loadable module driver */
  	cdev_lkm_dummy(),		/* 29 */
  	cdev_lkm_dummy(),		/* 30 */
  	cdev_lkm_dummy(),		/* 31 */
--- 197,205 ----
  	cdev_bpftun_init(NBPFILTER,bpf),/* 23: Berkeley packet filter */
  	cdev_notdef(),			/* 24 */
  	cdev_notdef(),			/* 25 */
  	cdev_notdef(),			/* 26 */
! 	cdev_spkr_init(NSPKR,spkr),	/* 27: PC speaker */
  	cdev_lkm_init(NLKM,lkm),	/* 28: loadable module driver */
  	cdev_lkm_dummy(),		/* 29 */
  	cdev_lkm_dummy(),		/* 30 */
  	cdev_lkm_dummy(),		/* 31 */


*** /home/scofflaw/rafal/tmp/files.i386.orig	Tue Aug 15 11:46:05 1995
--- files.i386	Tue Aug 15 10:20:18 1995
***************
*** 97,105 ****
  major	{fd = 2}

  # PC speaker
  device	spkr at isa: tty
! file	arch/i386/isa/spkr.c		speaker needs-flag

  # AMD am7990 (Lance) -based boards
  # (BICC Isolan, NE2100, DEPCA)
  # XXX conflicts with other ports; can't be in files.isa
--- 97,105 ----
  major	{fd = 2}

  # PC speaker
  device	spkr at isa: tty
! file	arch/i386/isa/spkr.c		spkr needs-flag

  # AMD am7990 (Lance) -based boards
  # (BICC Isolan, NE2100, DEPCA)
  # XXX conflicts with other ports; can't be in files.isa
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: scottr 
State-Changed-When: Thu Feb 22 00:52:13 EST 1996 
State-Changed-Why:  
Applied the suggested change. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.