diff --git a/repos/base-hw/src/bootstrap/spec/x86_64/crt0.s b/repos/base-hw/src/bootstrap/spec/x86_64/crt0.s index c9e2db091..592c30b54 100644 --- a/repos/base-hw/src/bootstrap/spec/x86_64/crt0.s +++ b/repos/base-hw/src/bootstrap/spec/x86_64/crt0.s @@ -91,12 +91,10 @@ _start64: /* - * Set up kernel segment selectors + * Set up segment selectors fs and gs to zero + * ignore ss, cs and ds because they are ignored by hardware in long mode */ - mov $0x10, %eax - mov %eax, %ss - mov %eax, %ds - mov %eax, %es + mov $0x0, %eax mov %eax, %fs mov %eax, %gs diff --git a/repos/base-hw/src/core/spec/x86_64/mode_transition.s b/repos/base-hw/src/core/spec/x86_64/mode_transition.s index f3857c6d4..71e794b2e 100644 --- a/repos/base-hw/src/core/spec/x86_64/mode_transition.s +++ b/repos/base-hw/src/core/spec/x86_64/mode_transition.s @@ -181,14 +181,6 @@ pushq %r9 pushq %r8 - /* Restore kernel segment registers */ - mov $0x10, %rbx - mov %rbx, %ss - mov %rbx, %ds - mov %rbx, %es - mov %rbx, %fs - mov %rbx, %gs - /* Restore register values from kernel context */ mov $_mt_master_context_begin+R8_OFFSET, %rsp popq %r8 @@ -224,13 +216,6 @@ pushq $0x1b pushq (%rax) - /* Restore segment registers */ - mov $0x23, %rbx - mov %rbx, %ds - mov %rbx, %es - mov %rbx, %fs - mov %rbx, %gs - /* Restore register values from client context */ lea R8_OFFSET(%rax), %rsp popq %r8