From 3ba3e98f6b74995b0508b69c5f8f3aee9f9714fb Mon Sep 17 00:00:00 2001 From: bdbrd Date: Sun, 9 Nov 2025 07:49:24 +0100 Subject: [PATCH] Need to rework malloc --- src/scheduler/sched.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scheduler/sched.c b/src/scheduler/sched.c index 6793968..ab0d4fe 100644 --- a/src/scheduler/sched.c +++ b/src/scheduler/sched.c @@ -35,15 +35,20 @@ proc *alloc_process(void){ kprintf("pstate = 0x{x}\n", READY); kprintf("actual: 0x{x}\n", p->state); p->kstack = kmalloc(INITIAL_STACK_SIZE); + kprintf("actua1l: 0x{x}\n", p->state); p->pid = next_pid++; + kprintf("actua2l: 0x{x}\n", p->state); + memset(&p->context, 0, sizeof(context)); + kprintf("actua3l: 0x{x}\n", p->state); + p->context.rbp = (uint64_t)p->kstack; p->context.rsp = (uint64_t)p->context.rbp + INITIAL_STACK_SIZE; - kprintf("actua2l: 0x{x}\n", p->state); + kprintf("actua4l: 0x{x}\n", p->state); return p; }