wip: allocate user process stack on the right PD

This commit is contained in:
0x35c
2025-11-28 19:16:32 +01:00
parent f9cb7a6a8a
commit 700864cbf2
3 changed files with 9 additions and 3 deletions

View File

@ -24,8 +24,9 @@ struct pcb *create_process(uid_t uid)
}
new_pcb->cr3 =
(void *)((uint32_t)VA2PTE((uint32_t)new_pcb->heap) & PAGE_MASK);
memcpy(new_pcb->heap, PD, 4096);
new_pcb->heap[1023] = (uint32_t) new_pcb->cr3 | INIT_FLAGS;
memcpy(new_pcb->heap, PD,
4096); // TODO optimize to copy only used bytes
new_pcb->heap[1023] = (uint32_t)new_pcb->cr3 | INIT_FLAGS;
new_pcb->daddy = NULL;
new_pcb->children = NULL;