Skip to content

Commit

Permalink
x86 setup: set %ebx == %ebp == %edi == 0 on protected mode entry
Browse files Browse the repository at this point in the history
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: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
H. Peter Anvin committed Nov 5, 2007
1 parent 7ed1929 commit 9f259cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/x86/boot/pmjump.S
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
* void protected_mode_jump(u32 entrypoint, u32 bootparams);
*/
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

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
orb $1, %dl # Protected mode (PE) bit
Expand Down

0 comments on commit 9f259cc

Please sign in to comment.