Separate shell out of kernel.c