NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-i386/41301: Compiling kernel without PCI buses configured fails



>Number:         41301
>Category:       port-i386
>Synopsis:       Compiling kernel without PCI buses configured fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 29 07:00:00 +0000 2009
>Originator:     Jarle Greipsland
>Release:        NetBSD 5.99.11
>Organization:
        
>Environment:
        
        
System: NetBSD darling.urc.uninett.no 5.99.11 NetBSD 5.99.11 (DARLING) #2: Tue 
Apr 28 20:04:12 CEST 2009 
jarle%darling.urc.uninett.no@localhost:/usr/obj/sys/arch/i386/compile/DARLING 
i386
Architecture: i386
Machine: i386
>Description:

I tried to compile a new, current kernel for my trusty old i486
system; a system with no PCI bus.  I have my own custom configuration
file (see below) that matches the hardware of the system, and I try to
keep the kernel as small as possible by removing stuff I don't need.
This time the kernel build failed: first due to variables and
functions being defined but never used, and, once fixed, the link
failed because of some other unresolved symbols.  I've "fixed" this
mostly by wrapping the offending code in #if NPCI > 0 / #endif blocks
(diff below).

        
>How-To-Repeat:
The active parts of the custom configuration file:

include         "arch/i386/conf/std.i386"

options         INCLUDE_CONFIG_FILE     # embed config file in kernel binary

maxusers        64              # estimated number of users

makeoptions     CPUFLAGS="-march=i486"

options         INSECURE        # disable kernel security levels - X needs this

options         RTC_OFFSET=0    # hardware clock is this many mins. west of GMT
options         NTP             # NTP phase/frequency locked loop

options         KTRACE          # system call tracing via ktrace(1)

options         SYSVMSG         # System V-like message queues
options         SYSVSEM         # System V-like semaphores
options         SYSVSHM         # System V-like memory sharing
options         P1003_1B_SEMAPHORE      # p1003.1b semaphore support

options         USERCONF        # userconf(4) support
options         SYSCTL_INCLUDE_DESCR    # Include sysctl descriptions in kernel

options         BUFQ_PRIOCSCAN

options         DDB             # in-kernel debugger
options         DDB_HISTORY_SIZE=512    # enable history editing in DDB

options         COMPAT_NOMID    # NetBSD 0.8, 386BSD, and BSDI
options         COMPAT_09       # NetBSD 0.9
options         COMPAT_10       # NetBSD 1.0
options         COMPAT_11       # NetBSD 1.1
options         COMPAT_12       # NetBSD 1.2, 386BSD, and BSDI
options         COMPAT_13       # NetBSD 1.3, 386BSD, and BSDI
options         COMPAT_14       # NetBSD 1.4
options         COMPAT_15       # NetBSD 1.5
options         COMPAT_16       # NetBSD 1.6
options         COMPAT_20       # NetBSD 2.0
options         COMPAT_30       # NetBSD 3.0
options         COMPAT_40       # NetBSD 4.0
options         COMPAT_50       # NetBSD 5.0

options         COMPAT_BSDPTY   # /dev/[pt]ty?? ptys.

options         DKWEDGE_AUTODISCOVER    # Automatically add dk(4) instances
options         DKWEDGE_METHOD_GPT      # Supports GPT partitions as wedges

file-system     FFS             # UFS
file-system     NFS             # Network File System client
file-system     MSDOSFS         # MS-DOS file system
file-system     FDESC           # /dev/fd
file-system     KERNFS          # /kern
file-system     NULLFS          # loopback file system
file-system     OVERLAY         # overlay file system
file-system     PROCFS          # /proc
file-system     UMAPFS          # NULLFS + uid and gid remapping
file-system     UNION           # union file system
file-system     PTYFS           # /dev/ptm support
file-system     TMPFS           # Efficient memory file-system

options         QUOTA           # UFS quotas
options         WAPBL           # File system journaling support - Experimental
options         NFSSERVER       # Network File System server

options         INET            # IP + ICMP + TCP + UDP
options         INET6           # IPV6
options         PFIL_HOOKS      # pfil(9) packet filter hooks
options         IPFILTER_LOG    # ipmon(8) log support
options         IPFILTER_LOOKUP # ippool(8) support

options         EISAVERBOSE     # verbose EISA device autoconfig messages
options         SCSIVERBOSE     # human readable SCSI error messages

options         WSEMUL_VT100            # VT100 / VT220 emulation
options         WSDISPLAY_CUSTOM_OUTPUT # color customization from wsconsctl(8)
options         WS_KERNEL_FG=WSCOL_GREEN
options         WSDISPLAY_CUSTOM_BORDER # custom border colors via wsconsctl(8)
options         WSDISPLAY_COMPAT_PCVT           # emulate some ioctls
options         WSDISPLAY_COMPAT_SYSCONS        # emulate some ioctls
options         WSDISPLAY_COMPAT_USL            # VT handling
options         WSDISPLAY_COMPAT_RAWKBD         # can get raw scancodes
options         WSKBD_USONLY                    # strip off non-US keymaps
options         PCKBD_CNATTACH_MAY_FAIL
options         WSDISPLAY_SCROLLSUPPORT

