kmain is not guaranteed to be PID 1, causing shutdown to not work correctly
shutdown
sends SIGKILL to kmain using PID 1. However, kmain is not guaranteed to have PID 1. You can verify this by running the system multiple times and doing grep BSP sys:/log
, it shows e.g. Ok(ContextId(3)) about 50% of the time. There needs to be a mechanism to ensure kmain has PID 1, or shutdown
needs a way to determine the PID of kmain.