- Timestamp:
- Mar 15, 2016 8:59:49 AM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 4 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/Makefile.kmk
r60009 r60024 45 45 if defined(VBOX_WITH_OPEN_WATCOM) 46 46 if1of ($(KBUILD_TARGET), win) 47 VBOX_WITH_BS3KIT = 147 # temp disabled # VBOX_WITH_BS3KIT = 1 48 48 else if $(VBOX_GCC_VERSION_CC) >= 40400 # ms_abi was added in 4.4 49 49 # Awaiting elf -> omf converter # if1of ($(KBUILD_TARGET), linux) … … 231 231 MISCBINS += bs3-cpu-basic-2 232 232 bs3-cpu-basic-2_TEMPLATE = VBoxBS3KitImg 233 bs3-cpu-basic-2_INCS = . 234 bs3-cpu-basic-2_DEFS = BS3_CMN_INSTANTIATE_FILE1=bs3-cpu-basic-2-template.c 233 bs3-cpu-basic-2_INCS = . 234 bs3-cpu-basic-2_DEFS = BS3_CMN_INSTANTIATE_FILE1=bs3-cpu-basic-2-template.c 235 bs3-cpu-basic-2_DEFS += BS3_MODE_INSTANTIATE_FILE1=bs3-cpu-basic-2-template.c 235 236 ifeq ($(KBUILD_HOST),win) 236 237 bs3-cpu-basic-2_DEFS += HAVE_OMF_CONVERTER -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-c.c
r60009 r60024 32 32 33 33 34 BS3TESTMODE_PROTOTYPES_CMN(bs3CpuBasic2_Hello); 35 34 /********************************************************************************************************************************* 35 * Internal Functions * 36 *********************************************************************************************************************************/ 37 BS3TESTMODE_PROTOTYPES_MODE(bs3CpuBasic2_TssGateEsp); 36 38 //BS3TESTMODE_PROTOTYPES_CMN(bs3CpuBasic2_iret); 37 //#pragma alias("_bs3CpuBasic2_iret_c64", "bs3CpuBasic2_iret_c64") 38 39 BS3TESTMODE_PROTOTYPES_MODE(bs3CpuBasic2_iret); 39 //BS3TESTMODE_PROTOTYPES_MODE(bs3CpuBasic2_iret); 40 40 41 41 42 /********************************************************************************************************************************* 43 * Global Variables * 44 *********************************************************************************************************************************/ 42 45 static const BS3TESTMODEENTRY g_aModeTest[] = 43 46 { 44 BS3TESTMODEENTRY_ CMN("Hello", bs3CpuBasic2_Hello),47 BS3TESTMODEENTRY_MODE("tss / gate / esp", bs3CpuBasic2_TssGateEsp), 45 48 //BS3TESTMODEENTRY_CMN("iret", bs3CpuBasic2_iret), 46 BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret),49 //BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret), 47 50 }; 48 51 … … 53 56 Bs3TestInit("bs3-cpu-basic-2"); 54 57 55 #ifdef HAVE_OMF_CONVERTER /** @todo Awaiting ELF + Mach-O -> OMF conversion. */56 58 Bs3TestDoModes_rm(g_aModeTest, RT_ELEMENTS(g_aModeTest)); 57 #endif58 59 59 60 Bs3TestTerm(); 61 for (;;) { } 60 62 } 61 63 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c
r60009 r60024 1 /* $Id$ */ 2 /** @file 3 * BS3Kit - bs3-cpu-basic-2, C code template. 4 */ 5 6 /* 7 * Copyright (C) 2007-2016 Oracle Corporation 8 * 9 * This file is part of VirtualBox Open Source Edition (OSE), as 10 * available from http://www.virtualbox.org. This file is free software; 11 * you can redistribute it and/or modify it under the terms of the GNU 12 * General Public License (GPL) as published by the Free Software 13 * Foundation, in version 2 as it comes in the "COPYING" file of the 14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 * 17 * The contents of this file may alternatively be used under the terms 18 * of the Common Development and Distribution License Version 1.0 19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the 20 * VirtualBox OSE distribution, in which case the provisions of the 21 * CDDL are applicable instead of those of the GPL. 22 * 23 * You may elect to license modified versions of this file under the 24 * terms and conditions of either the GPL or the CDDL or both. 25 */ 1 26 2 27 28 #ifdef BS3_INSTANTIATING_MODE 3 29 4 BS3_DECL(uint8_t) BS3_CMN_NM(bs3CpuBasic2_Hello)(uint8_t bMode) 30 extern BS3_DECL(void) TMPL_NM(bs3CpuBasic2_TssGateEsp_IntXx)(void); 31 32 BS3_DECL(uint8_t) TMPL_NM(bs3CpuBasic2_TssGateEsp)(uint8_t bMode) 5 33 { 6 Bs3Printf("Hello C Word: %#x\n", bMode); 7 return UINT8_MAX; 34 uint8_t bRet = 0; 35 # if TMPL_MODE == BS3_MODE_PE16 \ 36 || TMPL_MODE == BS3_MODE_PE16_32 37 BS3TRAPFRAME TrapCtx; 38 BS3REGCTX Ctx; 39 40 Bs3RegCtxSave(&Ctx); 41 Ctx.rip.u = (uintptr_t)&TMPL_NM(bs3CpuBasic2_TssGateEsp_IntXx); 42 43 /* 44 * Check that the stuff works first. 45 */ 46 if (Bs3TrapSetJmp(&TrapCtx)) 47 { 48 49 Bs3TrapUnsetJmp(); 50 } 51 else 52 { 53 /* trapped. */ 54 } 55 56 57 # else 58 bRet = BS3TESTDOMODE_SKIPPED; 59 # endif 60 61 /* 62 * Re-initialize the IDT. 63 */ 64 # if BS3_MODE_IS_16BIT_SYS(TMPL_MODE) 65 Bs3Trap16Init(); 66 # elif BS3_MODE_IS_32BIT_SYS(TMPL_MODE) 67 Bs3Trap32Init(); 68 # elif BS3_MODE_IS_32BIT_SYS(TMPL_MODE) 69 Bs3Trap64Init(); 70 # endif 71 72 return bRet; 8 73 } 9 74 75 76 #endif /* BS3_INSTANTIATING_MODE */ -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.mac
r60003 r60024 39 39 sub xSP, 20h 40 40 41 %if TMPL_BITS == 64 41 42 %if TMPL_BITS == 16 42 43 xor ax, ax … … 54 55 add xSP, xCB * 2 55 56 %endif 57 %endif 56 58 57 59 ; Return 58 60 xor al, al 59 mov al, TMPL_MODE ; remove me61 ;mov al, TMPL_MODE ; remove me 60 62 61 63 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r60000 r60024 85 85 bs3-cmn-RegCtxConvertToRingX.c \ 86 86 bs3-cmn-RegCtxPrint.c \ 87 bs3-cmn-SelFar32ToFlat32.c \ 87 88 bs3-cmn-SelProtFar32ToFlat32.c \ 88 89 bs3-cmn-SlabInit.c \ … … 124 125 bs3-cmn-TrapPrintFrame.c \ 125 126 bs3-cmn-TrapSetHandler.c \ 127 bs3-cmn-TrapSetJmp.asm \ 128 bs3-cmn-TrapUnsetJmp.c \ 126 129 ../../../Runtime/common/asm/ASMBitFirstClear.asm \ 127 130 ../../../Runtime/common/asm/ASMBitFirstSet.asm \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PerCpuData.c
r60000 r60024 47 47 uint32_t BS3_DATA_NM(g_uBs3TrapEipHint) = 0; 48 48 49 /** Flat pointer to a BS3TRAPFRAME registered by Bs3TrapSetJmp. 50 * When this is non-zero, the setjmp is considered armed. */ 51 uint32_t BS3_DATA_NM(g_pBs3TrapSetJmpFrame) = 0; 52 53 /** The context of the last Bs3TrapSetJmp call. 54 * This will have eax set to 1 and need only be restored when it triggers. */ 55 BS3REGCTX BS3_DATA_NM(g_Bs3TrapSetJmpCtx); 49 56 50 57 #endif /* ARCH_BITS == 16 */ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Trap16Init.c
r59984 r60024 46 46 47 47 48 BS3_DECL(void) Bs3Trap16Init (bool f386Plus)48 BS3_DECL(void) Bs3Trap16InitEx(bool f386Plus) 49 49 { 50 50 X86TSS16 BS3_FAR *pTss; … … 109 109 } 110 110 111 112 BS3_DECL(void) Bs3Trap16Init(void) 113 { 114 Bs3Trap16InitEx((BS3_DATA_NM(g_uBs3CpuDetected) & BS3CPU_TYPE_MASK) >= BS3CPU_80386); 115 } 116 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c
r59984 r60024 42 42 Bs3Trap32Init(); 43 43 if ((BS3_DATA_NM(g_uBs3CpuDetected) & BS3CPU_TYPE_MASK) >= BS3CPU_80286) 44 Bs3Trap16Init( (BS3_DATA_NM(g_uBs3CpuDetected) & BS3CPU_TYPE_MASK) >= BS3CPU_80386);44 Bs3Trap16Init(); 45 45 } 46 46 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60019 r60024 1346 1346 1347 1347 /** 1348 * Converts a current mode 32-bit far pointer to a 32-bit flat address. 1349 * 1350 * @returns 32-bit flat address. 1351 * @param off The segment offset. 1352 * @param uSel The current mode segment selector. 1353 */ 1354 BS3_DECL(uint32_t) Bs3SelFar32ToFlat32_c16(uint32_t off, uint16_t uSel); 1355 BS3_DECL(uint32_t) Bs3SelFar32ToFlat32_c32(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelFar32ToFlat32_c16 */ 1356 BS3_DECL(uint32_t) Bs3SelFar32ToFlat32_c64(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelFar32ToFlat32_c16 */ 1357 #define Bs3SelFar32ToFlat32 BS3_CMN_NM(Bs3SelFar32ToFlat32) /**< Selects #Bs3SelFar32ToFlat32_c16, #Bs3SelFar32ToFlat32_c32 or #Bs3SelFar32ToFlat32_c64. */ 1358 1359 1360 /** 1348 1361 * Equivalent to RTTestCreate + RTTestBanner. 1349 1362 * … … 2040 2053 typedef BS3REGCTX const BS3_FAR *PCBS3REGCTX; 2041 2054 2055 /** 2056 * Saves the current register context. 2057 * 2058 * @param pRegCtx Where to store the register context. 2059 */ 2060 BS3_DECL(void) Bs3RegCtxSave_c16(PCBS3REGCTX pRegCtx); 2061 BS3_DECL(void) Bs3RegCtxSave_c32(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxSave_c16 */ 2062 BS3_DECL(void) Bs3RegCtxSave_c64(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxSave_c16 */ 2063 #define Bs3RegCtxSave BS3_CMN_NM(Bs3RegCtxSave) /**< Selects #Bs3RegCtxSave_c16, #Bs3RegCtxSave_c32 or #Bs3RegCtxSave_c64. */ 2042 2064 2043 2065 /** … … 2061 2083 * @remarks Does not return. 2062 2084 */ 2063 BS3_DECL( void) Bs3RegCtxRestore_c16(PCBS3REGCTX pRegCtx, uint16_t fFlags);2064 BS3_DECL( void) Bs3RegCtxRestore_c32(PCBS3REGCTX pRegCtx, uint16_t fFlags); /**< @copydoc Bs3RegCtxRestore_c16 */2065 BS3_DECL( void) Bs3RegCtxRestore_c64(PCBS3REGCTX pRegCtx, uint16_t fFlags); /**< @copydoc Bs3RegCtxRestore_c16 */2085 BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c16(PCBS3REGCTX pRegCtx, uint16_t fFlags); 2086 BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c32(PCBS3REGCTX pRegCtx, uint16_t fFlags); /**< @copydoc Bs3RegCtxRestore_c16 */ 2087 BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c64(PCBS3REGCTX pRegCtx, uint16_t fFlags); /**< @copydoc Bs3RegCtxRestore_c16 */ 2066 2088 #define Bs3RegCtxRestore BS3_CMN_NM(Bs3RegCtxRestore) /**< Selects #Bs3RegCtxRestore_c16, #Bs3RegCtxRestore_c32 or #Bs3RegCtxRestore_c64. */ 2089 #ifdef __WATCOMC__ 2090 # pragma aux Bs3RegCtxRestore_c16 __aborts; 2091 # pragma aux Bs3RegCtxRestore_c32 __aborts; 2092 #endif 2067 2093 2068 2094 /** Skip restoring the CRx registers. */ … … 2114 2140 * Initializes 16-bit (protected mode) trap handling. 2115 2141 * 2142 * @remarks Does not install 16-bit trap handling, just initializes the 2143 * structures. 2144 */ 2145 BS3_DECL(void) Bs3Trap16Init_c16(void); 2146 BS3_DECL(void) Bs3Trap16Init_c32(void); /**< @copydoc Bs3Trap16Init_c16 */ 2147 BS3_DECL(void) Bs3Trap16Init_c64(void); /**< @copydoc Bs3Trap16Init_c16 */ 2148 #define Bs3Trap16Init BS3_CMN_NM(Bs3Trap16Init) /**< Selects #Bs3Trap16Init_c16, #Bs3Trap16Init_c32 or #Bs3Trap16Init_c64. */ 2149 2150 /** 2151 * Initializes 16-bit (protected mode) trap handling, extended version. 2152 * 2116 2153 * @param f386Plus Set if the CPU is 80386 or later and 2117 2154 * extended registers should be saved. Once initialized … … 2122 2159 * structures. 2123 2160 */ 2124 BS3_DECL(void) Bs3Trap16Init _c16(bool f386Plus);2125 BS3_DECL(void) Bs3Trap16Init _c32(bool f386Plus); /**< @copydoc Bs3Trap16Init_c16 */2126 BS3_DECL(void) Bs3Trap16Init _c64(bool f386Plus); /**< @copydoc Bs3Trap16Init_c16 */2127 #define Bs3Trap16Init BS3_CMN_NM(Bs3Trap16Init) /**< Selects #Bs3Trap16Init_c16, #Bs3Trap16Init_c32 or #Bs3Trap16Init_c64. */2161 BS3_DECL(void) Bs3Trap16InitEx_c16(bool f386Plus); 2162 BS3_DECL(void) Bs3Trap16InitEx_c32(bool f386Plus); /**< @copydoc Bs3Trap16InitEx_c16 */ 2163 BS3_DECL(void) Bs3Trap16InitEx_c64(bool f386Plus); /**< @copydoc Bs3Trap16InitEx_c16 */ 2164 #define Bs3Trap16InitEx BS3_CMN_NM(Bs3Trap16InitEx) /**< Selects #Bs3Trap16InitEx_c16, #Bs3Trap16InitEx_c32 or #Bs3Trap16InitEx_c64. */ 2128 2165 2129 2166 /** … … 2266 2303 BS3_DECL(void) Bs3TrapPrintFrame_c64(PCBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapPrintFrame_c16 */ 2267 2304 #define Bs3TrapPrintFrame BS3_CMN_NM(Bs3TrapPrintFrame) /**< Selects #Bs3TrapPrintFrame_c16, #Bs3TrapPrintFrame_c32 or #Bs3TrapPrintFrame_c64. */ 2305 2306 /** 2307 * Sets up a long jump from a trap handler. 2308 * 2309 * The long jump will only be performed onced, but will catch any kind of trap, 2310 * fault, interrupt or irq. 2311 * 2312 * @retval true on the initial call. 2313 * @retval false on trap return. 2314 * @param pTrapFrame Where to store the trap information when 2315 * returning @c false. 2316 * @sa #Bs3TrapUnsetJmp 2317 */ 2318 BS3_DECL(DECL_RETURNS_TWICE(bool)) Bs3TrapSetJmp_c16(PBS3TRAPFRAME pTrapFrame); 2319 BS3_DECL(DECL_RETURNS_TWICE(bool)) Bs3TrapSetJmp_c32(PBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapSetJmp_c16 */ 2320 BS3_DECL(DECL_RETURNS_TWICE(bool)) Bs3TrapSetJmp_c64(PBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapSetJmp_c16 */ 2321 #define Bs3TrapSetJmp BS3_CMN_NM(Bs3TrapSetJmp) /**< Selects #Bs3TrapSetJmp_c16, #Bs3TrapSetJmp_c32 or #Bs3TrapSetJmp_c64. */ 2322 2323 /** 2324 * Disables a previous #Bs3TrapSetJmp call. 2325 */ 2326 BS3_DECL(void) Bs3TrapUnsetJmp_c16(void); 2327 BS3_DECL(void) Bs3TrapUnsetJmp_c32(void); /**< @copydoc Bs3TrapUnsetJmp_c16 */ 2328 BS3_DECL(void) Bs3TrapUnsetJmp_c64(void); /**< @copydoc Bs3TrapUnsetJmp_c16 */ 2329 #define Bs3TrapUnsetJmp BS3_CMN_NM(Bs3TrapUnsetJmp) /**< Selects #Bs3TrapUnsetJmp_c16, #Bs3TrapUnsetJmp_c32 or #Bs3TrapUnsetJmp_c64. */ 2330 #ifdef __WATCOMC__ 2331 # pragma aux Bs3TrapUnsetJmp_c16 aborts; 2332 # pragma aux Bs3TrapUnsetJmp_c32 aborts; 2333 #endif 2268 2334 2269 2335 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.