커널 컴파일 문제 입니다.... 답이 안나와서..ㅠㅠ

ATOM의 이미지

지금 디바이스 드라이버를 공부하는 학생인데.. 지금 수세 10을 쓰고 있습니다..

지금 커널이 2.6인데.. 2.4을 모듈로 올려야 하는데.. 이것저것 찾아 봐도

잘 되지가 않아서 이렇게 글을 쓰게 되네요..

보통 하는것과 같이 했는데.. 잘 안되요..

2.4에서 2.6으로 잘 올라 간다고는 하던데.. 2.6에서 2.4 모듈을 올리는건 잘 보지를 못했거든요..

아무튼 좋은 답변 부탁 드려요...

메일은 ha1111p@nate.com 입니다..

쪽지나 메일로 좀 갈켜 주세요.. 정말 부탁 합니다.

moonhyunjin의 이미지

2.6기반의 배포판을 쓰면 2.6만 올립니다.

<- 이거면 안되는 게 없어~
정품 소프트웨어 사용 캠패인

<- 이거면 안 되는 게 없어~
정품 소프트웨어 사용 캠패인

hie의 이미지

Makefile 및 변경된 Struct 및 헤더 파일 위치 등을
수정한 후 재 컴파일후 올리면 됩니다.

공개허용된 부분까지 소스코드를 올려 주세요.

ATOM의 이미지

공개 허용된 부분이 어디 까지인지 몰라서...

그냥 MAKE파일을 올립니다...

좋은 답변 부탁 드립니다..

puaxx의 이미지

2.6하고 2.4하고 모듈 방식이 완전히 틀리다고 알고 있는데..제가 잘못 안것인지?

kslee80의 이미지

Quote:
2.4에서 2.6으로 잘 올라 간다고는 하던데.. 2.6에서 2.4 모듈을 올리는건 잘 보지를 못했거든요..

2.4 모듈을 2.6 시스템에서 사용하는 것이나,
2.6 모듈을 2.4 시스템에서 쓰는 것이나 둘다 불가능합니다.

시스템이 수세 10 이라면 커널을 2.4 로 교체하는것 보다는 아예 2.4 커널 기반의 배포본으로 새로 까는것이 낫겠군요.

P.S.) OP분께서 답변하는 위치라면, 원글만을 가지고 좋은 답변을 할 수 있는지를 생각해 보시기를...
답변해 줄 수 있는 정보가 너무 없군요.

ATOM의 이미지

제가 아는 분은 2.4에서 2.6모듈을 올려서 지금 쓰고있는 걸로 알고 있습니다..

전 2.6에 2.4을 올려서 쓸려고 합니다..

아는 분이 가르쳐 준 방식데로 하다가 안되고 이리 저리 찾아서 봐도 안되고 해서 도움을 요청한 거에요..

찾아도 도저히 안되면 2.4로 깔려고 생각 중입니다...

그런데.. 그래도 하는데 까지 한번 해보고 할 생각이라서 .. 지금도 계속 인터넷을 뒤지고 있답니다..

아무튼 답변은 감사 하구요.. 질문에 관심을 가져주셔셔 감사 합니다..

hie의 이미지


본인의 문제를 해결할 수 있는 혹은 실마리를 제공해줄 답변을
기대하고 여기에 질문을 했을거라 생각이 듭니다. 물론 속시원한
답변을 찾지 못해 아쉽기도 하셨을테구요..

이번에는 제가 질문을 드리겠습니다.
1. 모듈 빌드는 성공하셨나요??
실패했다면 에러 로그를 올려 주시기 바랍니다.

2. 커널로의 모듈 삽입은 성공했나요??
lsmod로 확인하세요.

3. 모듈 삽입 후 모듈이 원하던 동작을 수행 하나요??
정상동작 하지 않는다면 어는 부분까지 정상동작을 확인하셨나요?
만약 패닉이 난다면 esp등의 레지스터 값을 가지고 패닉 원인을
제공한 함수 추적을 하셨나요??

ATOM의 이미지

1.지금 모듈빌드를 했냐고 물으셨는데...지금 make bzImage도 에러가 나오고 있습니다..
그래서 지금 그 에러를 올려 드리겠습니다..

