Changeset 59895 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Mar 2, 2016 12:40:59 PM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r59894 r59895 82 82 bs3-cmn-PagingInitRootForPAE.c \ 83 83 bs3-cmn-PagingInitRootForLM.c \ 84 bs3-cmn-SelProtFar32ToFlat32.c \ 84 85 bs3-cmn-SlabInit.c \ 85 86 bs3-cmn-SlabAlloc.c \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo16BitV86.asm
r59894 r59895 31 31 BS3_EXTERN_DATA16 g_bBs3CurrentMode 32 32 BS3_EXTERN_CMN Bs3SwitchToRing0 33 BS3_EXTERN_CMN Bs3SelProtFar32ToFlat32 33 34 TMPL_BEGIN_TEXT 34 35 … … 36 37 ;; 37 38 ; @cproto BS3_DECL(void) Bs3SwitchTo16BitV86(void); 39 ; @uses No general registers modified. Regment registers loaded with specific 40 ; values and the stack register converted to real mode (not ebp). 38 41 ; 39 42 BS3_PROC_BEGIN_CMN Bs3SwitchTo16BitV86 40 43 ; Construct basic v8086 return frame. 41 BS3_ONLY_16BIT_STMT push gs42 BS3_ONLY_16BIT_STMT movzx esp, sp43 push dword fs44 BS3_ONLY_16BIT_STMT movzx esp, sp 45 push dword 0 ; GS 46 push dword 0 ; FS 44 47 push dword BS3_SEL_DATA16 ; ES 45 48 push dword BS3_SEL_DATA16 ; DS 46 push dword ss49 push dword 0 ; SS - later 47 50 push dword 0 ; return ESP, later. 48 51 pushfd … … 57 60 ; Save registers and stuff. 58 61 push eax 59 %if TMPL_BITS == 16 62 push edx 63 push ecx 64 push ebx 65 %if TMPL_BITS == 16 60 66 push ds 61 67 … … 69 75 70 76 pop ds 77 pop ebx 78 pop ecx 79 pop edx 71 80 pop eax 72 81 add xSP, (9-1)*4 … … 91 100 ; Set GS. 92 101 mov ax, gs 93 mov [xSP + 4 + 20h], ax102 mov [xSP + 4*4 + 20h], ax 94 103 %endif 95 104 96 ; Thunk SS:ESP, first step: calc flat address. 97 lea eax, [esp + 4 + 24h] 105 ; Thunk SS:ESP to real-mode address via 32-bit flat. 106 lea eax, [esp + 4*4 + 24h] 107 push ss 98 108 push eax 99 push ss 100 ; call Bs3SelFar32ToFlat32 101 102 ; Second step: Calc realmode segment and offset. 103 109 BS3_CALL Bs3SelProtFar32ToFlat32, 2 110 mov [esp + 4*4 + 0ch], ax ; high word is already zero 111 %if TMPL_BITS == 16 112 mov [esp + 4*4 + 10h], dx 113 %else 114 shr eax, 16 115 mov [esp + 4*4 + 10h], ax 116 %endif 104 117 105 118 ; Return to v8086 mode. 119 pop ebx 120 pop ecx 121 pop edx 106 122 pop eax 107 123 iretd 108 BS3_PROC_END_CMN Bs3SwitchTo16Bit 109 110 124 BS3_PROC_END_CMN Bs3SwitchTo16BitV86 111 125 112 126 %endif ; ! 64-bit -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r59879 r59895 1309 1309 1310 1310 1311 /** 1312 * Converts a protected mode 32-bit far pointer to a 32-bit flat address. 1313 * 1314 * @returns 32-bit flat address. 1315 * @param off The segment offset. 1316 * @param uSel The protected mode segment selector. 1317 */ 1318 BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32_c16(uint32_t off, uint16_t uSel); 1319 BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32_c32(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelProtFar32ToFlat32_c16 */ 1320 BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32_c64(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelProtFar32ToFlat32_c16 */ 1321 #define Bs3SelProtFar32ToFlat32 BS3_CMN_NM(Bs3SelProtFar32ToFlat32) /**< Selects #Bs3SelProtFar32ToFlat32_c16, #Bs3SelProtFar32ToFlat32_c32 or #Bs3SelProtFar32ToFlat32_c64. */ 1322 1311 1323 1312 1324 /**
Note:
See TracChangeset
for help on using the changeset viewer.