I'm looking for the code in the linux kernel (2.4.x) that initializes the first process, pid=0.
Many searches provided many clues, but I still cannot find it.
Any pointers, anyone?
I'm looking for the code in the linux kernel (2.4.x) that initializes the first process, pid=0.
Many searches provided many clues, but I still cannot find it.
Any pointers, anyone?
check out rest_init() at the end
// idle process, pid = 0
cpu_idle(); // never return
The initial task struct is set up by the macro INIT_TASK()
, defined in include/linux/init_task.h
. All other task structs are created by do_fork
.