리눅스 시스템 콜 추가 하는 법 질문드립니다.

yudeu의 이미지

안녕하세요.

리눅스 초보잔데요.

일단 윈도우에서 VMware를 사용해서 우분투를 설치했습니다.

최신버전을 설치하니
3.5.0-17-generic 이 설치되어 있었습니다.

그런데 2.6버전으로 해보고 싶어서 리눅스를 다운 받고,
시스템 콜 추가를 위해

http://kklyoon.tistory.com/258

http://murfboy.tistory.com/16#recentTrackback
를 참조하여

/usr/src/linux/arch/x86/include/asm/unistd_32.h
/usr/src/linux/arch/x86/include/asm/unistd_64.h
/usr/src/linux/arch/x86/kernel/syscall_table_32.S
/usr/src/linux/include/linux/syscalls.h
/usr/src/linux/kernel/Makefile

부분을 수정/추가 하였습니다.
전혀 빠짐 없이 수정하였고요.

그후

asmlinkage long sys_hello를 적고
커널을 컴파일 하기위해 make bzImage를 해보았고, 잘 되다가
hello.o 부분에서 멈췄습니다.

-------------------------------
소스 내용
-------------------------------

#include

asmlinkage long sys_hello(int i){
return i + 10;
}

--------------------------------

제가 문제 되는 부분은 2가진데..
1.

hello.c:1:27: fatal error: linux/linkage.h: No such file or directory
compilation terminated.

가 가장 먼저 되서 찾아보니,
linkage.h 파일은 분명 linux 폴더에 있었습니다.
다른것들은 kernel.h 라던가, errno.h 같은것들은 인식이 되는데 linkage.h만 인식이 안되더군요.

이걸 인식 시킬려면 어떻게 해야 되나요?

2.
그래서 혹시나 해서 linkage.h파일 자체를 가져와서 make했더니
이젠
hello.c:4:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘long’

이런 에러가 나더군요.

그래서 찾아보니 m 파일은 mm 해야된다 이런 소리가 있는데... 이건 아닌거 같고..

혹시나해서 우분투를 아예 밀어보기도 했고,
리눅스는 몇번이나 새로 받아서 깔아봤는지 모르겟습니다.

특히 아래는구글링을 몇십페이지나 했는데도 명확한 답이 안나오더군요..

제발 고수분이 계시면 부탁드립니다.
제발 알려주세요 ㅠㅠ

댓글 달기

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