VirtualBox

Changeset 60024 in vbox for trunk/src


Ignore:
Timestamp:
Mar 15, 2016 8:59:49 AM (9 years ago)
Author:
vboxsync
Message:

bs3kit: updates (-> office).

Location:
trunk/src/VBox/ValidationKit/bootsectors
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/Makefile.kmk

    r60009 r60024  
    4545if defined(VBOX_WITH_OPEN_WATCOM)
    4646 if1of ($(KBUILD_TARGET), win)
    47   VBOX_WITH_BS3KIT = 1
     47# temp disabled #  VBOX_WITH_BS3KIT = 1
    4848 else if $(VBOX_GCC_VERSION_CC) >= 40400 # ms_abi was added in 4.4
    4949# Awaiting elf -> omf converter #  if1of ($(KBUILD_TARGET), linux)
     
    231231MISCBINS += bs3-cpu-basic-2
    232232bs3-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
     233bs3-cpu-basic-2_INCS  = .
     234bs3-cpu-basic-2_DEFS  = BS3_CMN_INSTANTIATE_FILE1=bs3-cpu-basic-2-template.c
     235bs3-cpu-basic-2_DEFS += BS3_MODE_INSTANTIATE_FILE1=bs3-cpu-basic-2-template.c
    235236 ifeq ($(KBUILD_HOST),win)
    236237bs3-cpu-basic-2_DEFS += HAVE_OMF_CONVERTER
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-c.c

    r60009 r60024  
    3232
    3333
    34 BS3TESTMODE_PROTOTYPES_CMN(bs3CpuBasic2_Hello);
    35 
     34/*********************************************************************************************************************************
     35*   Internal Functions                                                                                                           *
     36*********************************************************************************************************************************/
     37BS3TESTMODE_PROTOTYPES_MODE(bs3CpuBasic2_TssGateEsp);
    3638//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);
    4040
    4141
     42/*********************************************************************************************************************************
     43*   Global Variables                                                                                                             *
     44*********************************************************************************************************************************/
    4245static const BS3TESTMODEENTRY g_aModeTest[] =
    4346{
    44     BS3TESTMODEENTRY_CMN("Hello", bs3CpuBasic2_Hello),
     47    BS3TESTMODEENTRY_MODE("tss / gate / esp", bs3CpuBasic2_TssGateEsp),
    4548    //BS3TESTMODEENTRY_CMN("iret", bs3CpuBasic2_iret),
    46     BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret),
     49    //BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret),
    4750};
    4851
     
    5356    Bs3TestInit("bs3-cpu-basic-2");
    5457
    55 #ifdef HAVE_OMF_CONVERTER /** @todo Awaiting ELF + Mach-O -> OMF conversion. */
    5658    Bs3TestDoModes_rm(g_aModeTest, RT_ELEMENTS(g_aModeTest));
    57 #endif
    5859
    5960    Bs3TestTerm();
     61for (;;) { }
    6062}
    6163
  • 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 */
    126
    227
     28#ifdef BS3_INSTANTIATING_MODE
    329
    4 BS3_DECL(uint8_t) BS3_CMN_NM(bs3CpuBasic2_Hello)(uint8_t bMode)
     30extern BS3_DECL(void) TMPL_NM(bs3CpuBasic2_TssGateEsp_IntXx)(void);
     31
     32BS3_DECL(uint8_t) TMPL_NM(bs3CpuBasic2_TssGateEsp)(uint8_t bMode)
    533{
    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;
    873}
    974
     75
     76#endif /* BS3_INSTANTIATING_MODE */
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.mac

    r60003 r60024  
    3939        sub     xSP, 20h
    4040
     41%if TMPL_BITS == 64
    4142%if TMPL_BITS == 16
    4243        xor     ax, ax
     
    5455        add     xSP, xCB * 2
    5556%endif
     57%endif
    5658
    5759        ; Return
    5860        xor     al, al
    59 mov al, TMPL_MODE                       ; remove me
     61;mov al, TMPL_MODE                       ; remove me
    6062
    6163
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r60000 r60024  
    8585       bs3-cmn-RegCtxConvertToRingX.c \
    8686       bs3-cmn-RegCtxPrint.c \
     87       bs3-cmn-SelFar32ToFlat32.c \
    8788       bs3-cmn-SelProtFar32ToFlat32.c \
    8889       bs3-cmn-SlabInit.c \
     
    124125        bs3-cmn-TrapPrintFrame.c \
    125126        bs3-cmn-TrapSetHandler.c \
     127        bs3-cmn-TrapSetJmp.asm \
     128        bs3-cmn-TrapUnsetJmp.c \
    126129       ../../../Runtime/common/asm/ASMBitFirstClear.asm \
    127130       ../../../Runtime/common/asm/ASMBitFirstSet.asm \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PerCpuData.c

    r60000 r60024  
    4747uint32_t BS3_DATA_NM(g_uBs3TrapEipHint) = 0;
    4848
     49/** Flat pointer to a BS3TRAPFRAME registered by Bs3TrapSetJmp.
     50 * When this is non-zero, the setjmp is considered armed. */
     51uint32_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. */
     55BS3REGCTX BS3_DATA_NM(g_Bs3TrapSetJmpCtx);
    4956
    5057#endif /* ARCH_BITS == 16 */
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Trap16Init.c

    r59984 r60024  
    4646
    4747
    48 BS3_DECL(void) Bs3Trap16Init(bool f386Plus)
     48BS3_DECL(void) Bs3Trap16InitEx(bool f386Plus)
    4949{
    5050    X86TSS16 BS3_FAR *pTss;
     
    109109}
    110110
     111
     112BS3_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  
    4242        Bs3Trap32Init();
    4343    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();
    4545}
    4646
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r60019 r60024  
    13461346
    13471347/**
     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 */
     1354BS3_DECL(uint32_t) Bs3SelFar32ToFlat32_c16(uint32_t off, uint16_t uSel);
     1355BS3_DECL(uint32_t) Bs3SelFar32ToFlat32_c32(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelFar32ToFlat32_c16 */
     1356BS3_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/**
    13481361 * Equivalent to RTTestCreate + RTTestBanner.
    13491362 *
     
    20402053typedef BS3REGCTX const BS3_FAR *PCBS3REGCTX;
    20412054
     2055/**
     2056 * Saves the current register context.
     2057 *
     2058 * @param   pRegCtx     Where to store the register context.
     2059 */
     2060BS3_DECL(void) Bs3RegCtxSave_c16(PCBS3REGCTX pRegCtx);
     2061BS3_DECL(void) Bs3RegCtxSave_c32(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxSave_c16 */
     2062BS3_DECL(void) Bs3RegCtxSave_c64(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxSave_c16 */
     2063#define Bs3RegCtxSave BS3_CMN_NM(Bs3RegCtxSave) /**< Selects #Bs3RegCtxSave_c16, #Bs3RegCtxSave_c32 or #Bs3RegCtxSave_c64. */
    20422064
    20432065/**
     
    20612083 * @remarks Does not return.
    20622084 */
    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 */
     2085BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c16(PCBS3REGCTX pRegCtx, uint16_t fFlags);
     2086BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c32(PCBS3REGCTX pRegCtx, uint16_t fFlags); /**< @copydoc Bs3RegCtxRestore_c16 */
     2087BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c64(PCBS3REGCTX pRegCtx, uint16_t fFlags); /**< @copydoc Bs3RegCtxRestore_c16 */
    20662088#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
    20672093
    20682094/** Skip restoring the CRx registers. */
     
    21142140 * Initializes 16-bit (protected mode) trap handling.
    21152141 *
     2142 * @remarks Does not install 16-bit trap handling, just initializes the
     2143 *          structures.
     2144 */
     2145BS3_DECL(void) Bs3Trap16Init_c16(void);
     2146BS3_DECL(void) Bs3Trap16Init_c32(void); /**< @copydoc Bs3Trap16Init_c16 */
     2147BS3_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 *
    21162153 * @param   f386Plus    Set if the CPU is 80386 or later and
    21172154 *                      extended registers should be saved.  Once initialized
     
    21222159 *          structures.
    21232160 */
    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. */
     2161BS3_DECL(void) Bs3Trap16InitEx_c16(bool f386Plus);
     2162BS3_DECL(void) Bs3Trap16InitEx_c32(bool f386Plus); /**< @copydoc Bs3Trap16InitEx_c16 */
     2163BS3_DECL(void) Bs3Trap16InitEx_c64(bool f386Plus); /**< @copydoc Bs3Trap16InitEx_c16 */
     2164#define Bs3Trap16InitEx BS3_CMN_NM(Bs3Trap16InitEx) /**< Selects #Bs3Trap16InitEx_c16, #Bs3Trap16InitEx_c32 or #Bs3Trap16InitEx_c64. */
    21282165
    21292166/**
     
    22662303BS3_DECL(void) Bs3TrapPrintFrame_c64(PCBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapPrintFrame_c16 */
    22672304#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 */
     2318BS3_DECL(DECL_RETURNS_TWICE(bool)) Bs3TrapSetJmp_c16(PBS3TRAPFRAME pTrapFrame);
     2319BS3_DECL(DECL_RETURNS_TWICE(bool)) Bs3TrapSetJmp_c32(PBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapSetJmp_c16 */
     2320BS3_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 */
     2326BS3_DECL(void) Bs3TrapUnsetJmp_c16(void);
     2327BS3_DECL(void) Bs3TrapUnsetJmp_c32(void); /**< @copydoc Bs3TrapUnsetJmp_c16 */
     2328BS3_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
    22682334
    22692335/** @} */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette