diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 100b268..ccf4960 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -418,9 +418,6 @@ grub_linux_boot (void) /* Hardware interrupts are not safe any longer. */ asm volatile ("cli" : : ); - /* Load the IDT and the GDT for the bootstrap. */ - asm volatile ("lidt %0" : : "m" (idt_desc)); - asm volatile ("lgdt %0" : : "m" (gdt_desc)); #ifdef __x86_64__ @@ -430,10 +427,19 @@ grub_linux_boot (void) asm volatile ( "mov %0, %%rbx" : : "m" (params->code32_start)); asm volatile ( "mov %0, %%rsi" : : "m" (real_mode_mem)); + /* Load the IDT and the GDT for the bootstrap. */ + asm volatile ("lidt %0" : : "m" (idt_desc)); + asm volatile ("lgdt %0" : : "m" (gdt_desc)); + asm volatile ( "ljmp *%0" : : "m" (jumpvector)); #else + /* Load the IDT and the GDT for the bootstrap. */ + asm volatile ("lidt %0" : : "m" (idt_desc)); + asm volatile ("lgdt %0" : : "m" (gdt_desc)); + + /* Pass parameters. */ asm volatile ("movl %0, %%ecx" : : "m" (params->code32_start)); asm volatile ("movl %0, %%esi" : : "m" (real_mode_mem));