All of lore.kernel.org
 help / color / mirror / Atom feed
* Simple module for 2.6 request?
@ 2006-11-04  5:05 lkml-2006i-ticket
  2006-11-04  6:27 ` Oleg Verych
  2006-11-04  9:50 ` Jan Engelhardt
  0 siblings, 2 replies; 3+ messages in thread
From: lkml-2006i-ticket @ 2006-11-04  5:05 UTC (permalink / raw)
  To: linux-kernel


Hello,
it is not so easy to find online an *working* example of how to by hand
build a module.

gcc -o foo.c -ko foo.ko -DMODULE -D__KERNEL__
-I/usr/src/kernel-headers-directory/include/

with module license define macro

almost worked, but it misses thoes extra symbols created in
post-compilation.

How to add them by hand (not using all the big Makefiles normally
included in kernel tree)?

Like
some-command foo.ko foo.c
insmod foo.ko
done



-- 
LimCore    C++ Software Architect / Team Lead
---> oo    Linux programs
limcore
software



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Simple module for 2.6 request?
  2006-11-04  5:05 Simple module for 2.6 request? lkml-2006i-ticket
@ 2006-11-04  6:27 ` Oleg Verych
  2006-11-04  9:50 ` Jan Engelhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Oleg Verych @ 2006-11-04  6:27 UTC (permalink / raw)
  To: linux-kernel

> Hello,
> it is not so easy to find online an *working* example of how to by hand
> build a module.

Please find information on how to build (external) modules in
"Documentation/kbuild/modules.txt" directory of your linux source tree.
More (implementation) info can be found in the top Makefile.

> gcc -o foo.c -ko foo.ko -DMODULE -D__KERNEL__
> -I/usr/src/kernel-headers-directory/include/
>
> with module license define macro
>
> almost worked, but it misses thoes extra symbols created in
> post-compilation.
>
> How to add them by hand (not using all the big Makefiles normally
> included in kernel tree)?
>
> Like
> some-command foo.ko foo.c
> insmod foo.ko
> done
____


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Simple module for 2.6 request?
  2006-11-04  5:05 Simple module for 2.6 request? lkml-2006i-ticket
  2006-11-04  6:27 ` Oleg Verych
@ 2006-11-04  9:50 ` Jan Engelhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2006-11-04  9:50 UTC (permalink / raw)
  To: lkml-2006i-ticket@limcore.pl; +Cc: linux-kernel


>how to by hand build a module.

Compilation has too many flags and too many steps to be reasonably done 
by hand. Unlike *cough* BSD or Solaris, the Linux kernel makefile system 
is designed to reasonably support external modules using all the 
necessary parameters the kernel you are compiling for needs. You know, I 
always get a shudder when I have to think of Solaris not having 
MODVERSIONS or even VERMAGIC -- it is dangerous because it allows you to 
build stuff that can fubar more easily.

>gcc -o foo.c -ko foo.ko -DMODULE -D__KERNEL__
>-I/usr/src/kernel-headers-directory/include/

gcc: unrecognized option '-ko'

>How to add them by hand (not using all the big Makefiles normally
>included in kernel tree)?

Who said they are big? Look at 
http://jengelh.hopto.org/f/oops_ko.tar.bz2 for a _really_ simple module.


	-`J'
-- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-04  9:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-04  5:05 Simple module for 2.6 request? lkml-2006i-ticket
2006-11-04  6:27 ` Oleg Verych
2006-11-04  9:50 ` Jan Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.