VirtualBox

Changeset 60539 in vbox for trunk


Ignore:
Timestamp:
Apr 18, 2016 2:09:39 PM (9 years ago)
Author:
vboxsync
Message:

bs3kit: Updates.

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

Legend:

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

    r60527 r60539  
    8585               '      extern  _$2_f16' \
    8686        'BS3_BEGIN_TEXT16_NEARSTUBS' \
    87                'GROUP CGROUP16 BS3TEXT16 BS3TEXT16_NEARSTUBS' \
    8887                'BS3_GLOBAL_NAME_EX _$2_c16, function, 6' \
    8988               '      pop     ax' \
     
    606605          segment BS3RMCODE16 \
    607606          segment BS3RMCODE16_END \
     607        clname BS3CLASS16X0CODE \
     608          segment BS3X0CODE16_START \
     609          segment BS3X0CODE16 \
     610          segment BS3X0CODE16_END \
     611        clname BS3CLASS16X1CODE \
     612          segment BS3X1CODE16_START \
     613          segment BS3X1CODE16 \
     614          segment BS3X1CODE16_END \
    608615        clname BS3CLASS32CODE \
    609616          segment BS3TEXT32_START \
     
    809816          segment BS3RMCODE16 \
    810817          segment BS3RMCODE16_END \
     818        clname BS3CLASS16X0CODE \
     819          segment BS3X0CODE16_START \
     820          segment BS3X0CODE16 \
     821          segment BS3X0CODE16_END \
     822        clname BS3CLASS16X1CODE \
     823          segment BS3X1CODE16_START \
     824          segment BS3X1CODE16 \
     825          segment BS3X1CODE16_END \
    811826        clname BS3CLASS32CODE \
    812827          segment BS3TEXT32 \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-c.c

    r60527 r60539  
    5151    BS3TESTMODEENTRY_MODE("raise xcpt #1", bs3CpuBasic2_RaiseXcpt1),
    5252    //BS3TESTMODEENTRY_CMN("iret", bs3CpuBasic2_iret),
    53 //    BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret),
     53    BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret),
    5454//    BS3TESTMODEENTRY_MODE("sidt", bs3CpuBasic2_sidt),
    5555};
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c

    r60527 r60539  
    242242 */
    243243#define bs3CpuBasic2_CompareCpuTrapCtx BS3_CMN_NM(bs3CpuBasic2_CompareCpuTrapCtx)
    244 BS3_DECL(void) bs3CpuBasic2_CompareCpuTrapCtx(PCBS3TRAPFRAME pTrapCtx, PCBS3REGCTX pStartCtx, uint16_t uErrCd, uint8_t bXcpt,
    245                                               bool f486ResumeFlagHint)
     244void bs3CpuBasic2_CompareCpuTrapCtx(PCBS3TRAPFRAME pTrapCtx, PCBS3REGCTX pStartCtx, uint16_t uErrCd, uint8_t bXcpt,
     245                                    bool f486ResumeFlagHint)
    246246{
    247247    uint16_t const cErrorsBefore = Bs3TestSubErrorCount();
     
    14981498
    14991499
    1500 BS3_DECL(uint8_t) TMPL_NM(bs3CpuBasic2_TssGateEsp)(uint8_t bMode)
     1500BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_TssGateEsp)(uint8_t bMode)
    15011501{
    15021502    uint8_t bRet = 0;
     
    15281528
    15291529
    1530 BS3_DECL(uint8_t) TMPL_NM(bs3CpuBasic2_RaiseXcpt1)(uint8_t bMode)
     1530BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_RaiseXcpt1)(uint8_t bMode)
    15311531{
    15321532    g_pszTestMode = TMPL_NM(g_szBs3ModeName);
     
    15651565
    15661566
    1567 BS3_DECL(uint8_t) TMPL_NM(bs3CpuBasic2_iret)(uint8_t bMode)
     1567BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_iret)(uint8_t bMode)
    15681568{
    15691569    g_pszTestMode = TMPL_NM(g_szBs3ModeName);
     
    15791579
    15801580
    1581 BS3_DECL(uint8_t) TMPL_NM(bs3CpuBasic2_sidt)(uint8_t bMode)
     1581BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_sidt)(uint8_t bMode)
    15821582{
    15831583    g_pszTestMode = TMPL_NM(g_szBs3ModeName);
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r60527 r60539  
    9090       bs3-cmn-SelFar32ToFlat32.c \
    9191       bs3-cmn-SelProtFar32ToFlat32.c \
     92       bs3-cmn-SelRealModeCodeToProtMode.asm \
     93       bs3-cmn-SelFlatCodeToRealMode.asm \
     94       bs3-cmn-SelFlatCodeToProtFar16.asm \
    9295       bs3-cmn-SlabInit.c \
    9396       bs3-cmn-SlabAlloc.c \
     
    176179        bs3-rm-InitAll.c \
    177180        bs3-rm-InitMemory.c \
     181        bs3-rm-InitGdt.c \
    178182        bs3-cmn-hexdigits.c \
    179183        bs3-cmn-CpuDetectData.c \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/VBoxBs3ObjConverter.cpp

    r60527 r60539  
    36613661    /** The segment index. */
    36623662    uint16_t        idxSeg;
    3663     /** The group index for this segment.  This is zero if not yet determined and
    3664      * UINT16_MAX if no group applicable to this segment. */
     3663    /** The group index for this segment.  Initially OMF_REPLACE_GRP_XXX values,
     3664     * later convertOmfWriteDebugGrpDefs replaces them with actual values. */
    36653665    uint16_t        idxGrp;
    36663666    /** File table. */
     
    36683668} OMFSEGLINES;
    36693669typedef OMFSEGLINES *POMFSEGLINES;
     3670
     3671/** @name OMF_REPLACE_GRP_XXX - Special OMFSEGLINES::idxGrp values.
     3672 * @{ */
     3673#define OMF_REPLACE_GRP_CGROUP16    UINT16_C(0xffe0)
     3674#define OMF_REPLACE_GRP_RMCODE      UINT16_C(0xffe1)
     3675#define OMF_REPLACE_GRP_X0CODE      UINT16_C(0xffe2)
     3676#define OMF_REPLACE_GRP_X1CODE      UINT16_C(0xffe3)
     3677/** @} */
     3678
    36703679
    36713680/**
     
    36823691    /** Set if this module may need mangling. */
    36833692    bool            fMayNeedMangling;
    3684     /** Set if this module needs CGROUP16 for line number fixupes. */
    3685     bool            fNeedsCGroup16;
    36863693    /** The LNAME index of '$$SYMBOLS' or UINT16_MAX it not found. */
    36873694    uint16_t        iSymbolsNm;
     
    36903697    /** The '$$SYMBOLS' segment index. */
    36913698    uint16_t        iSymbolsSeg;
    3692     /** The LNAME index of 'CGROUP16' or UINT16_MAX it not found. */
    3693     uint16_t        iCGroup16Nm;
    3694     /** The 'CGROUP16' group definition index or UINT16_MAX it not found. */
    3695     uint16_t        iCGroup16Grp;
    36963699
    36973700    /** Number of SEGDEFs records. */
     
    37083711    /** Name list.  Points to the size repfix. */
    37093712    char          **papchLNames;
     3713
     3714    /** Code groups we need to keep an eye on for line number fixup purposes. */
     3715    struct OMFLINEGROUPS
     3716    {
     3717        /** The name. */
     3718        const char *pszName;
     3719        /** The primary class name. */
     3720        const char *pszClass1;
     3721        /** The secondary class name. */
     3722        const char *pszClass2;
     3723        /** The name length. */
     3724        uint8_t     cchName;
     3725        /** The primary class name length. */
     3726        uint8_t     cchClass1;
     3727        /** The secondary class name length. */
     3728        uint8_t     cchClass2;
     3729        /** Whether this group is needed. */
     3730        bool        fNeeded;
     3731        /** The group index (UINT16_MAX if not found). */
     3732        uint16_t    idxGroup;
     3733        /** The group name. */
     3734        uint16_t    idxName;
     3735        /** The OMF_REPLACE_GRP_XXX value. */
     3736        uint16_t    idxReplaceGrp;
     3737    }               aGroups[4];
    37103738
    37113739    /** CV8: Filename string table size. */
     
    37283756typedef OMFDETAILS *POMFDETAILS;
    37293757typedef OMFDETAILS const *PCOMFDETAILS;
     3758
    37303759
    37313760/** Grows a table to a given size (a_cNewEntries). */
     
    38923921                return error("???", "collectOmfAddLine: idxSeg=%#x is out of bounds (%#x)!\n", idxSeg, pOmfStuff->cSegDefs);
    38933922            POMFSEGDEF pSegDef = &pOmfStuff->paSegDefs[idxSeg];
    3894             if (   IS_OMF_STR_EQUAL_EX(pSegDef->cchClass, pSegDef->pchClass, "BS3CLASS16CODE")
    3895                 || IS_OMF_STR_EQUAL_EX(pSegDef->cchClass, pSegDef->pchClass, "CODE"))
    3896             {
    3897                 pOmfStuff->fNeedsCGroup16 = true;
    3898                 pSegLines->idxGrp = 0;  /* We'll replace zeros by the actual CGROUP16 index later. */
    3899             }
     3923            unsigned j = RT_ELEMENTS(pOmfStuff->aGroups);
     3924            while (j-- > 0)
     3925                if (   (   pSegDef->cchClass == pOmfStuff->aGroups[j].cchClass1
     3926                        && memcmp(pSegDef->pchClass, pOmfStuff->aGroups[j].pszClass1, pSegDef->cchClass) == 0)
     3927                    || (   pSegDef->cchClass == pOmfStuff->aGroups[j].cchClass2
     3928                        && memcmp(pSegDef->pchClass, pOmfStuff->aGroups[j].pszClass2, pSegDef->cchClass) == 0))
     3929                {
     3930                    pOmfStuff->aGroups[j].fNeeded = true;
     3931                    pSegLines->idxGrp = pOmfStuff->aGroups[j].idxReplaceGrp;
     3932                    break;
     3933                }
    39003934        }
    39013935    }
     
    39603994    pOmfStuff->iSymbolsNm   = UINT16_MAX;
    39613995    pOmfStuff->iSymbolsSeg  = UINT16_MAX;
    3962     pOmfStuff->iCGroup16Nm  = UINT16_MAX;
    3963     pOmfStuff->iCGroup16Grp = UINT16_MAX;
    39643996
    39653997    /* Dummy entries. */
     
    39734005    OMF_GROW_TABLE_RET_ERR(OMFGRPDEF, pOmfStuff->paGrpDefs, pOmfStuff->cGrpDefs, 16);
    39744006    pOmfStuff->cGrpDefs = 1;
     4007
     4008    /* Groups we seek. */
     4009#define OMF_INIT_WANTED_GROUP(a_idx, a_szName, a_szClass1, a_szClass2, a_idxReplace) \
     4010        pOmfStuff->aGroups[a_idx].pszName   = a_szName; \
     4011        pOmfStuff->aGroups[a_idx].cchName   = sizeof(a_szName) - 1; \
     4012        pOmfStuff->aGroups[a_idx].pszClass1 = a_szClass1; \
     4013        pOmfStuff->aGroups[a_idx].cchClass1 = sizeof(a_szClass1) - 1; \
     4014        pOmfStuff->aGroups[a_idx].pszClass2 = a_szClass2; \
     4015        pOmfStuff->aGroups[a_idx].cchClass2 = sizeof(a_szClass2) - 1; \
     4016        pOmfStuff->aGroups[a_idx].fNeeded   = false; \
     4017        pOmfStuff->aGroups[a_idx].idxGroup  = UINT16_MAX; \
     4018        pOmfStuff->aGroups[a_idx].idxName   = UINT16_MAX; \
     4019        pOmfStuff->aGroups[a_idx].idxReplaceGrp = a_idxReplace
     4020    OMF_INIT_WANTED_GROUP(0, "CGROUP16",         "BS3CLASS16CODE",   "CODE", OMF_REPLACE_GRP_CGROUP16);
     4021    OMF_INIT_WANTED_GROUP(1, "BS3GROUPRMTEXT16", "BS3CLASS16RMCODE", "",     OMF_REPLACE_GRP_RMCODE);
     4022    OMF_INIT_WANTED_GROUP(2, "BS3GROUPX0TEXT16", "BS3CLASS16X0CODE", "",     OMF_REPLACE_GRP_X0CODE);
     4023    OMF_INIT_WANTED_GROUP(3, "BS3GROUPX1TEXT16", "BS3CLASS16X1CODE", "",     OMF_REPLACE_GRP_X1CODE);
    39754024
    39764025    /*
     
    40484097                    if (IS_OMF_STR_EQUAL_EX(cch, &pbRec[offRec + 1], "$$SYMBOLS"))
    40494098                        pOmfStuff->iSymbolsNm = pOmfStuff->cLNames;
    4050                     if (IS_OMF_STR_EQUAL_EX(cch, &pbRec[offRec + 1], "CGROUP16"))
    4051                         pOmfStuff->iCGroup16Nm = pOmfStuff->cLNames;
     4099
     4100                    unsigned j = RT_ELEMENTS(pOmfStuff->aGroups);
     4101                    while (j-- > 0)
     4102                        if (   cch == pOmfStuff->aGroups[j].cchName
     4103                            && memcmp(&pbRec[offRec + 1], pOmfStuff->aGroups[j].pszName, pOmfStuff->aGroups[j].cchName) == 0)
     4104                        {
     4105                            pOmfStuff->aGroups[j].idxName = pOmfStuff->cLNames;
     4106                            break;
     4107                        }
    40524108
    40534109                    pOmfStuff->cLNames++;
     
    41994255                OMF_READ_IDX(pGrpDef->idxName, GRPDEF);
    42004256                OMF_EXPLODE_LNAME(pGrpDef->idxName, pGrpDef->pchName, pGrpDef->cchName, GRPDEF);
    4201                 if (pGrpDef->idxName == pOmfStuff->iCGroup16Grp)
    4202                     pOmfStuff->iCGroup16Grp = pOmfStuff->cGrpDefs;
     4257
     4258                unsigned j = RT_ELEMENTS(pOmfStuff->aGroups);
     4259                while (j-- > 0)
     4260                    if (pGrpDef->idxName == pOmfStuff->aGroups[j].idxName)
     4261                    {
     4262                        pOmfStuff->aGroups[j].idxGroup = pOmfStuff->cGrpDefs;
     4263                        break;
     4264                    }
    42034265
    42044266                pGrpDef->cSegDefs    = 0;
     
    43664428static bool convertOmfWriteDebugGrpDefs(POMFWRITER pThis, POMFDETAILS pOmfStuff)
    43674429{
    4368     if (   pOmfStuff->cSegLines == 0
    4369         || !pOmfStuff->fNeedsCGroup16)
     4430    if (pOmfStuff->cSegLines == 0)
    43704431        return true;
    43714432
    4372     if (pOmfStuff->iCGroup16Grp == UINT16_MAX)
    4373     {
    4374         if (pOmfStuff->iCGroup16Nm == UINT16_MAX)
    4375             if (   !omfWriter_LNamesBegin(pThis, true)
    4376                 || !omfWriter_LNamesAdd(pThis, "CGROUP16", &pOmfStuff->iCGroup16Nm)
    4377                 || !omfWriter_LNamesEnd(pThis))
    4378                 return false;
    4379 
    4380         if (   !omfWriter_GrpDefBegin(pThis, pOmfStuff->iCGroup16Nm)
    4381             || !omfWriter_GrpDefEnd(pThis))
     4433    /*
     4434     * See what (if anything) we need.
     4435     */
     4436    uint8_t cNames  = 0;
     4437    uint8_t cGroups = 0;
     4438    unsigned j = RT_ELEMENTS(pOmfStuff->aGroups);
     4439    while (j-- > 0)
     4440        if (pOmfStuff->aGroups[j].fNeeded)
     4441        {
     4442            cNames  += pOmfStuff->aGroups[j].idxName  == UINT16_MAX;
     4443            cGroups += pOmfStuff->aGroups[j].idxGroup == UINT16_MAX;
     4444        }
     4445
     4446    /*
     4447     * Add any names we need.
     4448     */
     4449    if (cNames)
     4450    {
     4451        if (!omfWriter_LNamesBegin(pThis, true))
    43824452            return false;
    4383         pOmfStuff->iCGroup16Grp = pOmfStuff->cGrpDefs;
    4384     }
    4385 
    4386     for (unsigned i = 0; i < pOmfStuff->cSegLines; i++)
    4387         if (pOmfStuff->paSegLines[i].idxGrp == 0)
    4388             pOmfStuff->paSegLines[i].idxGrp = pOmfStuff->iCGroup16Grp;
     4453        j = RT_ELEMENTS(pOmfStuff->aGroups);
     4454        while (j-- > 0)
     4455            if (   pOmfStuff->aGroups[j].fNeeded
     4456                && pOmfStuff->aGroups[j].idxName == UINT16_MAX)
     4457                if (!omfWriter_LNamesAdd(pThis, pOmfStuff->aGroups[j].pszName, &pOmfStuff->aGroups[j].idxName))
     4458                    return false;
     4459        if (!omfWriter_LNamesEnd(pThis))
     4460            return false;
     4461    }
     4462
     4463    /*
     4464     * Add any groups we need.
     4465     */
     4466    if (cNames)
     4467    {
     4468        uint16_t iGrp = pOmfStuff->cGrpDefs; /* Shouldn't update cGrpDefs as it governs paGrpDefs. */
     4469        j = RT_ELEMENTS(pOmfStuff->aGroups);
     4470        while (j-- > 0)
     4471        {
     4472            if (   pOmfStuff->aGroups[j].fNeeded
     4473                && pOmfStuff->aGroups[j].idxGroup == UINT16_MAX)
     4474            {
     4475                if (   !omfWriter_GrpDefBegin(pThis, pOmfStuff->aGroups[j].idxName)
     4476                    || !omfWriter_GrpDefEnd(pThis))
     4477                    return false;
     4478                pOmfStuff->aGroups[j].idxGroup = iGrp++;
     4479            }
     4480        }
     4481    }
     4482
     4483    /*
     4484     * Replace group references in the segment lines table.
     4485     */
     4486    j = RT_ELEMENTS(pOmfStuff->aGroups);
     4487    while (j-- > 0)
     4488        if (pOmfStuff->aGroups[j].fNeeded)
     4489            for (unsigned i = 0; i < pOmfStuff->cSegLines; i++)
     4490                if (pOmfStuff->paSegLines[i].idxGrp == pOmfStuff->aGroups[j].idxReplaceGrp)
     4491                    pOmfStuff->paSegLines[i].idxGrp = pOmfStuff->aGroups[j].idxGroup;
    43894492    return true;
    43904493}
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-common.mac

    r60527 r60539  
    2626
    2727
     28%define BS3_BEGIN_TEXT16_WITHOUT_GROUP
     29%define BS3_BEGIN_DATA16_WITHOUT_GROUP
     30%define BS3_BEGIN_RMTEXT16_WITHOUT_GROUP
     31%define BS3_BEGIN_X0TEXT16_WITHOUT_GROUP
     32%define BS3_BEGIN_X1TEXT16_WITHOUT_GROUP
     33
    2834%include "bs3kit.mac"
    2935
     
    6470.after_eye_catcher:
    6571
    66 %ifdef ASM_FORMAT_ELF
    67 section BS3TEXT16_NEARSTUBS align=1 progbits alloc exec nowrite
    68 section BS3TEXT16_FARSTUBS  align=1 progbits alloc exec nowrite
    69 section BS3TEXT16_END       align=1 progbits alloc exec nowrite
    70 %else
    7172section _TEXT               align=2 CLASS=BS3CLASS16CODE PUBLIC USE16
    7273section BS3TEXT16_NEARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16
    7374section BS3TEXT16_FARSTUBS  align=1 CLASS=BS3CLASS16CODE PUBLIC USE16
    7475section BS3TEXT16_END       align=1 CLASS=BS3CLASS16CODE PUBLIC USE16
    75 %endif
    7676
    7777BS3_GLOBAL_DATA Bs3Text16_EndOfSegment, 0
    7878
    79 %ifndef ASM_FORMAT_ELF
    80  %ifndef BS3_IS_DOS_EXE
     79%ifndef BS3_IS_DOS_EXE
    8180GROUP CGROUP16 BS3TEXT16 _TEXT BS3TEXT16_NEARSTUBS BS3TEXT16_FARSTUBS BS3TEXT16_END
    82  %else
     81%else
    8382GROUP CGROUP16 BEGTEXT BS3TEXT16 _TEXT BS3TEXT16_NEARSTUBS BS3TEXT16_FARSTUBS BS3TEXT16_END
    84  %endif
    8583%endif
    8684
     
    8987; 16-bit data
    9088;
    91 %define BS3_BEGIN_DATA16_WITHOUT_GROUP
    9289BS3_BEGIN_DATA16
    9390BS3_GLOBAL_DATA Bs3Data16_StartOfSegment, 0
     
    10299    dd  BS3_DATA_NM(Bs3Data64_EndOfSegment) wrt CGROUP16
    103100BS3_GLOBAL_DATA Bs3Text16_Size, 2
    104     dd  BS3_DATA_NM(Bs3Text16_EndOfSegment) wrt CGROUP16
    105 
    106 %ifdef ASM_FORMAT_ELF
    107 section BS3DATA16CONST  align=2   progbits alloc noexec write
    108 section BS3DATA16CONST2 align=2   progbits alloc noexec write
    109 section BS3DATA16_DATA  align=2   progbits alloc noexec write
    110 section BS3DATA16_END   align=2   progbits alloc noexec write
    111 %else
     101    dw  BS3_DATA_NM(Bs3Text16_EndOfSegment) wrt CGROUP16
     102BS3_GLOBAL_DATA Bs3X0Text16_Size, 2
     103    dw  BS3_DATA_NM(Bs3X0Text16_EndOfSegment) wrt BS3GROUPX0TEXT16
     104BS3_GLOBAL_DATA Bs3X1Text16_Size, 2
     105    dw  BS3_DATA_NM(Bs3X1Text16_EndOfSegment) wrt BS3GROUPX1TEXT16
     106BS3_GLOBAL_DATA Bs3X0Text16_FlatAddr, 4
     107    dd  BS3_DATA_NM(Bs3X0Text16_StartOfSegment) wrt BS3FLAT
     108BS3_GLOBAL_DATA Bs3X1Text16_FlatAddr, 4
     109    dd  BS3_DATA_NM(Bs3X1Text16_StartOfSegment) wrt BS3FLAT
     110
    112111section BS3DATA16CONST  align=2   CLASS=BS3KIT_CLASS_DATA16 PUBLIC USE16
    113112section BS3DATA16CONST2 align=2   CLASS=BS3KIT_CLASS_DATA16 PUBLIC USE16
    114113section BS3DATA16_DATA  align=2   CLASS=BS3KIT_CLASS_DATA16 PUBLIC USE16
    115  %ifdef BS3_IS_DOS_EXE
     114%ifdef BS3_IS_DOS_EXE
    116115section _NULL           align=16  CLASS=BEGDATA  PUBLIC USE16
    117116section _AFTERNULL      align=2   CLASS=BEGDATA  PUBLIC USE16
    118  %endif
     117%endif
    119118section CONST           align=2   CLASS=DATA     PUBLIC USE16
    120119section CONST2          align=2   CLASS=DATA     PUBLIC USE16
    121120section _DATA           align=2   CLASS=DATA     PUBLIC USE16
    122  %ifdef BS3_IS_DOS_EXE
     121%ifdef BS3_IS_DOS_EXE
    123122section XIB             align=1   CLASS=DATA     PUBLIC USE16
    124123section XI              align=1   CLASS=DATA     PUBLIC USE16
     
    127126section YI              align=1   CLASS=DATA     PUBLIC USE16
    128127section YIE             align=1   CLASS=DATA     PUBLIC USE16
    129  %endif
     128%endif
    130129section STRINGS         align=2   CLASS=DATA     PUBLIC USE16
    131130section DATA            align=2   CLASS=DATA     PUBLIC USE16
    132131section _BSS            align=2   CLASS=BS3KIT_CLASS_BSS16 PUBLIC USE16
    133132section BSS             align=2   CLASS=BS3KIT_CLASS_BSS16 PUBLIC USE16
    134  %ifdef BS3_IS_DOS_EXE
     133%ifdef BS3_IS_DOS_EXE
    135134section STACK           align=16  CLASS=STACK    STACK  USE16
    136  %endif
     135%endif
    137136section BS3DATA16_END   align=2   CLASS=BS3KIT_CLASS_BSS16 PUBLIC USE16
    138 %endif
    139137
    140138BS3_GLOBAL_DATA Bs3Data16_EndOfSegment, 0
    141139
    142 %ifndef ASM_FORMAT_ELF
    143  %ifndef BS3_IS_DOS_EXE
     140%ifndef BS3_IS_DOS_EXE
    144141GROUP BS3KIT_GRPNM_DATA16 BS3DATA16 BS3DATA16_DATA _DATA DATA BS3DATA16CONST CONST BS3DATA16CONST2 CONST2 STRINGS _BSS BSS BS3DATA16_END
    145  %else
     142%else
    146143GROUP BS3KIT_GRPNM_DATA16 \
    147144    _NULL _AFTERNULL \
     
    149146    _BSS BSS BS3DATA16_END \
    150147    STACK
    151  %endif
    152148%endif
    153149
     
    155151; 16-bit real-mode text
    156152;
    157 %ifdef ASM_FORMAT_ELF
    158 section BS3RMTEXT16_START   align=16 progbits alloc exec nowrite
    159 %else
    160153section BS3RMTEXT16_START   align=16 CLASS=BS3CLASS16RMCODE PUBLIC USE16
    161 %endif
    162154BS3_GLOBAL_DATA Bs3RmText16_StartOfSegment, 0
    163155    db      10,13,'eye-catcher: BS3RMTEXT16',10,13
    164 
    165156BS3_BEGIN_RMTEXT16
    166 
    167 %ifdef ASM_FORMAT_ELF
    168 section BS3RMTEXT16_END   align=1 progbits alloc exec nowrite
    169 %else
    170157section BS3RMTEXT16_END   align=1 CLASS=BS3CLASS16RMCODE PUBLIC USE16
    171 %endif
    172 
    173158BS3_GLOBAL_DATA Bs3RmText16_EndOfSegment, 0
     159
     160
     161;
     162; 16-bit extra text segment #0.
     163;
     164section BS3X0TEXT16_START   align=16 CLASS=BS3CLASS16X0CODE PUBLIC USE16
     165BS3_GLOBAL_DATA Bs3X0Text16_StartOfSegment, 0
     166    db      10,13,'eye-catcher: BS3X0TEXT16',10,13
     167BS3_BEGIN_X0TEXT16 4
     168section BS3X0TEXT16_END   align=16 CLASS=BS3CLASS16X0CODE PUBLIC USE16
     169BS3_GLOBAL_DATA Bs3X0Text16_EndOfSegment, 0
     170GROUP BS3GROUPX0TEXT16 BS3X0TEXT16_START BS3X0TEXT16 BS3X0TEXT16_END
     171
     172
     173;
     174; 16-bit extra text segment #1.
     175;
     176section BS3X1TEXT16_START   align=16 CLASS=BS3CLASS16X1CODE PUBLIC USE16
     177BS3_GLOBAL_DATA Bs3X1Text16_StartOfSegment, 0
     178    db      10,13,'eye-catcher: BS3X1TEXT16',10,13
     179BS3_BEGIN_X1TEXT16 4
     180section BS3X1TEXT16_END   align=16 CLASS=BS3CLASS16X1CODE PUBLIC USE16
     181BS3_GLOBAL_DATA Bs3X1Text16_EndOfSegment, 0
     182GROUP BS3GROUPX1TEXT16 BS3X1TEXT16_START BS3X1TEXT16 BS3X1TEXT16_END
    174183
    175184
     
    180189BS3_GLOBAL_DATA Bs3Text32_StartOfSegment, 0
    181190    db      10,13,'eye-catcher: BS3TEXT32',10,13
    182 
    183 %ifdef ASM_FORMAT_ELF
    184 section BS3TEXT32_END   align=1 progbits alloc exec nowrite
    185 %else
    186191section BS3TEXT32_END   align=1 CLASS=BS3CLASS32CODE PUBLIC USE32 FLAT
    187 %endif
    188192BS3_GLOBAL_DATA Bs3Text32_EndOfSegment, 0
    189193
     
    195199BS3_GLOBAL_DATA Bs3Text64_StartOfSegment, 0
    196200    db      10,13,'eye-catcher: BS3TEXT64',10,13
    197 
    198 %ifdef ASM_FORMAT_ELF
    199 section BS3TEXT64_END   align=1 progbits alloc exec nowrite
    200 %else
    201201section BS3TEXT64_END   align=1 CLASS=BS3CLASS64CODE PUBLIC USE32 FLAT
    202 %endif
    203202BS3_GLOBAL_DATA Bs3Text64_EndOfSegment, 0
    204203
     
    217216BS3_GLOBAL_DATA Bs3Data32_StartOfSegment, 0
    218217    db      10,13,'eye-catcher: BS3DATA32',10,13
    219 %ifdef ASM_FORMAT_ELF
    220 section BS3DATA32_END   align=16   progbits alloc noexec write
    221 %else
    222218section BS3DATA32CONST  align=16   CLASS=FAR_DATA PUBLIC USE32
    223219section BS3DATA32CONST2 align=16   CLASS=FAR_DATA PUBLIC USE32
     
    225221section BS3DATA32_BSS   align=16   CLASS=FAR_DATA PUBLIC USE32
    226222section BS3DATA32_END   align=16   CLASS=FAR_DATA PUBLIC USE32
    227 %endif
    228223BS3_GLOBAL_DATA Bs3Data32_EndOfSegment, 0
    229 
    230 %ifndef ASM_FORMAT_ELF
    231224GROUP BS3DATA32_GROUP BS3DATA32 BS3DATA32_DATA BS3DATA32CONST BS3DATA32CONST2 BS3DATA32_BSS BS3DATA32_END
    232 %endif
    233225
    234226;
     
    238230BS3_GLOBAL_DATA Bs3Data64_StartOfSegment, 0
    239231    db      10,13,'eye-catcher: BS3DATA64',10,13
    240 %ifdef ASM_FORMAT_ELF
    241 section BS3DATA64_END   align=16   progbits alloc noexec write
    242 %else
    243232section BS3DATA64CONST  align=16   CLASS=FAR_DATA PUBLIC USE32
    244233section BS3DATA64_BSS   align=16   CLASS=FAR_DATA PUBLIC USE32
    245234section BS3DATA64_END   align=16   CLASS=FAR_DATA PUBLIC USE32
    246 %endif
    247235BS3_GLOBAL_DATA Bs3Data64_EndOfSegment, 0
    248 
    249 %ifndef ASM_FORMAT_ELF
    250236GROUP BS3DATA64_GROUP BS3DATA64 BS3DATA64CONST BS3DATA64_BSS BS3DATA64_END
    251 %endif
    252237
    253238
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-dosexe.asm

    r60439 r60539  
    2626
    2727
    28 %include "bs3kit.mac"
    29 
    3028;
    3129; Segment defs, grouping and related variables.
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-pe16.asm

    r59932 r60539  
    2929;*  Header Files                                                                                                                 *
    3030;*********************************************************************************************************************************
    31 %include "bs3kit.mac"
    3231
    3332;
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-rm.asm

    r60439 r60539  
    2626
    2727
    28 
    29 %include "bs3kit.mac"
    30 
    3128;
    3229; Segment defs, grouping and related variables.
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModes.c

    r60311 r60539  
    4040 * in 32-bit and 64-bit modes it is already flat.
    4141 */
    42 /** @def CONV_TO_BS3TEXT16
    43  * Get BS3TEXT16 relative address. In 32-bit and 64-bit mode this is a flat
    44  * address, while in 16-bit it is alreay a BS3TEXT16 relative address.
     42/** @def CONV_TO_PROT_FAR16
     43 * Get a 32-bit value that makes a protected mode far 16:16 address.
     44 */
     45/** @def CONV_TO_RM_FAR16
     46 * Get a 32-bit value that makes a real mode far 16:16 address.  In 16-bit mode
     47 * this is already what we've got, except must be converted to uint32_t.
    4548 */
    4649#if ARCH_BITS == 16
    4750# define CONV_TO_FLAT(a_fpfn)           (((uint32_t)BS3_FP_SEG(a_fpfn) << 4) + BS3_FP_OFF(a_fpfn))
    48 # define CONV_TO_BS3TEXT16(a_pfn)       ((uint16_t)(a_pfn))
     51# define CONV_TO_PROT_FAR16(a_fpfn)     RT_MAKE_U32(BS3_FP_OFF(a_fpfn), Bs3SelRealModeCodeToProtMode(BS3_FP_SEG(a_fpfn)))
     52# define CONV_TO_RM_FAR16(a_fpfn)       RT_MAKE_U32(BS3_FP_OFF(a_fpfn), BS3_FP_SEG(a_fpfn))
    4953#else
    5054# define CONV_TO_FLAT(a_fpfn)           ((uint32_t)(uintptr_t)(a_fpfn))
    51 # define CONV_TO_BS3TEXT16(a_pfn)       ((uint16_t)(uintptr_t)(a_pfn))
     55# define CONV_TO_PROT_FAR16(a_fpfn)     Bs3SelFlatCodeToProtFar16((uint32_t)(uintptr_t)(a_fpfn))
     56# define CONV_TO_RM_FAR16(a_fpfn)       Bs3SelFlatCodeToRealMode( (uint32_t)(uintptr_t)(a_fpfn))
    5257#endif
    5358
     
    5661*   Assembly Symbols                                                                                                             *
    5762*********************************************************************************************************************************/
    58 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInRM)(uint16_t offCallback);
    59 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16)(uint16_t offCallback);
     63BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInRM)(uint32_t uCallbackFarPtr);
     64BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16)(uint32_t uCallbackFarPtr);
    6065BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_32)(uint32_t uFlatAddrCallback);
    61 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_V86)(uint16_t offCallback);
     66BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_V86)(uint32_t uCallbackFarPtr);
    6267BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE32)(uint32_t uFlatAddrCallback);
    63 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE32_16)(uint16_t offCallback);
    64 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPEV86)(uint16_t offCallback);
    65 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16)(uint16_t offCallback);
     68BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE32_16)(uint32_t uCallbackFarPtr);
     69BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPEV86)(uint32_t uCallbackFarPtr);
     70BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16)(uint32_t uCallbackFarPtr);
    6671BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_32)(uint32_t uFlatAddrCallback);
    67 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_V86)(uint16_t offCallback);
     72BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_V86)(uint32_t uCallbackFarPtr);
    6873BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP32)(uint32_t uFlatAddrCallback);
    69 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP32_16)(uint16_t offCallback);
    70 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPPV86)(uint16_t offCallback);
    71 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16)(uint16_t offCallback);
     74BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP32_16)(uint32_t uCallbackFarPtr);
     75BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPPV86)(uint32_t uCallbackFarPtr);
     76BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16)(uint32_t uCallbackFarPtr);
    7277BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_32)(uint32_t uFlatAddrCallback);
    73 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_V86)(uint16_t offCallback);
     78BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_V86)(uint32_t uCallbackFarPtr);
    7479BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32)(uint32_t uFlatAddrCallback);
    75 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32_16)(uint16_t offCallback);
    76 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAEV86)(uint16_t offCallback);
    77 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM16)(uint16_t offCallback);
     80BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32_16)(uint32_t uCallbackFarPtr);
     81BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAEV86)(uint32_t uCallbackFarPtr);
     82BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM16)(uint32_t uCallbackFarPtr);
    7883BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM32)(uint32_t uFlatAddrCallback);
    7984BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM64)(uint32_t uFlatAddrCallback);
     
    210215        {
    211216            PRE_DO_CALL(g_szBs3ModeName_rm);
    212             bErrNo = TMPL_NM(Bs3TestCallDoerInRM)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoRM));
     217            bErrNo = TMPL_NM(Bs3TestCallDoerInRM)(CONV_TO_RM_FAR16(paEntries[i].pfnDoRM));
    213218            CHECK_RESULT(g_szBs3ModeName_rm);
    214219        }
     
    227232        {
    228233            PRE_DO_CALL(g_szBs3ModeName_pe16);
    229             bErrNo = TMPL_NM(Bs3TestCallDoerInPE16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPE16));
     234            bErrNo = TMPL_NM(Bs3TestCallDoerInPE16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPE16));
    230235            CHECK_RESULT(g_szBs3ModeName_pe16);
    231236        }
     
    247252        {
    248253            PRE_DO_CALL(g_szBs3ModeName_pe16_v86);
    249             bErrNo = TMPL_NM(Bs3TestCallDoerInPE16_V86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPE16_V86));
     254            bErrNo = TMPL_NM(Bs3TestCallDoerInPE16_V86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPE16_V86));
    250255            CHECK_RESULT(g_szBs3ModeName_pe16_v86);
    251256        }
     
    261266        {
    262267            PRE_DO_CALL(g_szBs3ModeName_pe32_16);
    263             bErrNo = TMPL_NM(Bs3TestCallDoerInPE32_16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPE32_16));
     268            bErrNo = TMPL_NM(Bs3TestCallDoerInPE32_16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPE32_16));
    264269            CHECK_RESULT(g_szBs3ModeName_pe32_16);
    265270        }
     
    268273        {
    269274            PRE_DO_CALL(g_szBs3ModeName_pev86);
    270             bErrNo = TMPL_NM(Bs3TestCallDoerInPEV86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPEV86));
     275            bErrNo = TMPL_NM(Bs3TestCallDoerInPEV86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPEV86));
    271276            CHECK_RESULT(g_szBs3ModeName_pev86);
    272277        }
     
    278283        {
    279284            PRE_DO_CALL(g_szBs3ModeName_pp16);
    280             bErrNo = TMPL_NM(Bs3TestCallDoerInPP16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPP16));
     285            bErrNo = TMPL_NM(Bs3TestCallDoerInPP16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPP16));
    281286            CHECK_RESULT(g_szBs3ModeName_pp16);
    282287        }
     
    292297        {
    293298            PRE_DO_CALL(g_szBs3ModeName_pp16_v86);
    294             bErrNo = TMPL_NM(Bs3TestCallDoerInPP16_V86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPP16_V86));
     299            bErrNo = TMPL_NM(Bs3TestCallDoerInPP16_V86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPP16_V86));
    295300            CHECK_RESULT(g_szBs3ModeName_pp16_v86);
    296301        }
     
    306311        {
    307312            PRE_DO_CALL(g_szBs3ModeName_pp32_16);
    308             bErrNo = TMPL_NM(Bs3TestCallDoerInPP32_16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPP32_16));
     313            bErrNo = TMPL_NM(Bs3TestCallDoerInPP32_16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPP32_16));
    309314            CHECK_RESULT(g_szBs3ModeName_pp32_16);
    310315        }
     
    313318        {
    314319            PRE_DO_CALL(g_szBs3ModeName_ppv86);
    315             bErrNo = TMPL_NM(Bs3TestCallDoerInPPV86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPPV86));
     320            bErrNo = TMPL_NM(Bs3TestCallDoerInPPV86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPPV86));
    316321            CHECK_RESULT(g_szBs3ModeName_ppv86);
    317322        }
     
    330335        {
    331336            PRE_DO_CALL(g_szBs3ModeName_pae16);
    332             bErrNo = TMPL_NM(Bs3TestCallDoerInPAE16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAE16));
     337            bErrNo = TMPL_NM(Bs3TestCallDoerInPAE16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPAE16));
    333338            CHECK_RESULT(g_szBs3ModeName_pae16);
    334339        }
     
    344349        {
    345350            PRE_DO_CALL(g_szBs3ModeName_pae16_v86);
    346             bErrNo = TMPL_NM(Bs3TestCallDoerInPAE16_V86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAE16_V86));
     351            bErrNo = TMPL_NM(Bs3TestCallDoerInPAE16_V86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPAE16_V86));
    347352            CHECK_RESULT(g_szBs3ModeName_pae16_v86);
    348353        }
     
    358363        {
    359364            PRE_DO_CALL(g_szBs3ModeName_pae32_16);
    360             bErrNo = TMPL_NM(Bs3TestCallDoerInPAE32_16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAE32_16));
     365            bErrNo = TMPL_NM(Bs3TestCallDoerInPAE32_16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPAE32_16));
    361366            CHECK_RESULT(g_szBs3ModeName_pae32_16);
    362367        }
     
    365370        {
    366371            PRE_DO_CALL(g_szBs3ModeName_paev86);
    367             bErrNo = TMPL_NM(Bs3TestCallDoerInPAEV86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAEV86));
     372            bErrNo = TMPL_NM(Bs3TestCallDoerInPAEV86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPAEV86));
    368373            CHECK_RESULT(g_szBs3ModeName_paev86);
    369374        }
     
    382387        {
    383388            PRE_DO_CALL(g_szBs3ModeName_lm16);
    384             bErrNo = TMPL_NM(Bs3TestCallDoerInLM16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoLM16));
     389            bErrNo = TMPL_NM(Bs3TestCallDoerInLM16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoLM16));
    385390            CHECK_RESULT(g_szBs3ModeName_lm16);
    386391        }
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModesHlp.asm

    r60439 r60539  
    219219BS3_SET_BITS TMPL_BITS
    220220.doit:
    221         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     221        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     222        mov     dx, [xBP + xCB*2 + 2]
    222223
    223224        ; Mode switch, make the call, switch back.
     
    229230        mov     cx, BS3_MODE_RM
    230231        push    cx
    231         call    ax
     232        push    cs
     233        mov     cx, .return
     234        push    cx
     235        push    dx
     236        push    ax
     237        retf
     238.return:
    232239
    233240        STRICT_SAVE_REGS
     
    253260BS3_SET_BITS TMPL_BITS
    254261.doit:
    255         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     262        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     263        mov     dx, [xBP + xCB*2 + 2]
    256264
    257265        ; Mode switch, make the call, switch back.
     
    262270
    263271        push    BS3_MODE_PE16
    264         call    ax
     272        push    cs
     273        push    .return
     274        push    dx
     275        push    ax
     276        retf
     277.return:
    265278
    266279        STRICT_SAVE_REGS
     
    303316        jmp     TMPL_NM(bs3TestCallDoerPrologue)
    304317.doit:
    305         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     318        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     319        mov     dx, [xBP + xCB*2 + 2]
    306320
    307321        ; Mode switch, make the call, switch back.
     
    312326
    313327        push    BS3_MODE_PE16_V86
    314         call    ax
     328        push    cs
     329        push    .return
     330        push    dx
     331        push    ax
     332        retf
     333.return:
    315334
    316335        STRICT_SAVE_REGS
     
    355374BS3_SET_BITS TMPL_BITS
    356375.doit:
    357         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     376        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     377        mov     dx, [xBP + xCB*2 + 2]
    358378
    359379        ; Mode switch, make the call, switch back.
     
    364384
    365385        push    BS3_MODE_PE32_16
    366         call    ax
     386        push    cs
     387        push    .return
     388        push    dx
     389        push    ax
     390        retf
     391.return:
    367392
    368393        STRICT_SAVE_REGS
     
    383408BS3_SET_BITS TMPL_BITS
    384409.doit:
    385         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     410        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     411        mov     dx, [xBP + xCB*2 + 2]
    386412
    387413        ; Mode switch, make the call, switch back.
     
    392418
    393419        push    BS3_MODE_PEV86
    394         call    ax
     420        push    cs
     421        push    .return
     422        push    dx
     423        push    ax
     424        retf
     425.return:
    395426
    396427        STRICT_SAVE_REGS
     
    417448BS3_SET_BITS TMPL_BITS
    418449.doit:
    419         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     450        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     451        mov     dx, [xBP + xCB*2 + 2]
    420452
    421453        ; Mode switch, make the call, switch back.
     
    426458
    427459        push    BS3_MODE_PP16
    428         call    ax
     460        push    cs
     461        push    .return
     462        push    dx
     463        push    ax
     464        retf
     465.return:
    429466
    430467        STRICT_SAVE_REGS
     
    468505        jmp     TMPL_NM(bs3TestCallDoerPrologue)
    469506.doit:
    470         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     507        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     508        mov     dx, [xBP + xCB*2 + 2]
    471509
    472510        ; Mode switch, make the call, switch back.
     
    477515
    478516        push    BS3_MODE_PP16_V86
    479         call    ax
     517        push    cs
     518        push    .return
     519        push    dx
     520        push    ax
     521        retf
     522.return:
    480523
    481524        STRICT_SAVE_REGS
     
    520563BS3_SET_BITS TMPL_BITS
    521564.doit:
    522         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     565        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     566        mov     dx, [xBP + xCB*2 + 2]
    523567
    524568        ; Mode switch, make the call, switch back.
     
    529573
    530574        push    BS3_MODE_PP32_16
    531         call    ax
     575        push    cs
     576        push    .return
     577        push    dx
     578        push    ax
     579        retf
     580.return:
    532581
    533582        STRICT_SAVE_REGS
     
    548597BS3_SET_BITS TMPL_BITS
    549598.doit:
    550         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     599        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     600        mov     dx, [xBP + xCB*2 + 2]
    551601
    552602        ; Mode switch, make the call, switch back.
     
    557607
    558608        push    BS3_MODE_PPV86
    559         call    ax
     609        push    cs
     610        push    .return
     611        push    dx
     612        push    ax
     613        retf
     614.return:
    560615
    561616        STRICT_SAVE_REGS
     
    582637BS3_SET_BITS TMPL_BITS
    583638.doit:
    584         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     639        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     640        mov     dx, [xBP + xCB*2 + 2]
    585641
    586642        ; Mode switch, make the call, switch back.
     
    591647
    592648        push    BS3_MODE_PAE16
    593         call    ax
     649        push    cs
     650        push    .return
     651        push    dx
     652        push    ax
     653        retf
     654.return:
    594655
    595656        STRICT_SAVE_REGS
     
    633694        jmp     TMPL_NM(bs3TestCallDoerPrologue)
    634695.doit:
    635         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     696        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     697        mov     dx, [xBP + xCB*2 + 2]
    636698
    637699        ; Mode switch, make the call, switch back.
     
    642704
    643705        push    BS3_MODE_PAE16_V86
    644         call    ax
     706        push    cs
     707        push    .return
     708        push    dx
     709        push    ax
     710        retf
     711.return:
    645712
    646713        STRICT_SAVE_REGS
     
    685752BS3_SET_BITS TMPL_BITS
    686753.doit:
    687         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     754        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     755        mov     dx, [xBP + xCB*2 + 2]
    688756
    689757        ; Mode switch, make the call, switch back.
     
    694762
    695763        push    BS3_MODE_PAE32_16
    696         call    ax
     764        push    cs
     765        push    .return
     766        push    dx
     767        push    ax
     768        retf
     769.return:
    697770
    698771        STRICT_SAVE_REGS
     
    713786BS3_SET_BITS TMPL_BITS
    714787.doit:
    715         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     788        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     789        mov     dx, [xBP + xCB*2 + 2]
    716790
    717791        ; Mode switch, make the call, switch back.
     
    722796
    723797        push    BS3_MODE_PAEV86
    724         call    ax
     798        push    cs
     799        push    .return
     800        push    dx
     801        push    ax
     802        retf
     803.return:
    725804
    726805        STRICT_SAVE_REGS
     
    747826BS3_SET_BITS TMPL_BITS
    748827.doit:
    749         mov     ax, [xBP + xCB*2]       ; Load function pointer.
     828        mov     ax, [xBP + xCB*2]       ; Load far function pointer.
     829        mov     dx, [xBP + xCB*2 + 2]
    750830
    751831        ; Mode switch, make the call, switch back.
     
    756836
    757837        push    BS3_MODE_LM16
    758         call    ax
     838        push    cs
     839        push    .return
     840        push    dx
     841        push    ax
     842        retf
     843.return:
    759844
    760845        STRICT_SAVE_REGS
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c

    r60527 r60539  
    4343    Bs3CpuDetect_rm();
    4444    Bs3InitMemory_rm();
     45    Bs3InitGdt_rm();
    4546
    4647    ASMIntDisable();
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-system-data.asm

    r60439 r60539  
    178178        dw  00000h, 00000h, 00000h, 00000h      ; Entry 0d8h - currently unused
    179179        dw  00000h, 00000h, 00000h, 00000h      ; Entry 0e0h - currently unused
    180         dw  00000h, 00000h, 00000h, 00000h      ; Entry 0e8h - currently unused
    181         dw  00000h, 00000h, 00000h, 00000h      ; Entry 0f0h - currently unused
    182180
    183181        ; Misc selectors.
     182BS3_GLOBAL_DATA Bs3Gdte_X0TEXT16_CS, 8          ; Entry 0e8h
     183        dw  0fffeh, 00000h                      ; 16-bit conforming code (read+exec) segment, accessed. Will be finalized at startup.
     184        dw  09f00h, 00000h
     185BS3_GLOBAL_DATA Bs3Gdte_X1TEXT16_CS, 8          ; Entry 0f0h
     186        dw  0fffeh, 00000h                      ; 16-bit conforming code (read+exec) segment, accessed. Will be finalized at startup.
     187        dw  09f00h, 00000h
    184188BS3_GLOBAL_DATA Bs3Gdte_R0_MMIO16, 8            ; Entry 0f8h
    185189        dw  0ffffh, 00000h, 09310h, 00000h      ; 16-bit VMMDev MMIO segment with base 0100000h.
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r60527 r60539  
    6060#define Bs3RegCtxRestore                        BS3_CMN_MANGLER(Bs3RegCtxRestore)
    6161#define Bs3RegCtxSave                           BS3_CMN_MANGLER(Bs3RegCtxSave)
     62#define Bs3SelFlatCodeToRealMode                BS3_CMN_MANGLER(Bs3SelFlatCodeToRealMode)
     63#define Bs3SelFlatCodeToProtFar16               BS3_CMN_MANGLER(Bs3SelFlatCodeToProtFar16)
    6264#define Bs3SelFar32ToFlat32                     BS3_CMN_MANGLER(Bs3SelFar32ToFlat32)
    6365#define Bs3SelProtFar32ToFlat32                 BS3_CMN_MANGLER(Bs3SelProtFar32ToFlat32)
     66#define Bs3SelRealModeCodeToProtMode            BS3_CMN_MANGLER(Bs3SelRealModeCodeToProtMode)
    6467#define Bs3Shutdown                             BS3_CMN_MANGLER(Bs3Shutdown)
    6568#define Bs3SlabAlloc                            BS3_CMN_MANGLER(Bs3SlabAlloc)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r60527 r60539  
    11/* $Id$ */
    22/** @file
    3  * BS3Kit - Undefining function mangling - automatically generated by bs3kit-mangling-functions-undef.h in Makefile.
     3 * BS3Kit - Undefining function mangling - automatically generated by the bs3kit-mangling-code-undef.h makefile rule.
    44 */
    55
     
    6060#undef Bs3RegCtxRestore
    6161#undef Bs3RegCtxSave
     62#undef Bs3SelFlatCodeToRealMode
     63#undef Bs3SelFlatCodeToProtFar16
    6264#undef Bs3SelFar32ToFlat32
    6365#undef Bs3SelProtFar32ToFlat32
     66#undef Bs3SelRealModeCodeToProtMode
    6467#undef Bs3Shutdown
    6568#undef Bs3SlabAlloc
     
    105108#undef Bs3TrapRmV86SetGate
    106109#undef Bs3TrapSetHandler
     110#undef Bs3TrapSetJmp
    107111#undef Bs3TrapSetJmpAndRestore
    108112#undef Bs3TrapUnsetJmp
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r60527 r60539  
    228228#define BS3_SEL_TSS64_IOBP          0x00a0 /**< The 64-bit TSS selector. */
    229229
     230#define BS3_SEL_X0TEXT16_CS         0x00e8 /**< Conforming code selector for accessing the BS3X0TEXT16 segment. Runtime config. */
     231#define BS3_SEL_X1TEXT16_CS         0x00f0 /**< Conforming code selector for accessing the BS3X0TEXT16 segment. Runtime config. */
    230232#define BS3_SEL_VMMDEV_MMIO16       0x00f8 /**< Selector for accessing the VMMDev MMIO segment at 0100000h from 16-bit code. */
    231233
     
    554556 *
    555557 * @param   a_Name      The name of the function or global variable.
    556  * @todo fix code vs data issue with _f16
    557558 */
    558559#define BS3_CMN_NM(a_Name)      RT_CONCAT3(a_Name,_c,ARCH_BITS)
     
    704705extern X86DESC BS3_FAR_DATA Bs3Gdte_Tss64Spare1;            /**< @see BS3_SEL_TSS64_SPARE1 */
    705706extern X86DESC BS3_FAR_DATA Bs3Gdte_Tss64Iobp;              /**< @see BS3_SEL_TSS64_IOBP */
     707extern X86DESC BS3_FAR_DATA Bs3Gdte_X0TEXT16_CS;            /**< @see BS3_SEL_X0TEXT16_CS */
     708extern X86DESC BS3_FAR_DATA Bs3Gdte_X1TEXT16_CS;            /**< @see BS3_SEL_X1TEXT16_CS */
    706709extern X86DESC BS3_FAR_DATA Bs3Gdte_R0_MMIO16;              /**< @see BS3_SEL_VMMDEV_MMIO16 */
    707710
     
    923926extern uint8_t  BS3_FAR_DATA Bs3Data16_EndOfSegment;
    924927
     928/** Start of the BS3RMTEXT16 segment.   */
     929extern uint8_t  BS3_FAR_DATA Bs3RmText16_StartOfSegment;
     930/** End of the BS3RMTEXT16 segment.   */
     931extern uint8_t  BS3_FAR_DATA Bs3RmText16_EndOfSegment;
     932
     933/** Start of the BS3X0TEXT16 segment.   */
     934extern uint8_t  BS3_FAR_DATA Bs3X0Text16_StartOfSegment;
     935/** End of the BS3X0TEXT16 segment.   */
     936extern uint8_t  BS3_FAR_DATA Bs3X0Text16_EndOfSegment;
     937/** The size of the BS3X0TEXT16 segment.   */
     938extern uint16_t BS3_FAR_DATA Bs3X0Text16_Size;
     939/** The flat start address of the BS3X1TEXT16 segment.   */
     940extern uint32_t BS3_FAR_DATA Bs3X0Text16_FlatAddr;
     941
     942/** Start of the BS3X1TEXT16 segment.   */
     943extern uint8_t  BS3_FAR_DATA Bs3X1Text16_StartOfSegment;
     944/** End of the BS3X1TEXT16 segment.   */
     945extern uint8_t  BS3_FAR_DATA Bs3X1Text16_EndOfSegment;
     946/** The size of the BS3X1TEXT16 segment.   */
     947extern uint16_t BS3_FAR_DATA Bs3X1Text16_Size;
     948/** The flat start address of the BS3X1TEXT16 segment.   */
     949extern uint32_t BS3_FAR_DATA Bs3X1Text16_FlatAddr;
     950
    925951/** Start of the BS3TEXT32 segment.   */
    926952extern uint8_t  BS3_FAR_DATA Bs3Text32_StartOfSegment;
     
    14871513BS3_CMN_PROTO(uint32_t, Bs3SelProtFar32ToFlat32,(uint32_t off, uint16_t uSel), true);
    14881514
    1489 
    14901515/**
    14911516 * Converts a current mode 32-bit far pointer to a 32-bit flat address.
     
    14961521 */
    14971522BS3_CMN_PROTO(uint32_t, Bs3SelFar32ToFlat32,(uint32_t off, uint16_t uSel), true);
     1523
     1524/**
     1525 * Converts a real mode code segment to a protected mode code segment selector.
     1526 *
     1527 * @returns protected mode segment selector.
     1528 * @param   uRealSeg        Real mode code segment.
     1529 */
     1530BS3_CMN_PROTO(uint16_t, Bs3SelRealModeCodeToProtMode,(uint16_t uRealSel), false);
     1531
     1532/**
     1533 * Converts a flat code address to a real mode segment and offset.
     1534 *
     1535 * @returns Far real mode address (high 16-bit is segment, low is offset)
     1536 * @param   uFlatAddr       Flat code address.
     1537 */
     1538BS3_CMN_PROTO(uint32_t, Bs3SelFlatCodeToRealMode,(uint32_t uFlatAddr), false);
     1539
     1540/**
     1541 * Converts a flat code address to a protected mode 16-bit far pointer (ring-0).
     1542 *
     1543 * @returns Far 16-bit protected mode address (high 16-bit is segment selector,
     1544 *          low is segment offset).
     1545 * @param   uFlatAddr       Flat code address.
     1546 */
     1547BS3_CMN_PROTO(uint32_t, Bs3SelFlatCodeToProtFar16,(uint32_t uFlatAddr), false);
    14981548
    14991549/**
     
    23192369    const char * BS3_FAR    pszSubTest;
    23202370
    2321     PFNBS3TESTDOMODE        pfnDoRM;
    2322 
    2323     PFNBS3TESTDOMODE        pfnDoPE16;
     2371    FPFNBS3TESTDOMODE       pfnDoRM;
     2372
     2373    FPFNBS3TESTDOMODE       pfnDoPE16;
    23242374    FPFNBS3TESTDOMODE       pfnDoPE16_32;
    2325     PFNBS3TESTDOMODE        pfnDoPE16_V86;
     2375    FPFNBS3TESTDOMODE       pfnDoPE16_V86;
    23262376    FPFNBS3TESTDOMODE       pfnDoPE32;
    2327     PFNBS3TESTDOMODE        pfnDoPE32_16;
    2328     PFNBS3TESTDOMODE        pfnDoPEV86;
    2329 
    2330     PFNBS3TESTDOMODE        pfnDoPP16;
     2377    FPFNBS3TESTDOMODE       pfnDoPE32_16;
     2378    FPFNBS3TESTDOMODE       pfnDoPEV86;
     2379
     2380    FPFNBS3TESTDOMODE       pfnDoPP16;
    23312381    FPFNBS3TESTDOMODE       pfnDoPP16_32;
    2332     PFNBS3TESTDOMODE        pfnDoPP16_V86;
     2382    FPFNBS3TESTDOMODE       pfnDoPP16_V86;
    23332383    FPFNBS3TESTDOMODE       pfnDoPP32;
    2334     PFNBS3TESTDOMODE        pfnDoPP32_16;
    2335     PFNBS3TESTDOMODE        pfnDoPPV86;
    2336 
    2337     PFNBS3TESTDOMODE        pfnDoPAE16;
     2384    FPFNBS3TESTDOMODE       pfnDoPP32_16;
     2385    FPFNBS3TESTDOMODE       pfnDoPPV86;
     2386
     2387    FPFNBS3TESTDOMODE       pfnDoPAE16;
    23382388    FPFNBS3TESTDOMODE       pfnDoPAE16_32;
    2339     PFNBS3TESTDOMODE        pfnDoPAE16_V86;
     2389    FPFNBS3TESTDOMODE       pfnDoPAE16_V86;
    23402390    FPFNBS3TESTDOMODE       pfnDoPAE32;
    2341     PFNBS3TESTDOMODE        pfnDoPAE32_16;
    2342     PFNBS3TESTDOMODE        pfnDoPAEV86;
    2343 
    2344     PFNBS3TESTDOMODE        pfnDoLM16;
     2391    FPFNBS3TESTDOMODE       pfnDoPAE32_16;
     2392    FPFNBS3TESTDOMODE       pfnDoPAEV86;
     2393
     2394    FPFNBS3TESTDOMODE       pfnDoLM16;
    23452395    FPFNBS3TESTDOMODE       pfnDoLM32;
    23462396    FPFNBS3TESTDOMODE       pfnDoLM64;
     
    23802430/** A set of standard protypes to go with #BS3TESTMODEENTRY_CMN. */
    23812431#define BS3TESTMODE_PROTOTYPES_CMN(a_BaseNm) \
    2382     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _c16); \
     2432    FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _c16); \
    23832433    FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _c32); \
    23842434    FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _c64)
     
    24142464/** A set of standard protypes to go with #BS3TESTMODEENTRY_MODE. */
    24152465#define BS3TESTMODE_PROTOTYPES_MODE(a_BaseNm) \
    2416     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _rm); \
    2417     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pe16); \
    2418     FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _pe16_32); \
    2419     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pe16_v86); \
    2420     FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _pe32); \
    2421     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pe32_16); \
    2422     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pev86); \
    2423     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pp16); \
    2424     FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _pp16_32); \
    2425     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pp16_v86); \
    2426     FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _pp32); \
    2427     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pp32_16); \
    2428     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _ppv86); \
    2429     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pae16); \
    2430     FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _pae16_32); \
    2431     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pae16_v86); \
    2432     FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _pae32); \
    2433     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _pae32_16); \
    2434     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _paev86); \
    2435     FNBS3TESTDOMODE                 RT_CONCAT(a_BaseNm, _lm16); \
    2436     FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _lm32); \
    2437     FNBS3TESTDOMODE BS3_FAR_CODE    RT_CONCAT(a_BaseNm, _lm64)
     2466    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _rm); \
     2467    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pe16); \
     2468    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pe16_32); \
     2469    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pe16_v86); \
     2470    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pe32); \
     2471    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pe32_16); \
     2472    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pev86); \
     2473    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pp16); \
     2474    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pp16_32); \
     2475    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pp16_v86); \
     2476    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pp32); \
     2477    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pp32_16); \
     2478    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _ppv86); \
     2479    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pae16); \
     2480    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pae16_32); \
     2481    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pae16_v86); \
     2482    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pae32); \
     2483    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _pae32_16); \
     2484    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _paev86); \
     2485    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _lm16); \
     2486    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _lm32); \
     2487    FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _lm64)
    24382488
    24392489/** @} */
     
    24512501 */
    24522502BS3_DECL_FAR(void) Bs3InitMemory_rm(void);
     2503
     2504/**
     2505 * Initialized the X0TEXT16 and X1TEXT16 GDT entries.
     2506 */
     2507BS3_DECL_FAR(void) Bs3InitGdt_rm(void);
    24532508
    24542509
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac

    r60527 r60539  
    317317
    318318
    319 %macro BS3_BEGIN_TEXT16 0
     319%macro BS3_BEGIN_TEXT16 0-1 2
    320320 %ifndef  BS3_BEGIN_TEXT16_NOT_FIRST
    321321  %define BS3_BEGIN_TEXT16_NOT_FIRST
    322   %ifdef ASM_FORMAT_ELF
    323         section BS3TEXT16 align=2 progbits alloc exec nowrite
    324   %else
    325         section BS3TEXT16 align=2 CLASS=BS3CLASS16CODE PUBLIC USE16
     322        section BS3TEXT16 align=%1 CLASS=BS3CLASS16CODE PUBLIC USE16
     323  %ifndef BS3_BEGIN_TEXT16_WITHOUT_GROUP ; bs3-first-common.mac trick.
     324   %ifndef BS3_BEGIN_TEXT16_NEARSTUBS_NOT_FIRST
     325   %define BS3_BEGIN_TEXT16_NEARSTUBS_NOT_FIRST
     326        section BS3TEXT16_NEARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16
     327   %endif
     328   %ifndef BS3_BEGIN_TEXT16_FARSTUBS_NOT_FIRST
     329   %define BS3_BEGIN_TEXT16_FARSTUBS_NOT_FIRST
     330        section BS3TEXT16_FARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16
     331   %endif
     332        GROUP CGROUP16 BS3TEXT16 BS3TEXT16_NEARSTUBS BS3TEXT16_FARSTUBS
     333        section BS3TEXT16
    326334  %endif
    327335 %else
     
    336344 %ifndef  BS3_BEGIN_TEXT16_NEARSTUBS_NOT_FIRST
    337345  %define BS3_BEGIN_TEXT16_NEARSTUBS_NOT_FIRST
    338   %ifdef ASM_FORMAT_ELF
    339         section BS3TEXT16_NEARSTUBS align=1 progbits alloc exec nowrite
    340   %else
    341346        section BS3TEXT16_NEARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16
    342   %endif
    343347 %else
    344348        section BS3TEXT16_NEARSTUBS
     
    352356 %ifndef  BS3_BEGIN_TEXT16_FARSTUBS_NOT_FIRST
    353357  %define BS3_BEGIN_TEXT16_FARSTUBS_NOT_FIRST
    354   %ifdef ASM_FORMAT_ELF
    355         section BS3TEXT16_FARSTUBS align=1 progbits alloc exec nowrite
    356   %else
    357358        section BS3TEXT16_FARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16
    358   %endif
    359359 %else
    360360        section BS3TEXT16_FARSTUBS
     
    365365%endmacro
    366366
    367 %macro BS3_BEGIN_RMTEXT16 0
     367%macro BS3_BEGIN_RMTEXT16 0-1 2
    368368 %ifndef  BS3_BEGIN_RMTEXT16_NOT_FIRST
    369369  %define BS3_BEGIN_RMTEXT16_NOT_FIRST
    370   %ifdef ASM_FORMAT_ELF
    371         section BS3RMTEXT16 align=2 progbits alloc exec nowrite
    372   %else
    373         section BS3RMTEXT16 align=2 CLASS=BS3CLASS16RMCODE PUBLIC USE16
     370        section BS3RMTEXT16 align=%1 CLASS=BS3CLASS16RMCODE PUBLIC USE16
     371  %ifndef BS3_BEGIN_RMTEXT16_WITHOUT_GROUP ; bs3-first-common.mac trick.
     372        GROUP BS3GROUPRMTEXT16 BS3RMTEXT16
    374373  %endif
    375374 %else
     
    381380%endmacro
    382381
    383 %macro BS3_BEGIN_DATA16 0
     382%macro BS3_BEGIN_X0TEXT16 0-1 2
     383 %ifndef  BS3_BEGIN_X0TEXT16_NOT_FIRST
     384  %define BS3_BEGIN_X0TEXT16_NOT_FIRST
     385        section BS3X0TEXT16 align=%1 CLASS=BS3CLASS16X0CODE PUBLIC USE16
     386  %ifndef BS3_BEGIN_X0TEXT16_WITHOUT_GROUP ; bs3-first-common.mac trick.
     387        GROUP BS3GROUPX0TEXT16 BS3X0TEXT16
     388  %endif
     389 %else
     390        section BS3X0TEXT16
     391 %endif
     392 %undef   BS3_CUR_SEG_BEGIN_MACRO
     393 %xdefine BS3_CUR_SEG_BEGIN_MACRO   BS3_BEGIN_X0TEXT16
     394        BS3_SET_BITS 16
     395%endmacro
     396
     397%macro BS3_BEGIN_X1TEXT16 0-1 2
     398 %ifndef  BS3_BEGIN_X1TEXT16_NOT_FIRST
     399  %define BS3_BEGIN_X1TEXT16_NOT_FIRST
     400        section BS3X1TEXT16 align=%1 CLASS=BS3CLASS16X1CODE PUBLIC USE16
     401  %ifndef BS3_BEGIN_X1TEXT16_WITHOUT_GROUP ; bs3-first-common.mac trick.
     402        GROUP BS3GROUPX1TEXT16 BS3X1TEXT16
     403  %endif
     404 %else
     405        section BS3X1TEXT16
     406 %endif
     407 %undef   BS3_CUR_SEG_BEGIN_MACRO
     408 %xdefine BS3_CUR_SEG_BEGIN_MACRO   BS3_BEGIN_X1TEXT16
     409        BS3_SET_BITS 16
     410%endmacro
     411
     412
     413%macro BS3_BEGIN_DATA16 0-1 2
    384414 %ifndef  BS3_BEGIN_DATA16_NOT_FIRST
    385415  %define BS3_BEGIN_DATA16_NOT_FIRST
    386   %ifdef ASM_FORMAT_ELF
    387         section BS3DATA16 align=2 progbits alloc noexec write
    388   %else
    389         section BS3DATA16 align=2 CLASS=BS3KIT_CLASS_DATA16 PUBLIC USE16
    390    %ifndef BS3_BEGIN_DATA16_WITHOUT_GROUP ; bs3-first-common.mac trick.
     416        section BS3DATA16 align=%1 CLASS=BS3KIT_CLASS_DATA16 PUBLIC USE16
     417  %ifndef BS3_BEGIN_DATA16_WITHOUT_GROUP ; bs3-first-common.mac trick.
    391418    GROUP BS3KIT_GRPNM_DATA16 BS3DATA16
    392    %endif
    393419  %endif
    394420 %else
     
    400426%endmacro
    401427
    402 %macro BS3_BEGIN_TEXT32 0
     428%macro BS3_BEGIN_TEXT32 0-1 2
    403429 %ifndef  BS3_BEGIN_TEXT32_NOT_FIRST
    404430  %define BS3_BEGIN_TEXT32_NOT_FIRST
    405   %ifdef ASM_FORMAT_ELF
    406         section BS3TEXT32 align=1 progbits alloc exec nowrite
    407   %else
    408         section BS3TEXT32 align=1 CLASS=BS3CLASS32CODE PUBLIC USE32 FLAT
    409   %endif
     431        section BS3TEXT32 align=%1 CLASS=BS3CLASS32CODE PUBLIC USE32 FLAT
    410432 %else
    411433        section BS3TEXT32
     
    416438%endmacro
    417439
    418 %macro BS3_BEGIN_DATA32 0
     440%macro BS3_BEGIN_DATA32 0-1 16
    419441 %ifndef  BS3_BEGIN_DATA32_NOT_FIRST
    420442  %define BS3_BEGIN_DATA32_NOT_FIRST
    421   %ifdef ASM_FORMAT_ELF
    422         section BS3DATA32 align=16 progbits alloc noexec write
    423   %else
    424         section BS3DATA32 align=16 CLASS=FAR_DATA PUBLIC USE32 ;FLAT - compiler doesn't make data flat.
    425   %endif
     443        section BS3DATA32 align=%1 CLASS=FAR_DATA PUBLIC USE32 ;FLAT - compiler doesn't make data flat.
    426444 %else
    427445        section BS3DATA32
     
    432450%endmacro
    433451
    434 %macro BS3_BEGIN_TEXT64 0
     452%macro BS3_BEGIN_TEXT64 0-1 2
    435453 %ifndef  BS3_BEGIN_TEXT64_NOT_FIRST
    436454  %define BS3_BEGIN_TEXT64_NOT_FIRST
    437   %ifdef ASM_FORMAT_ELF
    438         section BS3TEXT64 align=1 progbits alloc exec nowrite
    439   %else
    440         section BS3TEXT64 align=1 CLASS=BS3CLASS64CODE PUBLIC USE32 FLAT
    441   %endif
     455        section BS3TEXT64 align=%1 CLASS=BS3CLASS64CODE PUBLIC USE32 FLAT
    442456 %else
    443457        section BS3TEXT64
     
    448462%endmacro
    449463
    450 %macro BS3_BEGIN_DATA64 0
     464%macro BS3_BEGIN_DATA64 0-1 16
    451465 %ifndef  BS3_BEGIN_DATA64_NOT_FIRST
    452466  %define BS3_BEGIN_DATA64_NOT_FIRST
    453   %ifdef ASM_FORMAT_ELF
    454         section BS3DATA64 align=16 progbits alloc noexec write
    455   %else
    456         section BS3DATA64 align=16 CLASS=FAR_DATA PUBLIC USE32 ;FLAT (see DATA32)
    457   %endif
     467        section BS3DATA64 align=%1 CLASS=FAR_DATA PUBLIC USE32 ;FLAT (see DATA32)
    458468 %else
    459469        section BS3DATA64
     
    465475
    466476;; The system data segment containing the GDT, TSSes and IDTs.
    467 %macro BS3_BEGIN_SYSTEM16 0
     477%macro BS3_BEGIN_SYSTEM16 0-1 16
    468478 %ifndef  BS3_BEGIN_SYSTEM16_NOT_FIRST
    469479  %define BS3_BEGIN_SYSTEM16_NOT_FIRST
    470   %ifdef ASM_FORMAT_ELF
    471         section BS3SYSTEM16 align=16 progbits alloc noexec write
    472   %else
    473         section BS3SYSTEM16 align=16 CLASS=BS3SYSTEM16 PUBLIC USE16
    474   %endif
     480        section BS3SYSTEM16 align=%1 CLASS=BS3SYSTEM16 PUBLIC USE16
    475481 %else
    476482        section BS3SYSTEM16
     
    804810BS3_PROC_BEGIN_CMN %1, BS3_PBC_FAR
    805811        CPU 8086
     812        inc     bp                      ; Odd bp is far call indicator.
    806813        push    bp
    807814        mov     bp, sp
     
    814821        add     sp, %2
    815822        pop     bp
     823        dec     bp
    816824        retf
    817825BS3_PROC_END_CMN   %1
     
    14461454%define BS3_SEL_TSS64_IOBP          00a0h ;;< The 64-bit TSS selector.
    14471455
     1456%define BS3_SEL_X0TEXT16_CS         00e8h ;;< Conforming code selector for accessing the BS3X0TEXT16 segment. Runtime config.
     1457%define BS3_SEL_X1TEXT16_CS         00f0h ;;< Conforming code selector for accessing the BS3X0TEXT16 segment. Runtime config.
    14481458%define BS3_SEL_VMMDEV_MMIO16       00f8h ;;< Selector for accessing the VMMDev MMIO segment at 0100000h from 16-bit code.
    14491459
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