Re: lug-bg: LKM compilation
- Subject: Re: lug-bg: LKM compilation
- From: mitko@xxxxxxx (Dimitar Peikov)
- Date: Fri, 12 Apr 2002 18:32:11 +0300
On Fri, 12 Apr 2002 18:03:10 +0300
George Danchev <danchev@xxxxxxxxx> wrote:
> On Friday 12 April 2002 15:16, you wrote:
> > On Fri, 12 Apr 2002 14:18:49 +0300
> >
> > "Ilia Trendafilov" <edac@xxxxxxxxxxx> wrote:
> > > Zdraveite,
> > > Poslednite dni si namerih nova zanimavka - pisaneto na LKMs
> > > Ne mi triabva za neshto seriozno, samo s poznavatelna cel. Obache
> > > imam slednia problem: dolnia mnogo prost source:
> > > ------------------------------------------
> > > #define MODVERSIONS
> >
> > #include <sys/types.h>
>
Ne sporja kakvo shte stane sled kato se compilira. Tova na Slackware 8.0
ne se compilira bez '#define MODVERSIONS' i '#include
<linux/modversions.h>', zatova mu dobavix types.h za definiciata na
size_t!
BTW: Njakoj na Slackware da e podkarval shared library kojato izpolzva
funkcia 'stat' s libc.so? Ne govorja za compilirane a za trugvane!
> zasto da include-va types.h ? koq function ste polzva ot tam ... ???
> Za da kompilira tazi programa koqto e napisal mozhe nisto da ne
> include-va, ama nisto. No posle kato izpylni "insmod hello.o" ste mu
> kazhe 4e ne mozhe da poznae za koq versiq na kernela e bil kompiliran
> tozi module, tova e ako ima kernel compiled s CONFIG_MODVERSION. Za
> tova ostava da include-va samo "module.h" i kompilira kakto kaza
> Angel.
>
> > > #include <linux/modversions.h>
> > > #include <linux/kernel.h>
> > > #include <linux/module.h>
> > >
> > > int init_module()
> > > {
> > > printk("<1> Hello World Module Start\n");
> > > return 0;
> > > }
> > >
> > > void cleanup_module()
> > > {
> > > printk("<1> Hello World Module Cleanup\n");
> > > }
> > > ------------------------------------------
> > > compiliram s komanden red:
> > > ------------------------------------------
> > > [edac kmod]$ gcc -c -DMODULE -D__KERNEL__ -DLINUX m1hw.c
> > > In file included from m1hw.c:3:
> > > /usr/include/linux/kernel.h:73: parse error before `size_t'
> > > /usr/include/linux/kernel.h:75: parse error before `size_t'
> > > In file included from /usr/include/asm/page.h:16,
> > > from /usr/include/asm/processor.h:13,
> > > from /usr/include/linux/prefetch.h:13,
> > > from /usr/include/linux/list.h:6,
> > > from /usr/include/linux/module.h:12,
> > > from m1hw.c:4:
> > > /usr/include/asm/mmx.h:10: parse error before `size_t'
> > > ------------------------------------------
> > > Rovih se iz .h files ama ne mojah da vidia neshto trevojno.
> > > gcc 2.95.3,
> > > kernel 2.4.18
> > > /*
> > > #define CONFIG_MODULES 1
> > > #define CONFIG_MODVERSIONS 1
> > > #define CONFIG_KMOD 1
> > > */
> > > /usr/include/asm e symlink kym /usr/src/linux/include/asm, koeto
> > > pyk e symlink kym /usr/src/linux/include/asm-i386
> > > /usr/include/linux e symlink kum /usr/src/linux/include/linux
> > > /* ako gornite neshta imat niakakvo znachenie */
>
> Zna4i tova e nqkakva stara distrubuciq bazirana na kernel 2.0 ili 2.2
> i v prehod ot libc5 kym libc6 (glibc 2) ili ti si si kompiliral sam
> glibc i linuxthreads i nqkude v stari docs si pro4el za tezi symlinks
> ot /usr/include kym /usr/src/linux. Tova ne go pishe v docs na glibc,
> nito pyk v docs na linuxthreads !!! Ta:
>
> s glibc 2 ne bi trqbvalo da imash symlinks
> ot /usr/include kym /usr/src/linux.
>
> A v /usr/src/linux/include/ syotvetno "asm" e symlink kym asm-<arch>,
> i tova e edinstveniq symlink v kernel source, kato arch se opredelq
> build time, da se znae za kakva arhitektura se kompilira kernela i da
> se vklu4i syotvetniq asm kod, koito e machinno zavisim. Tova e.
>
>
> REFERENCES:
> http://www.uwsg.indiana.edu/hypermail/linux/kernel/0007.3/0587.html
> http://eplip.hit.bg/ipx/ipx-build-mini-stupid-HOWTO.txt
> Sigurno i na drugi mesta pishat podobni warnings.
>
> --
> Greets,
> fr33zb1
> =====================================================================
> ====== A mail-list of Linux Users Group - Bulgaria (bulgarian
> linuxers) http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd.
> - Stara Zagora
>
--
Dimitar Peikov
Programmer Analyst
Globalization Group
"We Build e-Business"
RILA Solutions
27 Building, Acad.G.Bonchev Str.
1113 Sofia, Bulgaria
phone: (+359 2) 9797320
phone: (+359 2) 9797300
fax: (+359 2) 9733355
http://www.rila.com
===========================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
|