diff options
Diffstat (limited to '')
-rw-r--r-- | kernel/cpu/idt.S | 3 | ||||
-rw-r--r-- | kernel/user.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/kernel/cpu/idt.S b/kernel/cpu/idt.S index 05f80c7..b3a8454 100644 --- a/kernel/cpu/idt.S +++ b/kernel/cpu/idt.S @@ -51,12 +51,12 @@ # segments popw %ax movw %ax, %gs + popw %ax movw %ax, %fs popw %ax movw %ax, %es popw %ax movw %ax, %ds - popw %ax # regs popq %r15 @@ -79,6 +79,7 @@ .macro ISRSave PUSHALL cld + movq %rsp, %rdi callq isr_save .endm diff --git a/kernel/user.c b/kernel/user.c index ce24b3e..8f626a7 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -175,13 +175,13 @@ static int user_setup_stack(struct pcb *pcb) // intruction pointer pcb->regs.rip = pcb->elf_header.e_entry; // code segment - pcb->regs.cs = 0x18 | 3; + pcb->regs.cs = USER_CODE | RING3; // rflags pcb->regs.rflags = (1 << 9); // stack pointer pcb->regs.rsp = USER_STACK_TOP; // stack segment - pcb->regs.ss = 0x20 | 3; + pcb->regs.ss = USER_DATA | RING3; return 0; } |