1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
5 ; This program and the accompanying materials
6 ; are licensed and made available under the terms and conditions of the BSD License
7 ; which accompanies this distribution. The full text of the license may be found at
8 ; http://opensource.org/licenses/bsd-license.php.
10 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 ;------------------------------------------------------------------------------
17 ;------------------------------------------------------------------------------
21 ; VOID *KernelStart, // rcx
22 ; VOID *KernelBootParams // rdx
24 ;------------------------------------------------------------------------------
27 ; Set up for executing kernel. BP in %esi, entry point on the stack
28 ; (64-bit when the 'ret' will use it as 32-bit, but we're little-endian)
32 ; Jump into the compatibility mode CS
39 ; Now in compatibility mode.
41 DB 0b8h, 018h, 000h, 000h, 000h ; movl $0x18, %eax
42 DB 08eh, 0d8h ; movl %eax, %ds
43 DB 08eh, 0c0h ; movl %eax, %es
44 DB 08eh, 0e0h ; movl %eax, %fs
45 DB 08eh, 0e8h ; movl %eax, %gs
46 DB 08eh, 0d0h ; movl %eax, %ss
49 DB 00fh, 020h, 0c0h ; movl %cr0, %eax
50 DB 00fh, 0bah, 0f8h, 01fh ; btcl $31, %eax
51 DB 00fh, 022h, 0c0h ; movl %eax, %cr0
53 ; Disable long mode in EFER
54 DB 0b9h, 080h, 000h, 000h, 0c0h ; movl $0x0c0000080, %ecx
56 DB 00fh, 0bah, 0f8h, 008h ; btcl $8, %eax
60 DB 00fh, 020h, 0e0h ; movl %cr4, %eax
61 DB 00fh, 0bah, 0f8h, 005h ; btcl $5, %eax
62 DB 00fh, 022h, 0e0h ; movl %eax, %cr4
64 DB 031h, 0edh ; xor %ebp, %ebp
65 DB 031h, 0ffh ; xor %edi, %edi
66 DB 031h, 0dbh ; xor %ebx, %ebx
71 ;------------------------------------------------------------------------------
75 ; EFI_HANDLE ImageHandle, // rcx
76 ; EFI_SYSTEM_TABLE *SystemTable, // rdx
77 ; VOID *KernelBootParams // r8
78 ; VOID *KernelStart, // r9
80 ;------------------------------------------------------------------------------