Hi
As I know, if I invoke a system call, it uses a special instruction (called as trap instruction) to change the kernel mode. When I use fork() to create a new process, I neither see any special instruction that changes the mode nor any jmp to any other function like sys_fork!
Here is the gdb dump of the statically compiled C code that uses a fork call.
Code:
(gdb) disas fork
Dump of assembler code for function fork:
0x08053350 <fork+0>: push %ebp
0x08053351 <fork+1>: mov $0x0,%edx
0x08053356 <fork+6>: mov %esp,%ebp
0x08053358 <fork+8>: sub $0x8,%esp
0x0805335b <fork+11>: test %edx,%edx
0x0805335d <fork+13>: mov %ebx,0xfffffffc(%ebp)
0x08053360 <fork+16>: je 0x8053375 <fork+37>
0x08053362 <fork+18>: movl $0x80b05c0,(%esp)
0x08053369 <fork+25>: call 0x0
0x0805336e <fork+30>: mov 0xfffffffc(%ebp),%ebx
0x08053371 <fork+33>: mov %ebp,%esp
0x08053373 <fork+35>: pop %ebp
0x08053374 <fork+36>: ret
0x08053375 <fork+37>: mov $0x2,%eax
0x0805337a <fork+42>: int $0x80
0x0805337c <fork+44>: cmp $0xfffff000,%eax
0x08053381 <fork+49>: mov %eax,%ebx
0x08053383 <fork+51>: ja 0x8053389 <fork+57>
0x08053385 <fork+53>: mov %ebx,%eax
0x08053387 <fork+55>: jmp 0x805336e <fork+30>
0x08053389 <fork+57>: neg %ebx
0x0805338b <fork+59>: call 0x80489c0 <__errno_location>
---Type <return> to continue, or q <return> to quit---
0x08053390 <fork+64>: mov %ebx,(%eax)
0x08053392 <fork+66>: mov $0xffffffff,%ebx
0x08053397 <fork+71>: jmp 0x8053385 <fork+53>
Thanks in advice....