#include <stdio.h>
int main(void)
{
return 0;
}
When and how is the process control unit created for the above program?
For example, before the above program enters the execution state, the kernel must allocate pcb for this process.
Where can I find various starting system calls made in the kernel, so that I can track these calls in the kernel.
I ran strace in the above program, but I cannot get it.
execve("./a.out", ["./a.out"], []) = 0
brk(0) = 0x9aaf000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78df000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=112037, ...}) = 0
mmap2(NULL, 112037, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb78c3000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220o\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1462852, ...}) = 0
mmap2(NULL, 1473032, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x456000
mprotect(0x5b7000, 4096, PROT_NONE) = 0
mmap2(0x5b8000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x161) = 0x5b8000
mmap2(0x5bb000, 10760, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x5bb000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78c2000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb78c28d0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x5b8000, 8192, PROT_READ) = 0
mprotect(0x8049000, 4096, PROT_READ) = 0
mprotect(0xa92000, 4096, PROT_READ) = 0
munmap(0xb78c3000, 112037) = 0
exit_group(0) = ?
Some clues are needed to look ahead.