안녕하세요 저번에 질문 드렸는데요

 

linux-2.6.35-s5pv210  리눅스 커널 디렉토리에서 상단위치에서

 

make_s5pv210.sh  파일을 이용해 커널을 컴파일을 했더니,

 

linux-2.6.35-s5pv210 디렉토리와 같은 위치에  build_s5pv210 이라는 폴더가 생성됩니다.

캡처1.JPG

 

전에 조언과 같이 ,

test 폴더에 있는 make 파일을

캡처2.JPG

다음과같이 KDIR 를 바꾸어서 컴파일 한 결과 ,,

 

 

 

 

root@spao-VirtualBox:/home/work/test# make
make -C /home/work/build_s5pv210 SUBDIRS=/home/work/test modules
make[1]: Entering directory `/home/work/build_s5pv210'
make -C /home/work/linux-2.6.35-s5pv210 O=/home/work/build_s5pv210/. modules
  CC [M]  /home/work/test/test_module.o
In file included from /home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/bitops.h:447:0,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/bitops.h:22,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/kernel.h:17,
                 from /home/work/test/test_module.c:9:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/arch_hweight.h: In function ‘__arch_hweight64’:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/arch_hweight.h:53:7: error: expected ‘:’ or ‘)’ before ‘POPCNT64’
In file included from /home/work/linux-2.6.35-s5pv210/include/linux/prefetch.h:14:0,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/list.h:6,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/module.h:9,
                 from /home/work/test/test_module.c:11:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h: At top level:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h:116:30: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h:116:1: error: requested alignment is not a constant
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h:159:0: warning: "cache_line_size" redefined [enabled by default]
/home/work/linux-2.6.35-s5pv210/include/linux/cache.h:64:0: note: this is the location of the previous definition
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h:239:1: error: requested alignment is not a constant
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h:270:1: error: requested alignment is not a constant
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h: In function ‘native_get_debugreg’:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h:502:3: error: invalid application of ‘sizeof’ to incomplete type ‘struct bug_entry’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h: In function ‘native_set_debugreg’:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/processor.h:529:3: error: invalid application of ‘sizeof’ to incomplete type ‘struct bug_entry’
In file included from /home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic.h:319:0,
                 from /home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/thread_info.h:24,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/thread_info.h:56,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/preempt.h:9,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/spinlock.h:50,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/seqlock.h:29,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/time.h:8,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/stat.h:60,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/module.h:10,
                 from /home/work/test/test_module.c:11:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h: At top level:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:19:1: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h: In function ‘atomic64_read’:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:21:32: error: request for member ‘counter’ in something not a structure or union
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h: At top level:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:31:33: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:43:41: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:57:41: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:73:49: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:89:33: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:102:33: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:117:41: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:135:41: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:154:49: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:171:48: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:180:48: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:188:37: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:193:34: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:207:39: error: unknown type name ‘atomic64_t’
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/atomic64_64.h:231:45: error: unknown type name ‘atomic64_t’
In file included from /home/work/linux-2.6.35-s5pv210/include/linux/seqlock.h:29:0,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/time.h:8,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/stat.h:60,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/module.h:10,
                 from /home/work/test/test_module.c:11:
/home/work/linux-2.6.35-s5pv210/include/linux/spinlock.h: In function ‘assert_spin_locked’:
/home/work/linux-2.6.35-s5pv210/include/linux/spinlock.h:379:2: error: invalid application of ‘sizeof’ to incomplete type ‘struct bug_entry’
In file included from /home/work/linux-2.6.35-s5pv210/include/linux/mmzone.h:16:0,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/gfp.h:4,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/kmod.h:22,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/module.h:13,
                 from /home/work/test/test_module.c:11:
/home/work/linux-2.6.35-s5pv210/include/linux/nodemask.h: In function ‘__first_node’:
/home/work/linux-2.6.35-s5pv210/include/linux/nodemask.h:237:2: error: implicit declaration of function ‘find_first_bit’ [-Werror=implicit-function-declaration]
/home/work/linux-2.6.35-s5pv210/include/linux/nodemask.h: In function ‘__next_node’:
/home/work/linux-2.6.35-s5pv210/include/linux/nodemask.h:243:2: error: implicit declaration of function ‘find_next_bit’ [-Werror=implicit-function-declaration]
/home/work/linux-2.6.35-s5pv210/include/linux/nodemask.h: In function ‘__first_unset_node’:
/home/work/linux-2.6.35-s5pv210/include/linux/nodemask.h:266:2: error: implicit declaration of function ‘find_first_zero_bit’ [-Werror=implicit-function-declaration]
In file included from /home/work/linux-2.6.35-s5pv210/include/linux/elf.h:7:0,
                 from /home/work/linux-2.6.35-s5pv210/include/linux/module.h:14,
                 from /home/work/test/test_module.c:11:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/elf.h: In function ‘elf_common_init’:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/elf.h:167:3: error: ‘struct thread_struct’ has no member named ‘fs’
In file included from /home/work/linux-2.6.35-s5pv210/include/linux/module.h:21:0,
                 from /home/work/test/test_module.c:11:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/module.h: At top level:
/home/work/linux-2.6.35-s5pv210/arch/x86/include/asm/module.h:59:2: error: #error unknown processor family
/home/work/test/test_module.c:18:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘test_init’
/home/work/test/test_module.c:28:13: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
/home/work/test/test_module.c: In function ‘__inittest’:
/home/work/test/test_module.c:38:1: error: ‘test_init’ undeclared (first use in this function)
/home/work/test/test_module.c:38:1: note: each undeclared identifier is reported only once for each function it appears in
/home/work/test/test_module.c: At top level:
/home/work/test/test_module.c:38:1: error: ‘init_module’ aliased to undefined symbol ‘test_init’
cc1: some warnings being treated as errors

make[4]: *** [/home/work/test/test_module.o] Error 1
make[3]: *** [_module_/home/work/test] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/work/build_s5pv210'
make: *** [all] Error 2
root@spao-VirtualBox:/home/work/test#

 

 

이런 에러 메시지를 찍더군요 , 헤더파일을 못찾는거같기도하구..;

 

다른분께서는 커널 디렉토리 하위에 build_xxxxxx 가 생길거라고 하셨는데 ,

 

커널 디렉토리 하위에는 따로 생성되는게 없더라구요 ㅠ

 

어떻게 해야할까요? ㅠ

 

 

참고로...

모듈로 컴파일하려고 하는 파일은 다음과 같습니다.

  1 /*
  2  * test_module.c
  3  *
  4  *  Created on: 2012. 11. 8.
  5  *      Author: moon
  6  */
  7
  8
  9 #include <linux/kernel.h>
 10
 11 #include <linux/module.h>
 12
 13 #include <linux/init.h>
 14
 15
 16
 17
 18 int __intit test_init()
 19
 20 {
 21
 22     printk("module init \n");
 23
 24     return 0;
 25
 26 }
 27
 28 void __exit test_exit()
 29
 30 {
 31
 32     printk("module exit \n");
 33 }
 34
 35
 36
 37
 38 module_init( test_init );
 39
 40 module_exit( test_exit );
 41
 42 MODULE_LICENSE("GPL");