FORKgit add .git add .!

This commit is contained in:
2026-07-08 19:11:39 -05:00
parent e42ee8eb85
commit ec3cbb4794
10 changed files with 146 additions and 105 deletions

View File

@@ -124,7 +124,6 @@ static int32_t sys_pty(int* slave_fd) {
static int32_t sys_fork(registers_t* parent_regs) {
process_t* parent = current_task();
process_t* child = kalloc(sizeof(process_t));
if (!child) {
return -1;
@@ -149,11 +148,8 @@ static int32_t sys_fork(registers_t* parent_regs) {
child_regs->eax = 0;
child->esp = (uint32_t)child_regs;
kprintf("child registers for PID %d\n", child->pid);
kprintf("\tEIP: 0x%x\n", child_regs->eip);
// uint32_t cr3 = (uint32_t)clone_task_pd();
child->cr3 = parent->cr3;
uint32_t cr3 = (uint32_t)clone_current_pd();
child->cr3 = cr3;
add_task(child);
return child->pid;