gcc 디버그 메세지 해석 부탁드립니다~
root@mbcls-VirtualBox:/media/Extra/usr/src# uname -r
2.6.38.8.helloworld
root@mbcls-VirtualBox:/media/Extra/usr/src# gcc test.c -o test
test.c: In function ‘main’:
test.c:5:10: error: ‘__NR_helloworld’ undeclared (first use in this function)
test.c:5:10: note: each undeclared identifier is reported only once for each function it appears in
---------------------------------------------------------------------------컴파일 시 나타나는 메세지 입니다.
#define __NR_hellowrld 341
int main(void)
{
syscall(__NR_helloworld);
return 0;
}
---------------------------------------------------------------------------test.c 입니다.
#include
#include
#include
#include
asmlinkage long sys_helloworld()
{
printk("hello world!");
return 0;
}
---------------------------------------------------------------------------helloworld.c 입니다.
바로 아래 제가 올린 글에 따라 helloworld라는 system call을 추가해서 컴파일한 커널입니다.
등록된 system call을 확인하려고 컴파일하니 저런 메세지가 뜨네요......
아래 파일들은 리눅스 커널 소스가 설치되어 있는 폴더 기준입니다.
....../arch/x86/include/asm/unistd_32.h
....../arch/x86/kernel/syscall_table_32.s
....../kernel/helloworld.c //system call 함수 원형입니다.
이 세 파일중 어디에서 문제가 생겼던 걸까요?
다 맞게 쓴 것 같은데 오류가 나네요..ㅠㅠ
아니면, system call 관련해서 어떤 블로그에서는
....../arch/x86/include/asm/syscalls.h
에서 함수 prototype을 선언하라 하던데요, 제가 이 부분을 안 해서 그런 걸까요?
Define에 오타가 있네요
Define에 오타가 있네요
printk => printf
printk => printf
댓글 달기