Note/Memo2010. 10. 29. 10:02


  1 #include <stdio.h>
  2 #include <errno.h>
  3 #include <asm-mips/unistd.h>
  4
  5 //#define __NR_Linux            4000
  6 //#define __NR_scanning     (__NR_Linux + 314)
  7
  8 //_syscall0( long, scanning);
  9
 10 int main()
 11 {
 12     long temp;
 13    
 14     temp = syscall(__NR_scanning);
 15     printf("%ld ---%d \n", temp,__NR_scanning);
 16
 17 }  
 18

 위는 유저 영역 프로그램

 컴파일 시

 /usr/local/mips-linux-uclibc-gcc-3.4.6-rsdk-1.3.5/rsdk/linux/mips-linux-gcc -I LINUX_PATH/include/ -o scan scan.c


 시스템콜 함수은 kernel/sys.c에 그냥 추가 시킴.. 따로 파일로 빼도 되지면 테스트 함수라 귀찮음으로 인하여..

Posted by 스카이데이즈