-----------------------------------------------------
gcc -D__KERNEL__ -I/project/linux-2.4.21/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DKBUILD_BASENAME=main -c -o init/main.o init/main.c
In file included from /project/linux-2.4.21/include/linux/unistd.h:9,
from init/main.c:17:
/project/linux-2.4.21/include/asm/unistd.h:375: warning: conflicting types for built-in function '_exit'
. scripts/mkversion > .tmpversion
gcc -D__KERNEL__ -I/project/linux-2.4.21/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DUTS_MACHINE='"i386"' -DKBUILD_BASENAME=version -c -o init/version.o init/version.c
gcc -D__KERNEL__ -I/project/linux-2.4.21/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DKBUILD_BASENAME=do_mounts -c -o init/do_mounts.o init/do_mounts.c
In file included from /project/linux-2.4.21/include/linux/unistd.h:9,
from init/do_mounts.c:5:
/project/linux-2.4.21/include/asm/unistd.h:375: warning: conflicting types for built-in function '_exit'
make CFLAGS="-D__KERNEL__ -I/project/linux-2.4.21/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 " -C kernel
make[1]: Entering directory `/project/linux-2.4.21/kernel'
make all_targets
make[2]: Entering directory `/project/linux-2.4.21/kernel'
gcc -D__KERNEL__ -I/project/linux-2.4.21/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix include -DKBUILD_BASENAME=sched -fno-omit-frame-pointer -c -o sched.o sched.c
-------------------------------------------------------
여기서 부터 에러가 뜹니다...ㅠㅠ
-------------------------------------------------------
sched.c:213: error: conflicting types for 'reschedule_idle'
sched.c:210: error: previous declaration of 'reschedule_idle' was here
sched.c:213: error: conflicting types for 'reschedule_idle'
sched.c:210: error: previous declaration of 'reschedule_idle' was here
sched.c:371: error: conflicting types for 'wake_up_process'
/project/linux-2.4.21/include/linux/sched.h:601: error: previous declaration of 'wake_up_process' was here
sched.c:371: error: conflicting types for 'wake_up_process'
/project/linux-2.4.21/include/linux/sched.h:601: error: previous declaration of 'wake_up_process' was here
sched.c:409: error: conflicting types for 'schedule_timeout'
/project/linux-2.4.21/include/linux/sched.h:148: error: previous declaration of 'schedule_timeout' was here
sched.c:409: error: conflicting types for 'schedule_timeout'
/project/linux-2.4.21/include/linux/sched.h:148: error: previous declaration of 'schedule_timeout' was here
sched.c:739: error: conflicting types for '__wake_up'
/project/linux-2.4.21/include/linux/sched.h:593: error: previous declaration of '__wake_up' was here
sched.c:739: error: conflicting types for '__wake_up'
/project/linux-2.4.21/include/linux/sched.h:593: error: previous declaration of '__wake_up' was here
sched.c:749: error: conflicting types for '__wake_up_sync'
/project/linux-2.4.21/include/linux/sched.h:594: error: previous declaration of '__wake_up_sync' was here
sched.c:749: error: conflicting types for '__wake_up_sync'
/project/linux-2.4.21/include/linux/sched.h:594: error: previous declaration of '__wake_up_sync' was here
sched.c:759: error: conflicting types for 'complete'
/project/linux-2.4.21/include/linux/completion.h:31: error: previous declaration of 'complete' was here
sched.c:759: error: conflicting types for 'complete'
/project/linux-2.4.21/include/linux/completion.h:31: error: previous declaration of 'complete' was here
sched.c:769: error: conflicting types for 'wait_for_completion'
/project/linux-2.4.21/include/linux/completion.h:30: error: previous declaration of 'wait_for_completion' was here
sched.c:769: error: conflicting types for 'wait_for_completion'
/project/linux-2.4.21/include/linux/completion.h:30: error: previous declaration of 'wait_for_completion' was here
sched.c:804: error: conflicting types for 'interruptible_sleep_on'
/project/linux-2.4.21/include/linux/sched.h:598: error: previous declaration of 'interruptible_sleep_on' was here
sched.c:804: error: conflicting types for 'interruptible_sleep_on'
/project/linux-2.4.21/include/linux/sched.h:598: error: previous declaration of 'interruptible_sleep_on' was here
sched.c:815: error: conflicting types for 'interruptible_sleep_on_timeout'
/project/linux-2.4.21/include/linux/sched.h:599: error: previous declaration of 'interruptible_sleep_on_timeout' was here
sched.c:815: error: conflicting types for 'interruptible_sleep_on_timeout'
/project/linux-2.4.21/include/linux/sched.h:599: error: previous declaration of 'interruptible_sleep_on_timeout' was here
sched.c:828: error: conflicting types for 'sleep_on'
/project/linux-2.4.21/include/linux/sched.h:595: error: previous declaration of 'sleep_on' was here
sched.c:828: error: conflicting types for 'sleep_on'
/project/linux-2.4.21/include/linux/sched.h:595: error: previous declaration of 'sleep_on' was here
sched.c:839: error: conflicting types for 'sleep_on_timeout'
/project/linux-2.4.21/include/linux/sched.h:596: error: previous declaration of 'sleep_on_timeout' was here
sched.c:839: error: conflicting types for 'sleep_on_timeout'
/project/linux-2.4.21/include/linux/sched.h:596: error: previous declaration of 'sleep_on_timeout' was here
sched.c:210: warning: 'reschedule_idle' declared `static' but never defined
make[2]: *** [sched.o] 오류 1
make[2]: Leaving directory `/project/linux-2.4.21/kernel'
make[1]: *** [first_rule] 오류 2
make[1]: Leaving directory `/project/linux-2.4.21/kernel'
make: *** [_dir_kernel] 오류 2

1번도 안되었는데..2번3번이 다 될리가 만무 합니다..ㅠㅠ

아무튼 지금 저는 배우는 학생이라 많이 모르고 지금 배우고 있는 중입니다..
그런점을 고려해 주시길 바랍니다..

hie의 이미지

혹시 원 커널 트리에는 없는 무언가를( 예. 커널 2.4에서의 freeswan ) 트리에
포함 시킨 후 컴파일을 하시는 것인가요?? 맞나요??

sched.c:213: error: conflicting types for 'reschedule_idle'

함수의 원형과 선언 부분이 틀릴때 발생하는 에러입니다. 대부분 그 문제인듯 하네요..
자세한 내용은 모르겠지만... 아마 커널 트리에 모듈을 포함시킬때 문제가 발생한듯 합니다.

현재 하고 있는 작업을 공개해도 된다면 조금 더 자세히 말씀해 주시기 바랍니다.

ATOM의 이미지

저도 위의 오류를 따라가서 찾아 보았는데.. 헤더 파일이나 여러가지가 없고 막막 그렇더구요..
어떻게 해야 할지 정확히 몰라서 맨처음 질문에 좀 추상적으로 올렸었습니다..

지금 커널 2.4.21을 컴파일 할려고 하고 있습니다.
뭐 특별하게 하는 작업은 아니구요..
지금 디바이스 드라이버를 공부하고 있습니다...
그래서 두가지 커널에서 실습 하고 뭐 작품 하나 만들어 볼려고 구상중입니다.
지금 2.6을 쓰고 있습니다..그위에 2.4를 모듈로 올릴려고 하고 있고요...

hie의 이미지

kslee80 씀
>2.4 모듈을 2.6 시스템에서 사용하는 것이나,
>2.6 모듈을 2.4 시스템에서 쓰는 것이나 둘다 불가능합니다.

어떤 의미인가요?? 자세한 설명 부탁드립니다. 오해를
불러일으킬 소지가 있는 것 같아서 부탁을 드립니다.

저는 이미 2.6 모듈을 2.4로 백포팅한 적이 있습니다.
그럼 제가 불가능을 가능하게 했다는 이야긴가요??
전 그정도의 고수가 아닙니다.

P.S. 인용 태그가 생각이 나질 않았다는.. ㅡ.ㅡ;;

danskesb의 이미지

아마도 바이너리 이야기가 아닐까 싶습니다.
---- 절취선 ----
http://ubuntu.ksa.hs.kr

kslee80의 이미지

2.6 모듈을 2.4 시스템에서 사용할 수 있게 백포팅했다는 것 자체는
이미 해당 모듈이 2.6 용 모듈이 아닌 2.4 용 모듈로 변환되었다고 볼 수 있겠죠?
그런 의미인 것입니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.