aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/tasks/process.c
diff options
context:
space:
mode:
authorMarvin Borner2020-05-11 23:36:08 +0200
committerMarvin Borner2020-05-11 23:36:08 +0200
commitfa5aa82470783d20621f3d21e419f5b8ce70ad0a (patch)
tree03b175f47f918bcea522a1da2ce82f754e0e64a5 /src/kernel/tasks/process.c
parentfe4280eb69fbeb386b5442b3aeb515dde1c117ec (diff)
Fixed process name and added process tree print
Diffstat (limited to 'src/kernel/tasks/process.c')
-rw-r--r--src/kernel/tasks/process.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/kernel/tasks/process.c b/src/kernel/tasks/process.c
index a361355..2f45898 100644
--- a/src/kernel/tasks/process.c
+++ b/src/kernel/tasks/process.c
@@ -74,6 +74,21 @@ void process_init(struct process *proc)
userspace_enter(proc);
}
+// Only for debugging purposes
+void process_print_tree()
+{
+ serial_put('\n');
+ info("PROCESS TREE");
+ struct process *proc = root;
+
+ while (proc != NULL) {
+ info("%s with PID %d (state: %s)", proc->name, proc->pid,
+ proc->state == PROC_RUNNING ? "running" : "sleeping");
+ proc = proc->next;
+ }
+ serial_put('\n');
+}
+
u32 process_spawn(struct process *process)
{
debug("Spawning process %d", process->pid);
@@ -82,6 +97,7 @@ u32 process_spawn(struct process *process)
process->state = PROC_RUNNING;
process->parent = current_proc;
+ process_print_tree();
//process_suspend(current_proc->pid);