how to initialize PCB in an operating system like Linux? -
typedef struct pcb { void *tf; uint8_t kstack[kstack_size]; } pcb //this structure
in question "pcb" means "process control block". in linux terms think task_struct.
the first task_struct initialized init_task.
other processes created fork(2), clone(2) etc. of these end calling do_fork. heavy lifting of creating new task_struct done copying old 1 in copy_process in turn calls dup_task_struct
Comments
Post a Comment