]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/ResetVector/Ia32/32FlatTo64Flat.asm
Add initial version of Open Virtual Machine Firmware (OVMF) platform.
[mirror_edk2.git] / OvmfPkg / ResetVector / Ia32 / 32FlatTo64Flat.asm
CommitLineData
49ba9447 1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2008, Intel Corporation\r
4; All rights reserved. This program and the accompanying materials\r
5; are licensed and made available under the terms and conditions of the BSD License\r
6; which accompanies this distribution. The full text of the license may be found at\r
7; http://opensource.org/licenses/bsd-license.php\r
8;\r
9; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11;\r
12; Module Name:\r
13;\r
14; 32FlatTo64Flat.asm\r
15;\r
16; Abstract:\r
17;\r
18; Transition from 32 bit flat protected mode into 64 bit flat protected mode\r
19;\r
20;------------------------------------------------------------------------------\r
21\r
22BITS 32\r
23\r
24Transition32FlatTo64Flat:\r
25\r
26 mov eax, ((ADDR_OF_START_OF_RESET_CODE & ~0xfff) - 0x1000)\r
27 mov cr3, eax\r
28\r
29 mov eax, cr4\r
30 bts eax, 5 ; enable PAE\r
31 mov cr4, eax \r
32\r
33 mov ecx, 0xc0000080\r
34 rdmsr\r
35 bts eax, 8 ; set LME\r
36 wrmsr\r
37\r
38 mov eax, cr0\r
39 bts eax, 31 ; set PG\r
40 mov cr0, eax ; enable paging\r
41\r
42 jmp LINEAR_CODE64_SEL:ADDR_OF(jumpTo64BitAndLandHere)\r
43BITS 64\r
44jumpTo64BitAndLandHere:\r
45\r
46 writeToSerialPort '6'\r
47 writeToSerialPort '4'\r
48 writeToSerialPort ' '\r
49\r
50 OneTimeCallRet Transition32FlatTo64Flat\r
51\r