summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/ResetVector/Ia16
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-16 23:29:15 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-16 23:29:15 +0000
commit7a55c43b072ec2192d35df5e44cf37eb8be06555 (patch)
tree0ffb3051583b198fa8b07a670a0fed8906221dad /OvmfPkg/ResetVector/Ia16
parent8861fc792ce90cb7ab18a91bd3d6596d77ee0170 (diff)
downloadedk2-7a55c43b072ec2192d35df5e44cf37eb8be06555.tar.gz
edk2-7a55c43b072ec2192d35df5e44cf37eb8be06555.tar.bz2
edk2-7a55c43b072ec2192d35df5e44cf37eb8be06555.zip
OVMF ResetVector: Modify interface with SEC module
Previously it was: ESI/RSI - SEC Core entry point EDI/RDI - PEI Core entry point EBP/RBP - Start of BFV Now it is: RAX/EAX Initial value of the EAX register (BIST: Built-in Self Test) DI 'BP': boot-strap processor, or 'AP': application processor RBP/EBP Address of Boot Firmware Volume (BFV) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9571 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/ResetVector/Ia16')
-rw-r--r--OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm137
-rw-r--r--OvmfPkg/ResetVector/Ia16/Init16.asm48
-rw-r--r--OvmfPkg/ResetVector/Ia16/ResetVectorOldTools.asm51
-rw-r--r--OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm43
4 files changed, 134 insertions, 145 deletions
diff --git a/OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm b/OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm
index d030c0b52b..47e3c6d929 100644
--- a/OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm
+++ b/OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm
@@ -1,6 +1,8 @@
;------------------------------------------------------------------------------
+; @file
+; Transition from 16 bit real mode into 32 bit flat protected mode
;
-; Copyright (c) 2008, Intel Corporation
+; Copyright (c) 2008 - 2009, Intel Corporation
; All rights reserved. This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
@@ -9,14 +11,6 @@
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
-; Module Name:
-;
-; 16RealTo32Flat.asm
-;
-; Abstract:
-;
-; Transition from 16 bit real mode into 32 bit flat protected mode
-;
;------------------------------------------------------------------------------
%define SEC_DEFAULT_CR0 0x40000023
@@ -24,11 +18,12 @@
BITS 16
-to32BitFlat:
+;
+; Modified: EAX, EBX
+;
+TransitionFromReal16To32BitFlat:
- writeToSerialPort '1'
- writeToSerialPort '6'
- writeToSerialPort ' '
+ debugShowPostCode POSTCODE_16BIT_MODE
cli
@@ -42,10 +37,6 @@ o32 lgdt [bx]
mov eax, SEC_DEFAULT_CR0
mov cr0, eax
-; mov eax, cr0
-; or al, 1
-; mov cr0, eax
-
jmp LINEAR_CODE_SEL:dword ADDR_OF(jumpTo32BitAndLandHere)
BITS 32
jumpTo32BitAndLandHere:
@@ -53,18 +44,16 @@ jumpTo32BitAndLandHere:
mov eax, SEC_DEFAULT_CR4
mov cr4, eax
- writeToSerialPort '3'
- writeToSerialPort '2'
- writeToSerialPort ' '
+ debugShowPostCode POSTCODE_32BIT_MODE
- mov ax, LINEAR_SEL
- mov ds, ax
- mov es, ax
- mov fs, ax
- mov gs, ax
- mov ss, ax
+ mov ax, LINEAR_SEL
+ mov ds, ax
+ mov es, ax
+ mov fs, ax
+ mov gs, ax
+ mov ss, ax
- jmp TransitionFrom16RealTo32FlatComplete
+ OneTimeCallRet TransitionFromReal16To32BitFlat
ALIGN 2
@@ -77,75 +66,75 @@ ALIGN 16
GDT_BASE:
; null descriptor
NULL_SEL equ $-GDT_BASE
- dw 0 ; limit 15:0
- dw 0 ; base 15:0
- db 0 ; base 23:16
- db 0 ; type
- db 0 ; limit 19:16, flags
- db 0 ; base 31:24
+ dw 0 ; limit 15:0
+ dw 0 ; base 15:0
+ db 0 ; base 23:16
+ db 0 ; type
+ db 0 ; limit 19:16, flags
+ db 0 ; base 31:24
; linear data segment descriptor
LINEAR_SEL equ $-GDT_BASE
- dw 0FFFFh ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 092h ; present, ring 0, data, expand-up, writable
- db 0CFh ; page-granular, 32-bit
- db 0
+ dw 0FFFFh ; limit 0xFFFFF
+ dw 0 ; base 0
+ db 0
+ db 092h ; present, ring 0, data, expand-up, writable
+ db 0CFh ; page-granular, 32-bit
+ db 0
; linear code segment descriptor
LINEAR_CODE_SEL equ $-GDT_BASE
- dw 0FFFFh ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 09Ah ; present, ring 0, data, expand-up, writable
- db 0CFh ; page-granular, 32-bit
- db 0
+ dw 0FFFFh ; limit 0xFFFFF
+ dw 0 ; base 0
+ db 0
+ db 09Ah ; present, ring 0, data, expand-up, writable
+ db 0CFh ; page-granular, 32-bit
+ db 0
; system data segment descriptor
SYS_DATA_SEL equ $-GDT_BASE
- dw 0FFFFh ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 092h ; present, ring 0, data, expand-up, writable
- db 0CFh ; page-granular, 32-bit
- db 0
+ dw 0FFFFh ; limit 0xFFFFF
+ dw 0 ; base 0
+ db 0
+ db 092h ; present, ring 0, data, expand-up, writable
+ db 0CFh ; page-granular, 32-bit
+ db 0
; system code segment descriptor
SYS_CODE_SEL equ $-GDT_BASE
- dw 0FFFFh ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 09Ah ; present, ring 0, data, expand-up, writable
- db 0CFh ; page-granular, 32-bit
- db 0
+ dw 0FFFFh ; limit 0xFFFFF
+ dw 0 ; base 0
+ db 0
+ db 09Ah ; present, ring 0, data, expand-up, writable
+ db 0CFh ; page-granular, 32-bit
+ db 0
; spare segment descriptor
LINEAR_CODE64_SEL equ $-GDT_BASE
- DW -1 ; LimitLow
- DW 0 ; BaseLow
- DB 0 ; BaseMid
+ DW -1 ; LimitLow
+ DW 0 ; BaseLow
+ DB 0 ; BaseMid
DB 9bh
- DB 0afh ; LimitHigh (CS.L=1, CS.D=0)
- DB 0 ; BaseHigh
+ DB 0afh ; LimitHigh (CS.L=1, CS.D=0)
+ DB 0 ; BaseHigh
; spare segment descriptor
SPARE4_SEL equ $-GDT_BASE
- dw 0 ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 0 ; present, ring 0, data, expand-up, writable
- db 0 ; page-granular, 32-bit
- db 0
+ dw 0 ; limit 0xFFFFF
+ dw 0 ; base 0
+ db 0
+ db 0 ; present, ring 0, data, expand-up, writable
+ db 0 ; page-granular, 32-bit
+ db 0
; spare segment descriptor
SPARE5_SEL equ $-GDT_BASE
- dw 0 ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 0 ; present, ring 0, data, expand-up, writable
- db 0 ; page-granular, 32-bit
- db 0
+ dw 0 ; limit 0xFFFFF
+ dw 0 ; base 0
+ db 0
+ db 0 ; present, ring 0, data, expand-up, writable
+ db 0 ; page-granular, 32-bit
+ db 0
GDT_END:
diff --git a/OvmfPkg/ResetVector/Ia16/Init16.asm b/OvmfPkg/ResetVector/Ia16/Init16.asm
new file mode 100644
index 0000000000..3d3d8b0267
--- /dev/null
+++ b/OvmfPkg/ResetVector/Ia16/Init16.asm
@@ -0,0 +1,48 @@
+;------------------------------------------------------------------------------
+; @file
+; 16-bit initialization code
+;
+; Copyright (c) 2008 - 2009, Intel Corporation
+; All rights reserved. This program and the accompanying materials
+; are licensed and made available under the terms and conditions of the BSD License
+; which accompanies this distribution. The full text of the license may be found at
+; http://opensource.org/licenses/bsd-license.php
+;
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+;
+;------------------------------------------------------------------------------
+
+
+BITS 16
+
+;
+; @param[out] DI 'BP' to indicate boot-strap processor
+;
+EarlyBspInitReal16:
+ mov di, 'BP'
+ jmp short Main16
+
+;
+; @param[out] DI 'AP' to indicate application processor
+;
+EarlyApInitReal16:
+ mov di, 'AP'
+ jmp short Main16
+
+;
+; Modified: EAX
+;
+; @param[in] EAX Initial value of the EAX register (BIST: Built-in Self Test)
+; @param[out] ESP Initial value of the EAX register (BIST: Built-in Self Test)
+;
+EarlyInit16:
+ ;
+ ; ESP - Initial value of the EAX register (BIST: Built-in Self Test)
+ ;
+ mov esp, eax
+
+ debugInitialize
+
+ OneTimeCallRet EarlyInit16
+
diff --git a/OvmfPkg/ResetVector/Ia16/ResetVectorOldTools.asm b/OvmfPkg/ResetVector/Ia16/ResetVectorOldTools.asm
deleted file mode 100644
index 75e259b0b6..0000000000
--- a/OvmfPkg/ResetVector/Ia16/ResetVectorOldTools.asm
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2008, Intel Corporation
-; All rights reserved. This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Reset-16Bit-old-tools.asm
-;
-; Abstract:
-;
-; First code exectuted by processor after resetting.
-;
-;------------------------------------------------------------------------------
-
-BITS 16
-
-earlyInit_Real16:
-
- jmp real16InitSerialPort
-real16SerialPortInitReturn:
-
- jmp to32BitFlat
-
-ALIGN 16
-
-;
-; Junk data. Old GenFv tool will modify data here.
-;
- DQ 0, 0
-
-;
-; Reset Vector
-;
-; This is where the processor will begin execution
-;
- jmp short earlyInit_Real16
-
-;
-; Junk data. Old GenFv tool will modify data here.
-;
-ALIGN 16
-
-fourGigabytes:
-
diff --git a/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm b/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
index 63aeaf6b24..0eff743183 100644
--- a/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
+++ b/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
@@ -1,6 +1,8 @@
;------------------------------------------------------------------------------
+; @file
+; First code exectuted by processor after resetting.
;
-; Copyright (c) 2008, Intel Corporation
+; Copyright (c) 2008 - 2009, Intel Corporation
; All rights reserved. This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
@@ -9,28 +11,25 @@
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
-; Module Name:
-;
-; Reset-16Bit-vft0.asm
-;
-; Abstract:
-;
-; First code exectuted by processor after resetting.
-;
;------------------------------------------------------------------------------
-BITS 16
-
-earlyInit_Real16:
+BITS 16
- jmp real16InitSerialPort
-real16SerialPortInitReturn:
+ALIGN 16
- jmp to32BitFlat
+applicationProcessorEntryPoint:
+;
+; Application Processors entry point
+;
+; GenFv generates code aligned on a 4k boundary which will jump to this
+; location. (0xffffffe0) This allows the Local APIC Startup IPI to be
+; used to wake up the application processors.
+;
+ jmp short EarlyApInitReal16
-ALIGN 16
+ALIGN 8
- DD 0, 0, 0
+ DD 0
;
; The VTF signature
@@ -39,16 +38,20 @@ ALIGN 16
; any fixups.
;
vtfSignature:
- DB 'V', 'T', 'F', 0
+ DB 'V', 'T', 'F', 0
+
+ALIGN 16
+resetVector:
;
; Reset Vector
;
; This is where the processor will begin execution
;
- jmp short earlyInit_Real16
+ wbinvd
+ jmp short EarlyBspInitReal16
-ALIGN 16
+ALIGN 16
fourGigabytes: