I am trying to understand the way system-calls are invoked on a Linux machine. For this, I ran a guest machine with a Linux 3.0.43 kernel on the QEMU emulator.
In order to know the system call numbers, I instrumented the interrupt function in qemu (do_interrupt_all() in target-i386/seg_helper.c — not very important). Basically whenever I get an int 0x80 interrupt, I print the value in the EAX register. The output of the run gave the system call numbers. I expected the exec system call for the init process first. Then a fork and some `brk system calls. However, I am not sure if that is what I got. I am printing the first 100 system call numbers here. My guest is a 64-bit machine. Here is an online code exploration for my kernel.
: 11
: 45
: 33
: 192
: 33
: 5
: 197
: 192
: 6
: 33
: 5
: 3
: 197
: 192
: 192
: 192
: 6
: 192
: 243
: 125
: 125
: 125
: 91
: 122
: 45
: 45
: 197
: 5
: 5
: 5
: 5
: 221
: 141
: 141
: 6
: 5
: 5
: 5
: 5
: 5
: 197
: 192
: 3
: 3
: 6
: 91
: 5
: 197
: 192
: 3
: 3
: 6
: 91
: 5
: 197
: 192
: 3
: 3
: 6
: 91
: 5
: 197
: 192
: 3
: 3
: 6
: 91
: 5
: 197
: 192
: 3
: 3
: 6
: 91
: 5
: 197
: 192
: 3
: 3
: 6
: 91
: 5
: 5
: 197
: 192
: 3
: 3
: 6
: 91
: 5
: 197
: 192
: 3
: 3
: 6
: 91
: 5
: 197
Yes, it’s what you got (Linux System Call Numbers, 64-bit Linux System Call Numbers):
sys_exevce, orexec‘s system callsys_brk, the thing under mallocsys_accesslgetxattrAnd so on.