mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 08:37:17 -04:00
Fix usermode->kernelmode transition
This commit is contained in:
parent
e51a78eba1
commit
b085050fa5
@ -90,7 +90,8 @@ static_assert(sizeof(tss_descriptor_t) == 16, "TSS descriptor in long mode is 16
|
||||
|
||||
struct task_state_segment_t {
|
||||
uint32_t reserved_0;
|
||||
uint64_t rsp0;
|
||||
uint32_t rsp0_low;
|
||||
uint32_t rsp0_high;
|
||||
uint64_t rsp1;
|
||||
uint64_t rsp2;
|
||||
uint64_t reserved_1;
|
||||
|
@ -154,7 +154,7 @@ void install_irqs(){
|
||||
}
|
||||
|
||||
void install_syscalls(){
|
||||
idt_set_gate(interrupt::SYSCALL_FIRST, _syscall0, gdt::LONG_SELECTOR, 0xEE);
|
||||
idt_set_gate(interrupt::SYSCALL_FIRST+0, _syscall0, gdt::LONG_SELECTOR, 0xEE);
|
||||
idt_set_gate(interrupt::SYSCALL_FIRST+1, _syscall1, gdt::LONG_SELECTOR, 0xEE);
|
||||
idt_set_gate(interrupt::SYSCALL_FIRST+2, _syscall2, gdt::LONG_SELECTOR, 0xEE);
|
||||
idt_set_gate(interrupt::SYSCALL_FIRST+3, _syscall3, gdt::LONG_SELECTOR, 0xEE);
|
||||
|
@ -913,7 +913,8 @@ void exec_command(const std::vector<std::string>& params){
|
||||
if(stack_physical){
|
||||
uint64_t rsp;
|
||||
asm volatile("mov %0, rsp;" : "=m" (rsp));
|
||||
gdt::tss.rsp0 = rsp;
|
||||
gdt::tss.rsp0_low = rsp;
|
||||
gdt::tss.rsp0_high = rsp >> 32;
|
||||
|
||||
asm volatile("mov ax, %0; mov ds, ax; mov es, ax; mov fs, ax; mov gs, ax;"
|
||||
: //No outputs
|
||||
|
Loading…
x
Reference in New Issue
Block a user