config          netbsd  root on ? type ?

options         VGA_POST                # in-kernel support for VGA POST

eisa0   at mainbus?

isa0    at mainbus?

npx0    at isa? port 0xf0 irq 13        # x86 math coprocessor

pckbc0          at isa?                 # pc keyboard controller
pckbd*          at pckbc?               # PC keyboard
pms*            at pckbc?               # PS/2 mouse for wsmouse
options         PMS_SYNAPTICS_TOUCHPAD  # Enable support for Synaptics Touchpads
options         PMS_ELANTECH_TOUCHPAD   # Enable support for Elantech Touchpads
vga0            at isa?
wsdisplay*      at vga? console ?
wskbd*          at pckbd? console ?
wsmouse*        at pms? mux 0

attimer0        at isa?
pcppi0          at isa?
sysbeep0        at pcppi?

com0    at isa? port 0x3f8 irq 4        # Standard PC serial ports
com1    at isa? port 0x2f8 irq 3
com2    at isa? port 0x3e8 irq 5

lpt0    at isa? port 0x378 irq 7        # standard PC parallel ports

aic0    at isa? port 0x340 irq 11       # Adaptec 152[02] SCSI

scsibus* at scsi?

sd*     at scsibus? target ? lun ?      # SCSI disk drives

wdc0    at isa? port 0x1f0 irq 14 flags 0x00
wdc1    at isa? port 0x170 irq 15 flags 0x00

atabus* at ata?

wd*     at atabus? drive ? flags 0x0000

fdc0    at isa? port 0x3f0 irq 6 drq 2  # standard PC floppy controllers
fd*     at fdc? drive ?                 # the drives themselves

we0     at isa? port 0x280 iomem 0xd0000 irq 9  # WD/SMC Ethernet
we1     at isa? port 0x300 iomem 0xcc000 irq 10

spkr0   at pcppi?               # PC speaker

cinclude "arch/i386/conf/GENERIC.local"

pseudo-device   crypto          # /dev/crypto device
pseudo-device   swcrypto        # software crypto implementation

pseudo-device   fss             4       # file system snapshot device

pseudo-device   md              1       # memory disk device (ramdisk)
options         MEMORY_DISK_HOOKS       # enable root ramdisk
options         MEMORY_DISK_DYNAMIC     # loaded via kernel module

pseudo-device   vnd                     # disk-like interface to files

pseudo-device   bpfilter                # Berkeley packet filter
pseudo-device   ipfilter                # IP filter (firewall) and NAT
pseudo-device   loop                    # network loopback
pseudo-device   tun                     # network tunneling over tty
pseudo-device   gre                     # generic L3 over IP tunnel

pseudo-device   pty                     # pseudo-terminals
pseudo-device   rnd                     # /dev/random and in-kernel generator
pseudo-device   clockctl                # user control of clock subsystem
pseudo-device   ksyms                   # /dev/ksyms

pseudo-device   wsmux                   # mouse & keyboard multiplexor
pseudo-device   wsfont

pseudo-device   cmos

pseudo-device   drvctl

options         PAX_MPROTECT=0          # PaX mprotect(2) restrictions
options         PAX_ASLR=0              # PaX Address Space Layout Randomization

        
>Fix:
        
Index: sys/arch/i386/i386/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/mainbus.c,v
retrieving revision 1.84
diff -u -r1.84 mainbus.c
--- sys/arch/i386/i386/mainbus.c        17 Apr 2009 21:07:58 -0000      1.84
+++ sys/arch/i386/i386/mainbus.c        29 Apr 2009 06:42:35 -0000
@@ -190,7 +190,9 @@
        if (sc->sc_pci == child)
                sc->sc_pci = NULL;
 
+#if NPCI > 0
        mp_pci_childdetached(self, child);
+#endif
 }
 
 /*
Index: sys/arch/x86/x86/x86_autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/x86_autoconf.c,v
retrieving revision 1.38
diff -u -r1.38 x86_autoconf.c
--- sys/arch/x86/x86/x86_autoconf.c     17 Feb 2009 11:16:10 -0000      1.38
+++ sys/arch/x86/x86/x86_autoconf.c     29 Apr 2009 06:42:35 -0000
@@ -69,6 +69,7 @@
 struct disklist *x86_alldisks;
 int x86_ndisks;
 
+#if NPCI > 0
 static void
 x86_genfb_set_mapreg(void *opaque, int index, int r, int g, int b)
 {
@@ -77,6 +78,7 @@
        outb(0x3c0 + VGA_DAC_PALETTE, (uint8_t)g >> 2);
        outb(0x3c0 + VGA_DAC_PALETTE, (uint8_t)b >> 2);
 }
+#endif
 
 static void
 handle_wedges(struct device *dv, int par)
@@ -502,7 +504,9 @@
 void
 device_register(struct device *dev, void *aux)
 {
+#if NPCI > 0
        static bool found_console = false;
+#endif
 
        /*
         * Handle network interfaces here, the attachment information is

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index