gdt - swap usermode CS & SS

This commit is contained in:
RaphProductions 2025-05-16 08:48:15 +02:00
parent b2ec036055
commit ca489e986a
4 changed files with 6 additions and 7 deletions

View file

@ -87,8 +87,8 @@ sched_process *sched_create(char *name, uint64_t entry_point, pagemap_t *pm,
proc->regs.cs = 0x28; // Run in kernel mode
proc->regs.ss = 0x30;
} else if (flags == SCHED_USER_PROCESS) {
proc->regs.cs = 0x38 | 3; // Run in user mode
proc->regs.ss = 0x40 | 3;
proc->regs.cs = 0x40 | 3; // Run in user mode
proc->regs.ss = 0x38 | 3;
}
proc->regs.rflags = 0x202; // Enable interrupts
proc->regs.rsp = (uint64_t)proc->stack_end;