Re:system call implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jan

Yes! I have declared sys_test. This is what i did in implementing my new 
system call "test(int)".

In file LINUXSOURCE/inlucde/asm/include/unistd.h, I added
     #define __NR_test 226

In file /usr/include/bits/syscall.h, I added
   #define SYS_test__NR_test

Then Created a directory "test" under LINUXSOURCE

did my makefile, in which i added
      #include<asm/unistd.h>
      _syscall1(int,test,int,number)

(The system call test(int) takes one integer as its argument).

then in my makefile i added the following lines:
O_TARGET := testCall.o
O_OBJS:=test.o

also, I added the top level directories in my Makefile

then i edited the entry.S  in <linuxsource>/arch/i386/kernel

added the following at the end
  .long SYMBOL_NAME(sys_test)

the last few lines of my entry.S looks like this

.rept NR_syscalls-(.-sys_call_table)/4
     .long SYMBOL_NAME(sys_ni_syscall)
.endr

so, I didn't make any changes to these lines shown just above.

since,I added an other directory under linux source, I edited the top level 
makefile.

thats all I did.

and Make dep went well,but, make bzImage gives an error:

In arch/i386/kernel/kernel.o: n function sys_call_table:
arch/i386/kernel/kernel.o(data+0x3d4): undefined reference to 'sys_test'



so, I think Iam presenting a clear picture of what all I did in implementing 
the system call( without confusing u). could u figure out what the problem 
could be???


Thanks!!
Charumathi.



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux