summaryrefslogtreecommitdiff
path: root/src/kernel/proc.c
diff options
context:
space:
mode:
authordzwdz2021-08-18 19:51:42 +0200
committerdzwdz2021-08-18 19:51:42 +0200
commit4ca728bb28bb9d1066320555233c94fdc5d75e58 (patch)
tree6d3a249bf8b3a23404c12906a311498a6bfb06c4 /src/kernel/proc.c
parent6a824d3a2184c6f9929dabf55930bd48fcb54323 (diff)
processes now store a PID for debugging purposes
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r--src/kernel/proc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c
index eea651f..eb36caf 100644
--- a/src/kernel/proc.c
+++ b/src/kernel/proc.c
@@ -6,6 +6,7 @@
struct process *process_first;
struct process *process_current;
+uint32_t next_pid = 0;
struct process *process_seed() {
struct process *proc = kmalloc(sizeof(struct process));
@@ -14,6 +15,7 @@ struct process *process_seed() {
proc->sibling = NULL;
proc->child = NULL;
proc->parent = NULL;
+ proc->id = next_pid++;
process_first = proc;
@@ -41,6 +43,8 @@ struct process *process_fork(struct process *parent) {
child->parent = parent;
parent->child = child;
+ child->id = next_pid++;
+
return child;
}