Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f259cc5 authored by H. Peter Anvin's avatar H. Peter Anvin
Browse files

x86 setup: set %ebx == %ebp == %edi == 0 on protected mode entry



In accordance with the newly formalized 32-bit boot protocol, set
%ebx == %ebp == %edi == 0 in order to support future extensions to the
protocol.

Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 7ed19290
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -28,11 +28,13 @@
 * void protected_mode_jump(u32 entrypoint, u32 bootparams);
 * void protected_mode_jump(u32 entrypoint, u32 bootparams);
 */
 */
protected_mode_jump:
protected_mode_jump:
	xorl	%ebx, %ebx		# Flag to indicate this is a boot
	movl	%edx, %esi		# Pointer to boot_params table
	movl	%edx, %esi		# Pointer to boot_params table
	movl	%eax, 2f		# Patch ljmpl instruction
	movl	%eax, 2f		# Patch ljmpl instruction


	movw	$__BOOT_DS, %cx
	movw	$__BOOT_DS, %cx
	xorl	%ebx, %ebx		# Per the 32-bit boot protocol
	xorl	%ebp, %ebp		# Per the 32-bit boot protocol
	xorl	%edi, %edi		# Per the 32-bit boot protocol


	movl	%cr0, %edx
	movl	%cr0, %edx
	orb	$1, %dl			# Protected mode (PE) bit
	orb	$1, %dl			# Protected mode (PE) bit