>> Read No. 32819 article  
[Q] 모듈 프로그래밍에서..

등록 2001-06-11 19:59:00     조회 1
이름 김수용    

		리눅스 커널에 적재될 모듈을 하나 만들려고 하는데,
 예제 프로그램 따라하는 데서 부터 에러가 나네요.. ㅠ.ㅠ
 참고 문헌은 Linux Kernel Module Programming Guide 입니다.
 여기서 hello.c 라는 파일을 만들었는데, #include <linux/modversions.h> 라는
부분이
 있습니다.
 #if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif       
 위에 내용이 들어 있는데 컴팔 해보면,
gcc -Wall -DMODULE -D__KERNEL__ -DLINUX -c start.c
In file included from
start.c:19: /usr/include/linux/modversions.h:1:2: #error Modules should never
use kernel-headers system headers,
/usr/include/linux/modversions.h:2:2: #error but headers from an appropriate
kernel-source
make: *** [start.o] 오류 1
  이런 에러를 내면서 hello.o 를 만들어 내지 못하네요.
 그래서 modversions.h 내용을 보니까,
 #error Modules should never use kernel-headers system headers,
#error but headers from an appropriate kernel-source
 요곳 밖에 없네요.. 그러니 당연히 이 내용이 찍힌 것 같습니다..
 그래서 modversions.h 를 include 하는 부분을 comment out 시키고 돌려보니
 컴팔은 되는데..
 다음과 같은 워닝 메세지가 뜹니다.
 /tmp/cc0RbNBa.s: Assembler messages:
/tmp/cc0RbNBa.s:8: Warning: Ignoring changed section attributes for .modinfo
  이것까진 괜찮은데.. 실제로 만들어진 hello.o 를 로드해 볼려고..
 insmod hello.o 를 해 보니
 hello.o: kernel-module version mismatch
        hello.o was compiled for kernel version 2.4.0-0.26
        while this kernel is version 2.4.5.
 이런 에러가 나면서 안되네요..
 헐..
 얼케해야 하는지 좀 알려 주세요~  ㅠ.ㅠ
 커널 수정해야 하는데, 여기서 부터 막히니 암담하네요.  ^^;;
 그럼~
이름
암호
Register [ localhost 목록보기 윗글 아랫글
글쓰기
답장쓰기 수정 삭제
정규표현식 [ 상세 검색 ]
페이지로딩: [ 0.54 초 ] 작업시간: [ 0.22 초 ]

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved
[TOP]

적수네 동네
+
| 적수네 동네
| 공부방
| 리눅스 잡지 서고
| LSN 소스
| 링크 모음
+---+
게시판
+
| 떠들어보세!
| 질문과 답변
| 새소식과 정보
| 1원짜리 팁?
| 대화방
+---+
칼럼?
+
| 세하 훔쳐보기
| Welcome2nite
| 혜진의 염장판
+---+
리눅스 상표권
+
| 반대 서명란
| 토론 게시판
+---+
GNU
+
| GNU 선언문
| GNU GPL
| GNU 미러 목록
+---+
프로젝트?
+
| 리눅스카운터
| RC5DES
| 실질헌법 제작
+---+
커널 소식
+
| 안정 버젼: 2.4.14
+---+
테마 선택
+
LSN 방송국?
+
| OFF AIR
+---+
회원
+
| 로그인
+---+
[ 적수네 동네 ] [ 리눅스 상표권 독점 반대 ] [ 한글 리눅스 문서 프로젝트 ] [ KrLine ] [ 사랑넷 ] [ Valid HTML 4.0! ] [ SlashDot ] [ Freshmeat ]
Copyleft (C) 1998-2001 Byeong-Chan Kim . License
TIME: 1789520389
System by WYZsoft, HDD by I.O.Linux, Mizi Research, Embryo, WOWLINUX, Domain by SarangNet, Network by KrLine.