Modules INSIDE the kernel are different?

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

 



Hello everyone,
   I tried to insert a WORKING demo module of mine,
consisting of only one file: warn.c into the kernel
itself. Here is what i did:

(1) Put the file warn.c into the
/usr/src/linux/drivers/net/

(2) Added this line into the Config.in of the same
dir:

tristate 'WARN on and discard ARP packets?'
CONFIG_WARN_ARP

(3) Added this line into the Makefile of the same dir:

obj-$(CONFIG_WARN_ARP) += warn.o

(4) Re-configured the kernel to put the 'WARN on and
discard ARP packets?' on (not as a module) and
recompiled the kernel.

   Now on booting the newly compiled kernel,
everything goes fine except that the module i inserted
does'nt seem to be working. Closelly watching the
kernel compilation, I noticed the following lines:

gcc32 -D__KERNEL__
-I/usr/src/linux-2.4.22-1.2115.nptl/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2
-fno-strict-aliasing -fno-common -fomit-frame-pointer
-pipe -mpreferred-stack-boundary=2 -march=pentium3  
-nostdinc -iwithprefix include -DKBUILD_BASENAME=warn 
-c -o warn.o warn.c
rm -f net.o
ld -m elf_i386  -r -o net.o warn.o Space.o setup.o
net_init.o loopback.o auto_irq.o

AND:

make[1]: Entering directory
`/usr/src/linux-2.4.22-1.2115.nptl'
kallsyms pass 1
ld -m elf_i386 -T
/usr/src/linux-2.4.22-1.2115.nptl/arch/i386/vmlinux.lds
-e stext arch/i386/kernel/head.o
arch/i386/kernel/init_task.o init/main.o
init/version.o init/do_mounts.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 
drivers/acpi/acpi.o drivers/cpufreq/cpufreq.o
drivers/char/char.o drivers/block/block.o
drivers/misc/misc.o drivers/net/net.o
drivers/char/drm/drm.o drivers/net/fc/fc.o
drivers/net/appletalk/appletalk.o
drivers/net/tokenring/tr.o drivers/net/wan/wan.o
drivers/atm/atm.o drivers/ide/idedriver.o
drivers/cdrom/driver.o drivers/pci/driver.o
drivers/net/pcmcia/pcmcia_net.o
drivers/net/wireless/wireless_net.o drivers/pnp/pnp.o
drivers/video/video.o drivers/media/media.o
drivers/md/mddev.o drivers/hotplug/vmlinux-obj.o
drivers/isdn/vmlinux-obj.o crypto/crypto.o
net/network.o
/usr/src/linux-2.4.22-1.2115.nptl/arch/i386/lib/lib.a
/usr/src/linux-2.4.22-1.2115.nptl/lib/lib.a
/usr/src/linux-2.4.22-1.2115.nptl/arch/i386/lib/lib.a
--end-group -o .tmp_vmlinux1

     Which seems to tell me that my module does get
compiled INTO the kernel, it's just that it does'nt
get started. Are the modules that get statically
compiled coded differently?

=====
---------------------------------------------------------
"To teach how to live without certainty, and yet without being paralysed by hesitation, is perhaps the chief thing that philosophy, in our age, can still do for those who study it." --Bertrand Russell

"According to all the rules (of Software Engineering) I knew, Linux should have been a disaster, but it was'nt. Instead it was something wonderfull" -- Eric Raymond


	
		
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux