diff --git a/kernel/src/arch/x86_64/Thread.cpp b/kernel/src/arch/x86_64/Thread.cpp index b9b76d59..042ef119 100644 --- a/kernel/src/arch/x86_64/Thread.cpp +++ b/kernel/src/arch/x86_64/Thread.cpp @@ -34,6 +34,14 @@ void Thread::init_regs_kernel() regs.rflags = 1 << 9; // IF (Interrupt enable flag) } +void Thread::init_regs_user() +{ + memset(®s, 0, sizeof(Registers)); + regs.cs = 0x18 | 3; + regs.ss = 0x20 | 3; + regs.rflags = 1 << 9; // IF (Interrupt enable flag) +} + void Thread::set_arguments(u64 arg1, u64 arg2, u64 arg3, u64 arg4) { regs.rdi = arg1;