[tulip-bug] Problem linking tulip driver into kernel in RH7

Julia Steinberger jks@noleak.mit.edu
Tue, 23 Jan 2001 23:01:44 -0500 (EST)


Hello,

We are trying to set up a diskless computer running linux. The idea
is to get it to download its kernel from a server on the network, using
bootp.
Its ethernet chip is a DEC 21143, we have found that the most recent
tulip driver from scyld.com does work with it -- when the 'diskless'
computer is booted from a floppy, and the driver is loaded as a module
with insmod.

Our problem arises when we try to compile the kernel with the tulip.c
driver linked into it -- not as a loadable module. Our basic approach is

===>1.
to compile pci-scan.c and tulip.c (using
kgcc -I/usr/src/linux/include -D__KERNEL__ -DMODULE -Wall
-Wstrict-prototypes -O6 -c tulip.c                    
                           and
 kgcc -DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I/usr/src/linux/include -Wall
-Wstrict-prototypes -O6 -c pci-scan.c    
). 

We are running the dreaded RedHat 7, hence the kgcc and specific
include directions. 

This compiling works, giving only the error message:

/tmp/cccGsPe9.s: Assembler messages:
/tmp/cccGsPe9.s:26: Warning: Ignoring changed section attributes for
.modinfo    

for both pci-scan and tulip.

===> 2. 
We then move the pci-scan.o and tulip.o executables into the 
/usr/src/drivers/net/ directory, and modify the 
/usr/src/linux/drivers/net/Makefile as described in
http://www.scyld.com/network/updates.html#single .

====>3. 
we then try 'make bzImage', and get the following error:

make[1]: Leaving directory `/usr/src/linux-2.2.16/arch/i386/math-emu'
kgcc -D__KERNEL__ -I/usr/src/linux/include -E -C -P
-I/usr/src/linux/include -imacros
/usr/src/linux/include/asm-i386/page_offset.h -Ui386
arch/i386/vmlinux.lds.S >arch/i386/vmlinux.lds
ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext
arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o
init/version.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o
mm/mm.o fs/fs.o ipc/ipc.o \
        fs/filesystems.a \
        net/network.a \
        drivers/block/block.a drivers/char/char.a drivers/misc/misc.a
drivers/net/net.a drivers/cdrom/cdrom.a drivers/pci/pci.a
drivers/pnp/pnp.a drivers/video/video.a arch/i386/math-emu/math.a \
        /usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a
/usr/src/linux/arch/i386/lib/lib.a \
        --end-group \
        -o vmlinux
drivers/net/net.a(Space.o)(.data.init+0x0): undefined reference to
`tulip_probe'
make: *** [vmlinux] Error 1    

===>4. 
In our desperation to get a compiled kernel, we commented
out the reference to 'tulip_probe' in drivers/net/Space.c
(lines 216-218 
#if defined(CONFIG_DEC_ELCP) || defined(CONFIG_DEC_ELCP_OLD)
	{tulip_probe, 0},
#endif
)

===>5. 
The kernel then compiled, but when our diskless computer
tried to boot from it, it returned an IPconfig error message
(then failed to mount NFS). In the process, our diskless computer
also was un-pingable from the outside, even though it had been
successfully given an IP address by its bootp server. 

===>6. 
Our conclusion: the ethernet driver does not get linked into
the kernel if we do not comment out the relevant lines in 
/drivers/net/Space.c (see step 4), but when those lines are
commented out, something gets messed up and the computer can't
use its ethernet chip! 

PS: yes, the kernel did compile using the 'wrong' (old) tulip driver
included in the RH distribution, but that driver doesn't work for
this ethernet chip.

Any help/comments/questions welcome, sorry for the awfully long post.

Julia