calling my C function in entry.S...
From: Min Lee (abraxsus_at_yonsei.ac.kr.NOSPAM)
Date: 07/26/04
- Next message: P.T. Breuer: "Re: How to know the module-node connection"
- Previous message: ziliath: "e2fsck bombing because new kernel incompatible despite correct setting"
- Next in thread: Min Lee: "Re: calling my C function in entry.S..."
- Reply: Min Lee: "Re: calling my C function in entry.S..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 26 Jul 2004 13:56:18 +0900
I modified my entry.S to call my C function myrecord, which has only some
printks.
The function myrecord is marked as asmlinkage, of course.
I inserted 3 lines before "call *sys_call_table(,%eax,4) like this...
syscall_call:
cmpl $0, myswitch
je continue # Min Lee
call myrecord
continue:
call *sys_call_table(,%eax,4)
movl %eax,EAX(%esp) # store the return value
After my dummy system call sets the global var myswitch to 1, which enables
calls to myrecord, it soon causes init process to halt!
the result is...
INIT: PANIC: segmentation violation at 0xffffe449! sleeping for 30 seconds.
But when I move my stuffs after "call *sys_call_table(,%eax,4)" , it works!
syscall_call:
call *sys_call_table(,%eax,4)
movl %eax,EAX(%esp) # store the return value
cmpl $0, myswitch
je continue # Min Lee
call myrecord
continue:
What's wrong with the first trying?
What's the difference between calling myrecord function before and after
"call *sys_call_table" ??
- Next message: P.T. Breuer: "Re: How to know the module-node connection"
- Previous message: ziliath: "e2fsck bombing because new kernel incompatible despite correct setting"
- Next in thread: Min Lee: "Re: calling my C function in entry.S..."
- Reply: Min Lee: "Re: calling my C function in entry.S..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]