모듈 프로그래밍 관련해서..

iris422의 이미지

redhat 9의 커널 버젼 2.4.20-8 상태에서 모듈 프로그래밍을 하고 있습니다.
커널 자체에 대해서 약간 수정해서 2.4.20-8custom으로 컴파일 해서 잘 띄워 쓰고 있구여.. 텔넷으로 접속해서 작업중입니다.
이 상태에서 모듈 프로그래밍을 하는데 hello, world를 모듈로 올렸더니 /var/log/messages에는 메세지가 나오는데 텔넷창으로는 안 보이네여.. 원래 이런가여?
그리고.. 자꾸..insmod 할때 이런 메시지가 납니다.
Warning: loading hello.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modules
hello.o: init_module: Device or resource busy
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parame
ters.
You may find more information in syslog or the output from dmesg
왜 나는 거져?

그리고.. init_module(), cleanup_module()과 module_init(), module_cleanup()은 어떤 차이가 있나여?
좀 큰 모듈 예제를 보면 후자식으로 표현이되고
module_init(new_module_init()) 처럼 나오던데여...
다른 점이 있나여?

그리고.. 그냥 일반 모듈 프로그래밍 예제 문서대로 하면 2.4 커널에서 이용하는데에도 별 문제가 없는 건가여?

indie의 이미지

넵. telnet에서는 printk()내용이 출력되지 않습니다. telnet을 사용하시려면
창을 두개 띄워서 한쪽에다 tail -f /var/log/messages를 걸어 두세요.
그리고 라이세는 문제는 소스에다 MODULE_LICENSE("GPL")을 추가하시고요.
마지막 질문은 저도 확실히 모르겠네요..

집에나 갈까?

pastime의 이미지

예전 커널 버전에서는 모듈을 초기화하고 제거할 때 불리는 함수의 이름이
init_module()/exit_module()로 고정되어 있었습니다.

하지만 2.4 후반대의 커널과 2.6 커널에서는
module_init()/module_exit() 매크로를 이용하여
원하는 이름의 함수를 모듈의 초기화/제거 시에 사용할 수 있도록 하였습니다.

kiwist의 이미지

예전 커널 버전에서는 모듈을 초기화하고 제거할 때 불리는 함수의 이름이 
init_module()/exit_module()로 고정되어 있었습니다. 

init_module()/cleanup_module() 아닌가요? ^^; 딴지아닙니다.

제가 아는게 그거밖에 없어서...

pastime의 이미지

Quote:
init_module()/cleanup_module() 아닌가요? ^^;

맞습니다.
제가 잠깐 착각을 해서 잘못 적었네요.. :wink:

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.