Re: compiling kernel files with gcc

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

abhijit kumar wrote:

|dear all!
|  i want to compile my "/usr/src/inux/kernel/sched.c" with gcc -E .i
|want to do this because i want to study and understand the "sched.c" .
|when i was studying it i came to know that in linux many MACRO name
|are used in multiple files. so ; it is very tough to know that which
|value of MACRO my "sched.c" is actually using. for this purpose one of
|my friend has suggested to use gcc -E option. but when i run it i have
|following problem:--

Hmm... sounds like a homework question.

|
|
|[root@localhost root]# gcc -E /usr/src/linux/kernel/sched.c -isystem
|/usr/src/linux/include >> backup.out
|
|In file included from /usr/src/linux/include/linux/sched.h:6,
| from /usr/src/linux/include/linux/mm.h:4,
| from /usr/src/linux/kernel/sched.c:20:
|/usr/src/linux/include/linux/config.h:6:2: #error including kernel
|header in userspace; use the glibc headers instead!
|In file included from /usr/src/linux/include/linux/signal.h:4,
| from /usr/src/linux/include/linux/sched.h:25,
| from /usr/src/linux/include/linux/mm.h:4,
| from /usr/src/linux/kernel/sched.c:20:
|/usr/src/linux/include/linux/list.h:682:2: warning: #warning "don't
|include kernel headers in userspace"
|In file included from /usr/src/linux/include/linux/nmi.h:7,
| from /usr/src/linux/kernel/sched.c:22:
|/usr/src/linux/include/asm/irq.h:16:25: irq_vectors.h: No such file or directory
|
|i.e. it is n't correctly compiled and n't able to include some header
|files and it gives some
|"#warning "don't include kernel headers in userspace". please suggest
|me what i should do for getting out of my problem.


A lot has changed since the previous kernels:
~ 1) Header files have moved. A lot of the /linux/include files are not stored there anymore.
~ 2) Much of the architecture has changed with the latest kernels, Please read the associated documents included with the source to find out what has changed.


|
|
|If all of you have any link about some materials or tutorials to learn
|about 2.6 kernel (specially it's process scheduling code and method )
|please suggest me. i 've "understanding Linux kernel - o R'eily " and
|"Linux Kernel Programming" both for kernel 2.4.it is n't helping me
|(or perhaps i do n't know how to use it).


What happens if you use the makefile. It sounds a little like you want to compile the file all on its own. It doesn't work this way.


You also have to take the 2.4.xx stuff with a grain of salt. The 2.6.xx stuff has changed drastically in many respects.

|
|Thanking You
|Abhijit
|
Good Luck with your homework,
James Kosin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBiOMFkNLDmnu1kSkRApx2AJ9mcDHvyGHH9CV72GqQxyhjhNVv6gCfUlJV
nfR1v0J+60PdAbF6tNzkV4Y=
=vZyE
-----END PGP SIGNATURE-----


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux