Subject: port-sparc/5220: after autoconfig changes, impossible to build sun4c-only kernel
To: None <gnats-bugs@gnats.netbsd.org>
From: Jason R Thorpe <thorpej@nas.nasa.gov>
List: netbsd-bugs
Date: 03/27/1998 13:41:13
>Number:         5220
>Category:       port-sparc
>Synopsis:       after autoconfig changes, impossible to build sun4c-only kernel
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 27 14:05:01 1998
>Last-Modified:
>Originator:     Jason R Thorpe
>Organization:
Numerical Aerospace Simulation Facility - NASA Ames
>Release:        NetBSD 1.3E, March 27, 1998
>Environment:
	
System: NetBSD lestat 1.3C NetBSD 1.3C (LESTAT) #125: Sat Feb 14 17:54:05 PST 1998 thorpej@lestat:/tmp_mnt/dracul/u5/netbsd/src/sys/arch/sparc/compile/LESTAT sparc


>Description:
	Several drivers which now have multiple attachments for devices in
	one file unconditionally reference functions in objects which may
	not be included in a trimmed-down kernel.
>How-To-Repeat:
	Attempt to build a NetBSD/sparc kernel with the following kernel
	configuration file:

#
# Kernel for lestat.nas.nasa.gov, thorpej's workstation and cluster server
# 

include "arch/sparc/conf/std.sparc"

options		SUN4C

maxusers	32

makeoptions	DEBUG="-g"

# Standard system options
options		KTRACE		# system call tracing support
options		SYSVMSG		# System V message queues
options		SYSVSEM		# System V semaphores
options		SYSVSHM		# System V shared memory
options		LKM		# loadable kernel modules
options		INSECURE	# disable kernel security
options 	UCONSOLE	# user can TIOCCONS (for xconsole)
options 	NTP		# network time protocol support

options 	UVM		# Use the UVM VM code
#options 	UVMHIST		# UVM history logs
#options 	PMAP_NEW	# Use the new pmap interface

# Debugging options
options 	DDB		# Kernel Dynamic Debugger
options 	DIAGNOSTIC
#options 	DEBUG

# Compatibility options
options		COMPAT_43	# Generic 4.3BSD compatibility
options		COMPAT_09	# NetBSD 0.9 (ancient)
options		COMPAT_10	# NetBSD 1.0
options		COMPAT_12	# NetBSD 1.2
options 	COMPAT_13	# NetBSD 1.3
options		COMPAT_SUNOS	# SunOS 4.x
options		COMPAT_SVR4	# SunOS 5.x
options 	EXEC_ELF32	# support for exec'ing 32-bit ELF

# File systems
file-system	FFS		# Berkeley Fast Filesystem
file-system	NFS		# Network File System
file-system	KERNFS		# kernel data-structure filesystem
file-system	PROCFS		# /proc
file-system	MFS		# memory-based filesystem
file-system	FDESC		# user file descriptor filesystem
file-system	CD9660		# ISO 9660 + Rock Ridge file system
file-system	MSDOSFS		# MSDOS filesystem

# File system options
options		NFSSERVER	# Sun NFS-compatible server
options		FIFO		# POSIX fifo support (in all filesystems)

# Networking options
options		INET
options		TCP_COMPAT_42	# compatibility with 4.2BSD TCP/IP
options 	NMBCLUSTERS=1024

# Options for SPARCstation hardware
#options 	RASTERCONSOLE		# fast rasterop console

# SCSI options
options 	SCSIVERBOSE	# better SCSI error messages

config		netbsd root ? type ?

# Main bus and CPU
mainbus0 at root
cpu0	at mainbus0

# Bus support
sbus0	at mainbus0					# sun4c

auxreg0	at mainbus0					# sun4c

clock0	at mainbus0					# sun4c

memreg0	at mainbus0					# sun4c

timer0	at mainbus0					# sun4c

audioamd0 at mainbus0
audio*	at audioamd?

zs0	at mainbus0
zstty0	at zs0 channel 0	# ttya
zstty1	at zs0 channel 1	# ttyb

zs1	at mainbus0
kbd0	at zs1 channel 0	# keyboard
ms0	at zs1 channel 1	# mouse

# old sun4c SCSI
dma*	at sbus0 slot ? offset ?
esp*	at sbus0 slot ? offset ?
esp*	at dma?

scsibus* at esp?

# old sun4c
le*	at sbus? slot ? offset ?

cgsix* at sbus? slot ? offset ?

sd*	at scsibus? target ? lun ?
st*	at scsibus? target ? lun ?
cd*	at scsibus? target ? lun ?

fdc0	at mainbus0
fd*	at fdc0

pseudo-device	loop			# loopback network interface
pseudo-device	pty	64		# pseudo-ttys
pseudo-device	vnd	4		# "vnode" disk driver
pseudo-device	ccd	4		# "concatenated" disk driver
pseudo-device	bpfilter 16		# Berkeley packet filter

>Fix:
	For every driver that has multiple attachments, the file needs to
	be split like so (example is clock.c):

	Mostek clock common code:	clock.c
	mainbus attachment:		clock_mainbus.c
	obio attachment:		clock_obio.c

	Sun timer common code:		timer.c
	mainbus attachment		timer_mainbus.c
	obio attachment			timer_obio.c

	Intersil clock common code:	oclock.c
	(Only one [obio] attachment for this device, so it can stay in
	oclock.c)

	This needs to be done for all devices with multiple attachments.
>Audit-Trail:
>Unformatted: