diff --git a/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S index 2e55923..97cf407 100644 --- a/arch/x86/boot/pmjump.S +++ b/arch/x86/boot/pmjump.S @@ -30,7 +30,6 @@ protected_mode_jump: xorl %ebx, %ebx # Flag to indicate this is a boot movl %edx, %esi # Pointer to boot_params table - movl %eax, 2f # Patch ljmpl instruction jmp 1f # Short jump to flush instruction q. 1: @@ -39,16 +38,17 @@ protected_mode_jump: movl %cr0, %edx orb $1, %dl # Protected mode (PE) bit movl %edx, %cr0 + ljmpw __BOOT_CS, 2f - movw %cx, %ds - movw %cx, %es - movw %cx, %fs - movw %cx, %gs - movw %cx, %ss + .code32 +2: + movl %ecx, %ds + movl %ecx, %es + movl %ecx, %fs + movl %ecx, %gs + movl %ecx, %ss # Jump to the 32-bit entrypoint - .byte 0x66, 0xea # ljmpl opcode -2: .long 0 # offset - .word __BOOT_CS # segment - + jmpl %eax + .size protected_mode_jump, .-protected_mode_jump