From 146c35ddf493623561c261795610a9b5573834fd Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Sun, 12 Mar 2017 16:36:48 +0100 Subject: kern: Make kernel task available to bootscript. * kern/bootstrap.c (bootstrap_create): Insert the variable 'kernel-task' into the bootscript environment. Userspace can use this instead of guessing based on the order of the first tasks. --- kern/bootstrap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kern/bootstrap.c b/kern/bootstrap.c index 7398ea44..c21d3b1c 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -180,6 +180,12 @@ void bootstrap_create(void) if (losers) panic ("cannot set boot-script variable device-port: %s", boot_script_error_string (losers)); + losers = boot_script_set_variable + ("kernel-task", VAL_PORT, + (long) kernel_task->itk_self); + if (losers) + panic ("cannot set boot-script variable kernel-task: %s", + boot_script_error_string (losers)); losers = boot_script_set_variable ("kernel-command-line", VAL_STR, (long) kernel_cmdline); -- cgit v1.2.3