Move functions related to spawning the init process to a seperate module

This commit is contained in:
jiangjianfeng
2025-05-08 06:43:17 +00:00
committed by Ruihan Li
parent 50ba735e96
commit 89e8cd5936
11 changed files with 223 additions and 318 deletions

View File

@ -35,7 +35,7 @@ use ostd::{
boot::boot_info,
cpu::{CpuId, CpuSet, PinCurrentCpu},
};
use process::Process;
use process::{spawn_init_process, Process};
use sched::SchedPolicy;
use crate::{prelude::*, thread::kernel_thread::ThreadOptions};
@ -151,7 +151,7 @@ fn init_thread() {
let karg: KCmdlineArg = boot_info().kernel_cmdline.as_str().into();
let initproc = Process::spawn_user_process(
let initproc = spawn_init_process(
karg.get_initproc_path().unwrap(),
karg.get_initproc_argv().to_vec(),
karg.get_initproc_envp().to_vec(),