summaryrefslogtreecommitdiff
path: root/kernel/procs.c
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-25 11:36:23 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-25 11:36:23 -0400
commit16f5d0443aa072d977517be45dcf9b0d12f584b4 (patch)
treea673b4889b0d4f4c3a5d355cceb884e1cc0e57d1 /kernel/procs.c
parentfmt (diff)
downloadcomus-16f5d0443aa072d977517be45dcf9b0d12f584b4.tar.gz
comus-16f5d0443aa072d977517be45dcf9b0d12f584b4.tar.bz2
comus-16f5d0443aa072d977517be45dcf9b0d12f584b4.zip
load init from ata and run it
Diffstat (limited to 'kernel/procs.c')
-rw-r--r--kernel/procs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/procs.c b/kernel/procs.c
index 340739d..c1bcc4f 100644
--- a/kernel/procs.c
+++ b/kernel/procs.c
@@ -35,7 +35,7 @@ struct pcb *init_pcb = NULL;
struct pcb ptable[N_PROCS];
/// next avaliable pid
-pid_t next_pid = 0;
+pid_t next_pid = 1;
static struct pcb *find_prev_wakeup(pcb_queue_t queue, struct pcb *pcb)
{
@@ -119,6 +119,7 @@ int pcb_alloc(struct pcb **pcb)
if (pcb_queue_pop(pcb_freelist, &tmp) != SUCCESS)
return E_NO_PCBS;
+ tmp->pid = next_pid++;
*pcb = tmp;
return SUCCESS;
}