[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with System call!!
On Tue, 2 Apr 2002, Pavan Kumar Achanta wrote:
| I was tring to implement the standard pedagogictime system
| call from 'nutt'.. It got compiled but got an error :
Hm, Apr-02. Not a joke, right?
| Error while loading shared libraries : libc.80.6 Cannot
| stat shared object: Error 14 /sbin/mingetty
Probably a syscall error due to a mangled syscall table...
| when I restart with the new kernel image
| And this is what I did .....
Was this from a diff/patch file, and it wouldn't apply cleanly?
(hint, hint)
| ********* step1 *******************
| /usr/src/linux/arch/i386/kernel/entry.S
|
| .data
| ENTRY(sys_call_table)
| .long SYMBOL_NAME(sys_ni_syscall) /* 0 - old "setup()"
| system call*/
| .long SYMBOL_NAME(sys_exit)
| .long SYMBOL_NAME(sys_fork)
| .long SYMBOL_NAME(sys_read)
| .long SYMBOL_NAME(sys_write)
| .long SYMBOL_NAME(sys_open) /* 5 */
|
| ..................
|
| .long SYMBOL_NAME(sys_ni_syscall) /* streams1 */
| .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */
| .long SYMBOL_NAME(sys_vfork) /* 190 */
|
| .long SYMBOL_NAME(sys_pedagogictime) /* 191 */
This could have been correct when there were only 190 defined
syscalls. When there are 221 syscalls, you should make
sys_pedagogictime be number 222, and larger if there are more
syscalls already defined. I.e., don't stomp on current
syscalls.
| .rept NR_syscalls-191 //change number -190 to -191
| .long SYMBOL_NAME(sys_ni_syscall)
| .endr
|
| it was NR_syscalls-221 and changed it to NR_syscalls-191
and this made syscalls 191-221 invalid ("ni" == not implemented).
| //********* step2 *******************
| And one more line to file /usr/src/linux/include/asm/unistd.h
|
| #define __NR_sigaltstack 186
| #define __NR_sendfile 187
| #define __NR_getpmsg 188 /* some people actually want
| streams */
| #define __NR_putpmsg 189 /* some people actually want
| streams */
| #define __NR_vfork 190
| #define __NR_pedagogictime 191 /*Bill add this line for lab4 */
Use next available number, don't stomp on existing syscalls.
| Here I didnt know what to do about the already existing
| #define __NR_mmap 191 so I just kept it as it is..
| Can somebody tell me what the line
|
| .rept NR_syscalls-191 //change number -190 to -191
| .long SYMBOL_NAME(sys_ni_syscall)
| .endr
This just fills up the syscalls table with pointers to
"sys_ni_syscall", so that syscall numbers 191 thru NR_syscalls
will call the ni_syscall and return an error value to the caller.
| means and how the whole thing works!!! and what is the right
| way to add a system call ....
Yeah, there should be a simple writeup on that somewhere.
Did you search for one?
I think that I've given you enough ammunition to take the next
step(s), without actually doing the work for you.
--
~Randy
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/