From 8d16db0cc28b2d911aee918d5c3582ad29ddfeed Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 18 Sep 2013 15:59:31 +0200 Subject: Add proc_set_init_task, make runsystem pid 1 * hurd/process.defs (proc_set_init_task): New procedure. * hurd/process_reply.defs (proc_set_init_task): Likewise. * hurd/process_request.defs (proc_set_init_task): Likewise. * include/pids.h: Add HURD_PID_INIT as 1, adjust others accordingly. * init/init.c (start_child): Register the child task. * proc/proc.h (init_proc): New variable. (create_startup_proc): Rename to create_init_proc. * proc/main.c (main): Create placeholder proc object for pid 1. * proc/mgt.c: Use init_proc instead of startup_proc, as the former is the new root of the process tree. (create_startup_proc): Rename to create_init_proc. (S_proc_set_init_task): New function. * doc/hurd.texi (Server Bootstrap): Update accordingly. * procfs/main.c: Do not hard-code kernel pid, use pids.h instead. --- hurd/process.defs | 6 +++++- hurd/process_reply.defs | 2 +- hurd/process_request.defs | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'hurd') diff --git a/hurd/process.defs b/hurd/process.defs index bf905564..498faba8 100644 --- a/hurd/process.defs +++ b/hurd/process.defs @@ -373,7 +373,11 @@ routine proc_getnports ( /*** Routines related to early server bootstrapping ***/ -skip; /* Reserved for proc_set_init_task */ +/* Set the task of process HURD_PID_INIT. Only the startup process + HURD_PID_STARTUP may use this interface. */ +routine proc_set_init_task ( + process: process_t; + task: task_t); /* Inform the process server that the process is important. */ routine proc_mark_important ( diff --git a/hurd/process_reply.defs b/hurd/process_reply.defs index ed46d55b..80454a6b 100644 --- a/hurd/process_reply.defs +++ b/hurd/process_reply.defs @@ -177,7 +177,7 @@ simpleroutine proc_getnports_reply ( /*** Routines related to early server bootstrapping ***/ -skip; /* Reserved for proc_set_init_task */ +skip; /* proc_set_init_task */ skip; /* proc_mark_important */ simpleroutine proc_is_important_reply ( diff --git a/hurd/process_request.defs b/hurd/process_request.defs index 38e71461..7565f03f 100644 --- a/hurd/process_request.defs +++ b/hurd/process_request.defs @@ -374,7 +374,12 @@ simpleroutine proc_getnports_request ( /*** Routines related to early server bootstrapping ***/ -skip; /* Reserved for proc_set_init_task */ +/* Set the task of process HURD_PID_INIT. Only the startup process + HURD_PID_STARTUP may use this interface. */ +simpleroutine proc_set_init_task_request ( + process: process_t; + ureplyport reply: reply_port_t; + task: task_t); /* Inform the process server that the process is important. */ simpleroutine proc_mark_important_request ( -- cgit v1.2.3