Subject: kern/32450: non-pci, pure 486-happy isa kernel doesn't depend/make
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <netbsdMLpostNO@SPAM.quake.ca>
List: netbsd-bugs
Date: 01/04/2006 03:15:00
>Number:         32450
>Category:       kern
>Synopsis:       building kernel without a large chunk of options (pci/etc) fails.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 04 03:15:00 +0000 2006
>Originator:     Marc Tooley
>Release:        NetBSD 3.99.15
>Organization:
>Environment:
System: NetBSD warp.sudog.com 3.99.15 NetBSD 3.99.15 (warp) #2: Mon Jan 2 11:57:09 PST 2006 root@warp.sudog.com:/usr/src-current/sys/arch/i386/compile/warp i386
Architecture: i386
Machine: i386
>Description:
	The build environment is -current as of today or a day or two ago. 
	Essentially, using the kernel config listed below causes it to choke
	because the wdc_isa code depends on functions which are listed in
	sys/dev/ic/wdc.c which itself ends up not being included in the Makefile
	and dependencies. The functions in specific are:

	#      link  BATTLE/netbsd
	ld -T ../../../../arch/i386/conf/kern.ldscript -Ttext c0100000 -e start -X -o netbsd ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
	wdc_isa.o(.text+0x119): In function `wdc_isa_probe':
	: undefined reference to `wdc_init_shadow_regs'
	wdc_isa.o(.text+0x155): In function `wdc_isa_probe':
	: undefined reference to `wdcprobe'
	wdc_isa.o(.text+0x336): In function `wdc_isa_attach':
	: undefined reference to `wdc_init_shadow_regs'
	wdc_isa.o(.text+0x34a): In function `wdc_isa_attach':
	: undefined reference to `wdcintr'
	wdc_isa.o(.text+0x376): In function `wdc_isa_attach':
	: undefined reference to `wdcattach'
	*** Error code 1

	It would appear that some recent work done to introduce these shadow
	registers may have inadvertently made them dependent on options
	which are there to support pci machines? Or perhaps I'm missing
	something. It wouldn't be the first time.

>How-To-Repeat:
	. Update to 3.99.15 (most recent I could find) as of.. hrm.. Dec 31 05
	anyway..
	. Rebuild config, and install it.
	. Use the following kernel config:

	include 	"arch/i386/conf/std.i386"
	options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
	maxusers	4		# estimated number of users
	options 	I486_CPU
	options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
	file-system 	FFS		# UFS
	options 	INET		# IP + ICMP + TCP + UDP
	options 	IPFILTER_LOG	# ipmon(8) log support
	options 	WSDISPLAY_CUSTOM_OUTPUT	# color customization from wsconsctl(8)
	options 	WS_KERNEL_FG=WSCOL_GREEN
	options 	WSDISPLAY_CUSTOM_BORDER	# border customization from wsconsctl(8)
	options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
	options 	PCKBD_CNATTACH_MAY_FAIL
	options 	PCDISPLAY_SOFTCURSOR
	config		netbsd	root on ? type ?
	mainbus0 at root
	cpu* at mainbus?
	isa0	at mainbus?
	isapnp0 at isa?
	npx0	at isa? port 0xf0 irq 13	# x86 math coprocessor
	pckbc0		at isa?			# pc keyboard controller
	pckbd*		at pckbc?		# PC keyboard
	vga0		at isa?
	wsdisplay*	at vga? console ?
	wskbd*		at pckbd? console ?
	pcppi0		at isa?
	sysbeep0	at pcppi?
	com0	at isa? port 0x3f8 irq 4	# Standard PC serial ports
	com1	at isa? port 0x2f8 irq 3
	lpt0	at isa? port 0x378 irq 7	# standard PC parallel ports
	wdc0	at isa? port 0x1f0 irq 14 flags 0x00
	fdc0	at isa? port 0x3f0 irq 6 drq 2	# standard PC floppy controllers
	fd*	at fdc? drive ?			# the drives themselves
	ep*	at isa? port ? irq ?			# 3C509 ethernet cards
	iy0	at isa? port 0x360 irq ?		# EtherExpress PRO 10 ISA
	ne1	at isa? port 0x300 irq 10
	include	"arch/i386/conf/GENERIC.local"
	pseudo-device	bpfilter	8	# Berkeley packet filter
	pseudo-device	ipfilter		# IP filter (firewall) and NAT
	pseudo-device	loop			# network loopback
	pseudo-device	sl		2	# Serial Line IP
	pseudo-device	tun		4	# network tunneling over tty
	pseudo-device	pty			# pseudo-terminals
	pseudo-device	rnd			# /dev/random and in-kernel generator
	pseudo-device	clockctl		# user control of clock subsystem
	pseudo-device	wsmux			# mouse & keyboard multiplexor
	pseudo-device	wsfont
	pseudo-device	ksyms			# /dev/ksyms

	cd /usr/src-current/sys/arch/i386/conf
	config MYKERN
	cd ../compile/MYKERN
	make depend && make

	... and eventually end up with the error messages up above about
	shadow registers.

>Fix:
	I wish I knew. I modified the Makefile to include the dev/ic/wdc.c
	file but then it started whining about missing atabus symbols during
	the final link.