From 3a4b9eba07e5cd1866842b0173fac93ffdb931e9 Mon Sep 17 00:00:00 2001 From: rsun3 Date: Wed, 16 Nov 2011 09:38:12 +0000 Subject: [PATCH] DuetPkg BootSector: Update start.asm(S)/start16.asm(S)/start32.asm(S)/efi32.asm(S) under DuetPkg\BootSector to follow the IA32 recommendations on switching to protected mode: Immediately following the MOV CR0 instruction, execute a far JMP or far CALL instruction. (This operation is typically a far jump or call to the next instruction in the instruction stream.) Signed-off-by: rsun3 Reviewed-by: niruiyu git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12723 6f19259b-4bc3-4df7-8a09-765794883524 --- DuetPkg/BootSector/BootSector.inf | 18 +++++++++++++++++- DuetPkg/BootSector/bin/Start.com | Bin 4096 -> 4096 bytes DuetPkg/BootSector/bin/Start16.com | Bin 4096 -> 4096 bytes DuetPkg/BootSector/bin/Start32.com | Bin 4096 -> 4096 bytes DuetPkg/BootSector/bin/efi32.com | Bin 139264 -> 139264 bytes DuetPkg/BootSector/bin/efi32.com2 | Bin 4096 -> 4096 bytes DuetPkg/BootSector/efi32.S | 3 ++- DuetPkg/BootSector/efi32.asm | 3 ++- DuetPkg/BootSector/start.S | 8 ++------ DuetPkg/BootSector/start.asm | 9 ++------- DuetPkg/BootSector/start16.S | 9 ++------- DuetPkg/BootSector/start16.asm | 9 ++------- DuetPkg/BootSector/start32.S | 9 ++------- DuetPkg/BootSector/start32.asm | 9 ++------- 14 files changed, 33 insertions(+), 44 deletions(-) diff --git a/DuetPkg/BootSector/BootSector.inf b/DuetPkg/BootSector/BootSector.inf index c443ebb6ef..49f69eb66e 100644 --- a/DuetPkg/BootSector/BootSector.inf +++ b/DuetPkg/BootSector/BootSector.inf @@ -1,6 +1,6 @@ ## @file # -# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2011, 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 @@ -61,3 +61,19 @@ efi32.asm | MSFT efi32.S | GCC + start64.asm | INTEL + start64.asm | MSFT + start64.S | GCC + + st16_64.asm | INTEL + st16_64.asm | MSFT + st16_64.S | GCC + + st32_64.asm | INTEL + st32_64.asm | MSFT + st32_64.S | GCC + + efi64.asm | INTEL + efi64.asm | MSFT + efi64.S | GCC + diff --git a/DuetPkg/BootSector/bin/Start.com b/DuetPkg/BootSector/bin/Start.com index adc5a3d0cf52bc908ece2f15ece86af13e1f5dac..0fd19a14a90931cf3717ea013335f788652f7f2c 100644 GIT binary patch delta 183 zcmZorXi(T-#l$Ew*_uhMUW7eO`$t-*odA29@$H_|X$K#(q^I>ZGchwTq%Ho(1Y&!D z*)GgL_GAHepm^h91_2<|Dff~I#_s;SgHh$IXtCT2Ylc$E=WjP$e3tUUfT5Ic!~JIo zFVq=!N-{iu`{>VZ4u)T8{ET9Mn1H056EnYz!T}yeex(CxuNWAZfTr$b0IGYEqQdmx V$KeT^xtOoZ3otV7y z>>v<(vK%{5yzwxD0FdgG`@sZbcYof&sB%`cSnh=vL#gERw;L`#OL<|>P|COA{;uXG@72L}VtyuAzz4h(6#85r0Z(q1tz dFaa&u$pF;$Bt?bk!H>h6|1e$Snf!oX0RY&#Lhb+n diff --git a/DuetPkg/BootSector/bin/Start16.com b/DuetPkg/BootSector/bin/Start16.com index 34e5dca6dbfed6ece0d4b679decdb14a59c9f73f..b2d77c1262d63c51d214b2843a55bc0f4a990f27 100644 GIT binary patch delta 183 zcmZorXi(T-#l$Ew*_uhMUW7eO`$t-*odA29@$H_|X$K#(q^I>ZGchwTq%Ho(1Y&!D z*)GgL_GAHepm^h91_2<|Dff~I#_s;SgHh$IXtCT2Ylc$E=WjP$e3tUUfT5Ic!~JIo zFVq=!N-{iu`{>VZ4u)T8{ET9Mn1H056EnYz!T}yeex(CxuNWAZfTr$b0IGYEqQdmx V$KeT^xtOoZ3otV7y z>>v<(vK%{5yzwxD0FdgG`@sZbcYof&sB%`cSnh=vL#gERw;L`#OL<|>P|COA{;uXG@72L}VtyuAzz4h(6#85r0Z(q1tz dFaa&u$pF;$Bt?bk!H>h6|1e$Snf!oX0RY&#Lhb+n diff --git a/DuetPkg/BootSector/bin/Start32.com b/DuetPkg/BootSector/bin/Start32.com index 47f2f5d43521801e86f80a8a53fed5b1050ceac0..ac0e3cb20bb57d11e34c4be5d106a46d302a40a7 100644 GIT binary patch delta 182 zcmZorXi(T-#l$Ew*_uhMUW7eO`$t-*odA29@$H_|X$K#(q^I>ZGchwTq%Ho(1Y&!D z*)GgL_GAHepm^h91_2<|Dff~I#_s;SgHh$IXtCT2Ylc$E=WjP$e3tUUfT5Ic!~JIo zFVq=!N-{iu`{>VZ4u)T8{ET9Mn1H056EnYz!T}yeex(CxuNWAZfTr$b0IGYEqQdmx U$KeT^xtOoZ3otV7y z>>v<(vK%{5yzwxD0FdgG`@sZbcYof&sB%`cSnh=vL#gERw;L`#OL<|>P|COA{;uXG@72L}VtyuAzz4h(6#85r0Z(q1tz dFaa&u$pF;$Bt?bk!H>h6|1e$Snf!oX0RY&#Lhb+n diff --git a/DuetPkg/BootSector/bin/efi32.com b/DuetPkg/BootSector/bin/efi32.com index 7c982e0ba7c344fd595d189e98bcf7eb93d9939f..4bcd83e2ac698481d871dfeaf80287148c5dc2b6 100644 GIT binary patch delta 436 zcmW;IKS%;`6u|L!&p${S{UFa2B_x8V$wDfG$cPIX0)=X7sHO&&kf<&DGX%FtkPeMC z1r3FyHQZ$`4Gz`Rl#UOY+N`PfesEvj{XX~O$K92l10}vrjT#yX?N&vhnYi}@3>f{p zF@#1#A=sZyQjZ4!;1sKq3NyxCwV*I<%8snZSLBh)H9%z{*DBX*3KzWdzYzqwFaT^T zdD0u)4>h~!`-t*ssqeV+BsXu==I3WihW*kcFS)Yt(-seBq?$G{d6?ppX_~>!9tFXf zlI0jLZ7V@3**7C%YEd*SGAH8E5~YyHqR0=wy={f*PrhPVq@!h&h^O0?4#kILF auE+K9pBd*eT%Id%$6Tczk737;Yd8P4mvTw~ delta 409 zcmW-cKS%;$6u{p-{~%=eL7pjv=Ta>Z2Z>ZmIyf{O96{g^O>wk@G}RPFZOTDH+|ba{ z6ch!b25~AbPEnh*9|i1 z?|%l!yD&gZ8{bVKv>O7UI_ybte*ge}*~g`Jf%E#kl<8U5nnWj)^sk69biq%4bfjvuP?5ksUTA zHkZl-z6JQlL)hfNfZd1*d+Fd8gW4kh!^6M2-D#+M2@hC T9paFvw~Q3NhEGKhH?IBxu&``; diff --git a/DuetPkg/BootSector/bin/efi32.com2 b/DuetPkg/BootSector/bin/efi32.com2 index d4bae935cb15badaf08e65181d433807f9609932..05522eccc56015ebc042d75c41b7bc7c66680a4b 100644 GIT binary patch delta 417 zcmW-dF-SsD6o${c>Z8)=L0X0qj|ieB3#kwyBVN!DC{$BJHAI6;NZ6Lu61+u=S{iE# z8q5f5cn@=FaHyuHbUe`1W=;L)4Ilsgzk4|xZqY27z8$+!ip1}AqCTy6Z%9$CW+<{h z>ufw75RsEFPo}g=IhTycZQ2*eBQlv98EMKiN|lEN|NQTOBEHawY|A|9^cO<)whDYi zF(>gIbDrh!#!cLxE@}2lo&D@e(RmBujGQL}=3xS3c^chK9|g&ok~)TJTX9avvl%fF z&lo%`W=@RHGf@tSSrqewwQVcRf3p6vn3iWonUQW=#%D#pdOF1K$XRDy)T5`m*hM-U zVs1R+=Q}amV$M86d?jYL8q^zVMGYzng9(rX7FY$FU>}sgHE4n_&;dR8mvN8+S&#$A N;IbO)Zs}_6_8$lVZu0;D delta 391 zcmZorXizXr>${QGcOb3rL0aF7w7v^_KKz$wc(IXF0VaFB$CWh`C2VV&6 ztYBbZ*q1-i#ENm<#C#JGkgNkUYd(+)2-v|O;J^@Yc;gO77WuDYObjokGBPl9yDBvQ z5H9CA_<)J^oCMGqgV)mgwoR5`m1mTjY{9A!p##+W!VIW#ze6K8!#+I_R~@WT=7j-} z-e(LF5e16~ypRKlSb{{D!6Fhbct9fdAd!ziw{^RUy!ZujqwC}itYV(NAn_Amah?|! zLE=Fmk!@fRju-nuA`u{wC14Sj7i&QxaUhXNU=fBFvq2&$oB7!eGx`1l`bt2Yi9rpB z4S?7Yhy#E)28auRxCe;m1MvwUz6HczfS3*FX;mOL17cqw&H&;%AfB{Yp7TE2 diff --git a/DuetPkg/BootSector/efi32.S b/DuetPkg/BootSector/efi32.S index 391590a856..ebbc450950 100644 --- a/DuetPkg/BootSector/efi32.S +++ b/DuetPkg/BootSector/efi32.S @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ #* -#* Copyright (c) 2006, Intel Corporation. All rights reserved.
+#* Copyright (c) 2006 - 2011, 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 @@ -37,6 +37,7 @@ _start: .endm Start: + movw %bx, %ax movw %ax, %ds movw %ax, %es movw %ax, %fs diff --git a/DuetPkg/BootSector/efi32.asm b/DuetPkg/BootSector/efi32.asm index 471b4807bc..7ccf86f0eb 100644 --- a/DuetPkg/BootSector/efi32.asm +++ b/DuetPkg/BootSector/efi32.asm @@ -1,6 +1,6 @@ ;------------------------------------------------------------------------------ ;* -;* Copyright (c) 2006, Intel Corporation. All rights reserved.
+;* Copyright (c) 2006 - 2011, 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 @@ -39,6 +39,7 @@ endm Start: + mov ax,bx ; flat data descriptor in BX mov ds,ax mov es,ax mov fs,ax diff --git a/DuetPkg/BootSector/start.S b/DuetPkg/BootSector/start.S index b9a34db081..f96d06e144 100644 --- a/DuetPkg/BootSector/start.S +++ b/DuetPkg/BootSector/start.S @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ #* -#* Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
+#* Copyright (c) 2006 - 2011, 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 @@ -404,6 +404,7 @@ Timeout8042: A20GateEnabled: + movw $0x0008, %bx # Flat data descriptor # # DISABLE INTERRUPTS - Entering Protected Mode @@ -425,11 +426,6 @@ A20GateEnabled: movl %cr0, %eax orb $1, %al movl %eax, %cr0 - - movl $0x008, %eax # Flat data descriptor - movl $0x00400000, %ebp # Destination of EFILDR32 - movl $0x00070000, %ebx # Length of copy - JUMP: # jmp far 0010:00020000 .byte 0x66 diff --git a/DuetPkg/BootSector/start.asm b/DuetPkg/BootSector/start.asm index 2674d1cd8a..9cc05ff5ca 100644 --- a/DuetPkg/BootSector/start.asm +++ b/DuetPkg/BootSector/start.asm @@ -1,6 +1,6 @@ ;------------------------------------------------------------------------------ ;* -;* Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
+;* Copyright (c) 2006 - 2011, 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 @@ -400,7 +400,7 @@ Timeout8042: A20GateEnabled: - + mov bx,0008h ; Flat data descriptor ; ; DISABLE INTERRUPTS - Entering Protected Mode ; @@ -421,11 +421,6 @@ A20GateEnabled: mov eax,cr0 or al,1 mov cr0,eax - - mov eax,0008h ; Flat data descriptor - mov ebp,000400000h ; Destination of EFILDR32 - mov ebx,000070000h ; Length of copy - JUMP: ; jmp far 0010:00020000 db 066h diff --git a/DuetPkg/BootSector/start16.S b/DuetPkg/BootSector/start16.S index be525b6f30..053a0eeb91 100644 --- a/DuetPkg/BootSector/start16.S +++ b/DuetPkg/BootSector/start16.S @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ #* -#* Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
+#* Copyright (c) 2006 - 2011, 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 @@ -398,7 +398,7 @@ Timeout8042: A20GateEnabled: - + movw $0x0008, %bx # Flat data descriptor # # DISABLE INTERRUPTS - Entering Protected Mode # @@ -419,11 +419,6 @@ A20GateEnabled: movl %cr0, %eax orb $1, %al movl %eax, %cr0 - - movl $0x008, %eax # Flat data descriptor - movl $0x00400000, %ebp # Destination of EFILDR32 - movl $0x00070000, %ebx # Length of copy - JUMP: # jmp far 0010:00020000 .byte 0x66 diff --git a/DuetPkg/BootSector/start16.asm b/DuetPkg/BootSector/start16.asm index 036726d83d..05d0b2d1e5 100644 --- a/DuetPkg/BootSector/start16.asm +++ b/DuetPkg/BootSector/start16.asm @@ -1,6 +1,6 @@ ;------------------------------------------------------------------------------ ;* -;* Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
+;* Copyright (c) 2006 - 2011, 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 @@ -393,7 +393,7 @@ Timeout8042: A20GateEnabled: - + mov bx,0008h ; Flat data descriptor ; ; DISABLE INTERRUPTS - Entering Protected Mode ; @@ -414,11 +414,6 @@ A20GateEnabled: mov eax,cr0 or al,1 mov cr0,eax - - mov eax,0008h ; Flat data descriptor - mov ebp,000400000h ; Destination of EFILDR32 - mov ebx,000070000h ; Length of copy - JUMP: ; jmp far 0010:00020000 db 066h diff --git a/DuetPkg/BootSector/start32.S b/DuetPkg/BootSector/start32.S index c47f92763d..6ce225612f 100644 --- a/DuetPkg/BootSector/start32.S +++ b/DuetPkg/BootSector/start32.S @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ #* -#* Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
+#* Copyright (c) 2006 - 2011, 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 @@ -413,7 +413,7 @@ Timeout8042: A20GateEnabled: - + movw $0x0008, %bx # Flat data descriptor # # DISABLE INTERRUPTS - Entering Protected Mode # @@ -434,11 +434,6 @@ A20GateEnabled: movl %cr0, %eax orb $1, %al movl %eax, %cr0 - - movl $0x008, %eax # Flat data descriptor - movl $0x00400000, %ebp # Destination of EFILDR32 - movl $0x00070000, %ebx # Length of copy - JUMP: # jmp far 0010:00020000 .byte 0x66 diff --git a/DuetPkg/BootSector/start32.asm b/DuetPkg/BootSector/start32.asm index 2cc5640cd8..aaf04b86bc 100644 --- a/DuetPkg/BootSector/start32.asm +++ b/DuetPkg/BootSector/start32.asm @@ -1,6 +1,6 @@ ;------------------------------------------------------------------------------ ;* -;* Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
+;* Copyright (c) 2006 - 2011, 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 @@ -408,7 +408,7 @@ Timeout8042: A20GateEnabled: - + mov bx,0008h ; Flat data descriptor ; ; DISABLE INTERRUPTS - Entering Protected Mode ; @@ -429,11 +429,6 @@ A20GateEnabled: mov eax,cr0 or al,1 mov cr0,eax - - mov eax,0008h ; Flat data descriptor - mov ebp,000400000h ; Destination of EFILDR32 - mov ebx,000070000h ; Length of copy - JUMP: ; jmp far 0010:00020000 db 066h -- 2.39.2