From 23e8e654d95712822e77d5841e88edc20d3233bf Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 24 Dec 2022 21:11:43 +0000 Subject: [PATCH] Changed jump label in gdt_load --- arch/x86_64/gdt_load.S | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86_64/gdt_load.S b/arch/x86_64/gdt_load.S index dc57492..6f102d7 100644 --- a/arch/x86_64/gdt_load.S +++ b/arch/x86_64/gdt_load.S @@ -3,6 +3,10 @@ .global gdt_load .type gdt_load, @function +# gdt_load(struct gdt_ptr *gdtp) +# Loads GDTR with the specified GDT pointer. +# Expects entries 1 and 2 (offsets 0x08 and 0x10) to be kernel +# code and kernel data respectively. gdt_load: pushq %rbp movq %rsp, %rbp @@ -16,13 +20,13 @@ gdt_load: mov %ax, %fs mov %ax, %gs - movabsq $(gdt_load2), %rax + movabsq $(1f), %rax push $0x08 push %rax lretq -gdt_load2: +1: popq %rbp ret