module 프로그래밍 좀 갈켜주세요

익명 사용자의 이미지

안녕하세요..
리눅스를 열심히 공부하고 있는 초보학생입니다

커널을 공부하다가 모듈 프로그램이란것을 만났습니다
상당히 흥미롭군요..^^
보통 첨으로 작성하곤 하는 hello를 작성하구요
컴파일을 시켰는데 이상하게 커널소스 자체에서 에러가 뜨는군요...흠...
커널 버젼이 안맞아서 그런건가?

------------------------------------------------
/*hello_module.c
2002-8-1
모듈프로그래밍 하면서 짠 최초의 프로그램*/

#include
#include

int init_module()
{
printk("Hello Module!! I'm Kernel\n");
printk("넌 누구냐??\n");
return 0;
}

void cleanup_module()
{
printk("Bye Module~~\n");
}
-----------------------------------
이 제가 짠 프로그램이구요...
밑에 있는것이 에러입니다

---------------------------------------
[root@kyj kernel 공부]# make
gcc -Wall -DMODULE -D__KERNEL__ -DLINUX -c hello_module.c
In file included from hello_module.c5
/usr/include/linux/kernel.h65 parse error before `size_t'
/usr/include/linux/kernel.h66 parse error before `size_t'
make *** [hello_module.o] 오류 1
-------------------------------------------

그리고 제 리눅스에 있는 kernel.h 중에 오류가 난 부분입니다
----------------------------------------------------------
extern int sprintf(char * buf, const char * fmt, ...);
extern int vsprintf(char *buf, const char * , va_list);
extern int snprintf(char *buf, size_t size, const char *fmt, ...); //65번째 줄
extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);//66번째 줄
-----------------------------------------------------------------------------------

한컴 리눅스 2.2를 쓰는데요..
머가 틀린걸까요?
아무리해도 알수가 없군요..

그럼 즐거운 하루 되시구요~~

익명 사용자의 이미지

저는 Wow linux 7.1 쓰눈데여 잘 컴파일되눈데여....

익명 사용자의 이미지

그러세요? 흠...머가 잘못된거지?
오후내내 봤는데 모르겠네..ㅡㅡ;;

혹시 커널버젼이 틀리거나 gcc가 틀려져서 옵션이 달라진건 아닐까요?
kernel2.4.18 <-- 적수네에서 구한거...
gcc 2.95.4 <--한컴에서 구한거....

익명 사용자의 이미지

며칠간 고민하다가..(사실 그때 보고 오늘 첨 보지만..^^;)
gcc를 업그레이드 하기로 했지요..^^
헤헤~ gcc 3.0.2로 올렸더니
아무문제 없이 되는군요...
그래도 큰 결정이였는데..헤헷....
잘되니깐 기분 좋네여...님들도 즐거운 하루 되세요~

댓글 달기

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