Per-cpu kernel pseudo process

This commit is contained in:
2026-03-11 17:47:12 +01:00
parent f1268ec1ba
commit e765855309
10 changed files with 89 additions and 33 deletions

View File

@@ -57,6 +57,11 @@ void bootmain (void) {
ioapic_init ();
hpet_init ();
proc_pid_alloc_init ();
procgroup_pgid_alloc_init ();
bsp_cpu->kproc = kproc_create ();
devices_init ();
vfs_init ();
@@ -66,9 +71,6 @@ void bootmain (void) {
struct device* temp0 = device_find ("TEMP0");
vfs_create_volume ("TEMP", FS_FAT16, temp0, true);
proc_pid_alloc_init ();
procgroup_pgid_alloc_init ();
smp_init ();
proc_init ();

View File

@@ -102,10 +102,12 @@ static void smp_bootstrap (struct limine_mp_info* mp_info) {
atomic_fetch_sub (&cpu_counter, 1);
cpu->kproc = kproc_create ();
struct reschedule_ctx rctx;
memset (&rctx, 0, sizeof (rctx));
struct proc* spin_proc = proc_from_file (VFS_KERNEL, "RD", "/spin", &rctx);
struct proc* spin_proc = proc_from_file (thiscpu->kproc, "RD", "/spin", &rctx);
proc_register (spin_proc, thiscpu, &rctx);
spin_lock (&spin_proc->cpu->lock);

View File

@@ -33,6 +33,7 @@ struct cpu {
struct list_node_link* proc_run_q;
struct proc* proc_current;
int proc_run_q_count;
struct proc* kproc;
};
struct cpu* cpu_make (uint64_t lapic_id, uint64_t acpi_id);