Skip to main content

create_system_task

Function create_system_task 

Source
pub fn create_system_task(kernel: &Arc<Kernel>) -> Result<CurrentTask, Errno>
Expand description

Creates the kthreadd system task that runs inside the kernel.

There is no underlying Zircon process to host the task. Instead, the work done by this task is performed by a thread in the original Starnix process, possibly as part of a thread pool.

The task is initialized with a temporary bootstrap "rootfs" TmpFs intended to be replaced with the container’s root filesystem via FsContext::replace_bootstrap_namespace during kernel boot.

This function should only be called during kernel initialization to set up kthreads. To do background work inside the kernel after boot, use kthreads, which provides both the system task and a threadpool on which it can do work.