Changeset 60539 in vbox
- Timestamp:
- Apr 18, 2016 2:09:39 PM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 4 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/Config.kmk
r60527 r60539 85 85 ' extern _$2_f16' \ 86 86 'BS3_BEGIN_TEXT16_NEARSTUBS' \ 87 'GROUP CGROUP16 BS3TEXT16 BS3TEXT16_NEARSTUBS' \88 87 'BS3_GLOBAL_NAME_EX _$2_c16, function, 6' \ 89 88 ' pop ax' \ … … 606 605 segment BS3RMCODE16 \ 607 606 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 \ 608 615 clname BS3CLASS32CODE \ 609 616 segment BS3TEXT32_START \ … … 809 816 segment BS3RMCODE16 \ 810 817 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 \ 811 826 clname BS3CLASS32CODE \ 812 827 segment BS3TEXT32 \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-c.c
r60527 r60539 51 51 BS3TESTMODEENTRY_MODE("raise xcpt #1", bs3CpuBasic2_RaiseXcpt1), 52 52 //BS3TESTMODEENTRY_CMN("iret", bs3CpuBasic2_iret), 53 //BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret),53 BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret), 54 54 // BS3TESTMODEENTRY_MODE("sidt", bs3CpuBasic2_sidt), 55 55 }; -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c
r60527 r60539 242 242 */ 243 243 #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 244 void bs3CpuBasic2_CompareCpuTrapCtx(PCBS3TRAPFRAME pTrapCtx, PCBS3REGCTX pStartCtx, uint16_t uErrCd, uint8_t bXcpt, 245 bool f486ResumeFlagHint) 246 246 { 247 247 uint16_t const cErrorsBefore = Bs3TestSubErrorCount(); … … 1498 1498 1499 1499 1500 BS3_DECL (uint8_t) TMPL_NM(bs3CpuBasic2_TssGateEsp)(uint8_t bMode)1500 BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_TssGateEsp)(uint8_t bMode) 1501 1501 { 1502 1502 uint8_t bRet = 0; … … 1528 1528 1529 1529 1530 BS3_DECL (uint8_t) TMPL_NM(bs3CpuBasic2_RaiseXcpt1)(uint8_t bMode)1530 BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_RaiseXcpt1)(uint8_t bMode) 1531 1531 { 1532 1532 g_pszTestMode = TMPL_NM(g_szBs3ModeName); … … 1565 1565 1566 1566 1567 BS3_DECL (uint8_t) TMPL_NM(bs3CpuBasic2_iret)(uint8_t bMode)1567 BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_iret)(uint8_t bMode) 1568 1568 { 1569 1569 g_pszTestMode = TMPL_NM(g_szBs3ModeName); … … 1579 1579 1580 1580 1581 BS3_DECL (uint8_t) TMPL_NM(bs3CpuBasic2_sidt)(uint8_t bMode)1581 BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_sidt)(uint8_t bMode) 1582 1582 { 1583 1583 g_pszTestMode = TMPL_NM(g_szBs3ModeName); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r60527 r60539 90 90 bs3-cmn-SelFar32ToFlat32.c \ 91 91 bs3-cmn-SelProtFar32ToFlat32.c \ 92 bs3-cmn-SelRealModeCodeToProtMode.asm \ 93 bs3-cmn-SelFlatCodeToRealMode.asm \ 94 bs3-cmn-SelFlatCodeToProtFar16.asm \ 92 95 bs3-cmn-SlabInit.c \ 93 96 bs3-cmn-SlabAlloc.c \ … … 176 179 bs3-rm-InitAll.c \ 177 180 bs3-rm-InitMemory.c \ 181 bs3-rm-InitGdt.c \ 178 182 bs3-cmn-hexdigits.c \ 179 183 bs3-cmn-CpuDetectData.c \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/VBoxBs3ObjConverter.cpp
r60527 r60539 3661 3661 /** The segment index. */ 3662 3662 uint16_t idxSeg; 3663 /** The group index for this segment. This is zero if not yet determined and3664 * 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. */ 3665 3665 uint16_t idxGrp; 3666 3666 /** File table. */ … … 3668 3668 } OMFSEGLINES; 3669 3669 typedef 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 3670 3679 3671 3680 /** … … 3682 3691 /** Set if this module may need mangling. */ 3683 3692 bool fMayNeedMangling; 3684 /** Set if this module needs CGROUP16 for line number fixupes. */3685 bool fNeedsCGroup16;3686 3693 /** The LNAME index of '$$SYMBOLS' or UINT16_MAX it not found. */ 3687 3694 uint16_t iSymbolsNm; … … 3690 3697 /** The '$$SYMBOLS' segment index. */ 3691 3698 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;3696 3699 3697 3700 /** Number of SEGDEFs records. */ … … 3708 3711 /** Name list. Points to the size repfix. */ 3709 3712 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]; 3710 3738 3711 3739 /** CV8: Filename string table size. */ … … 3728 3756 typedef OMFDETAILS *POMFDETAILS; 3729 3757 typedef OMFDETAILS const *PCOMFDETAILS; 3758 3730 3759 3731 3760 /** Grows a table to a given size (a_cNewEntries). */ … … 3892 3921 return error("???", "collectOmfAddLine: idxSeg=%#x is out of bounds (%#x)!\n", idxSeg, pOmfStuff->cSegDefs); 3893 3922 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 } 3900 3934 } 3901 3935 } … … 3960 3994 pOmfStuff->iSymbolsNm = UINT16_MAX; 3961 3995 pOmfStuff->iSymbolsSeg = UINT16_MAX; 3962 pOmfStuff->iCGroup16Nm = UINT16_MAX;3963 pOmfStuff->iCGroup16Grp = UINT16_MAX;3964 3996 3965 3997 /* Dummy entries. */ … … 3973 4005 OMF_GROW_TABLE_RET_ERR(OMFGRPDEF, pOmfStuff->paGrpDefs, pOmfStuff->cGrpDefs, 16); 3974 4006 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); 3975 4024 3976 4025 /* … … 4048 4097 if (IS_OMF_STR_EQUAL_EX(cch, &pbRec[offRec + 1], "$$SYMBOLS")) 4049 4098 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 } 4052 4108 4053 4109 pOmfStuff->cLNames++; … … 4199 4255 OMF_READ_IDX(pGrpDef->idxName, GRPDEF); 4200 4256 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 } 4203 4265 4204 4266 pGrpDef->cSegDefs = 0; … … 4366 4428 static bool convertOmfWriteDebugGrpDefs(POMFWRITER pThis, POMFDETAILS pOmfStuff) 4367 4429 { 4368 if ( pOmfStuff->cSegLines == 0 4369 || !pOmfStuff->fNeedsCGroup16) 4430 if (pOmfStuff->cSegLines == 0) 4370 4431 return true; 4371 4432 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)) 4382 4452 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; 4389 4492 return true; 4390 4493 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-common.mac
r60527 r60539 26 26 27 27 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 28 34 %include "bs3kit.mac" 29 35 … … 64 70 .after_eye_catcher: 65 71 66 %ifdef ASM_FORMAT_ELF67 section BS3TEXT16_NEARSTUBS align=1 progbits alloc exec nowrite68 section BS3TEXT16_FARSTUBS align=1 progbits alloc exec nowrite69 section BS3TEXT16_END align=1 progbits alloc exec nowrite70 %else71 72 section _TEXT align=2 CLASS=BS3CLASS16CODE PUBLIC USE16 72 73 section BS3TEXT16_NEARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 73 74 section BS3TEXT16_FARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 74 75 section BS3TEXT16_END align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 75 %endif76 76 77 77 BS3_GLOBAL_DATA Bs3Text16_EndOfSegment, 0 78 78 79 %ifndef ASM_FORMAT_ELF 80 %ifndef BS3_IS_DOS_EXE 79 %ifndef BS3_IS_DOS_EXE 81 80 GROUP CGROUP16 BS3TEXT16 _TEXT BS3TEXT16_NEARSTUBS BS3TEXT16_FARSTUBS BS3TEXT16_END 82 81 %else 83 82 GROUP CGROUP16 BEGTEXT BS3TEXT16 _TEXT BS3TEXT16_NEARSTUBS BS3TEXT16_FARSTUBS BS3TEXT16_END 84 %endif85 83 %endif 86 84 … … 89 87 ; 16-bit data 90 88 ; 91 %define BS3_BEGIN_DATA16_WITHOUT_GROUP92 89 BS3_BEGIN_DATA16 93 90 BS3_GLOBAL_DATA Bs3Data16_StartOfSegment, 0 … … 102 99 dd BS3_DATA_NM(Bs3Data64_EndOfSegment) wrt CGROUP16 103 100 BS3_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 102 BS3_GLOBAL_DATA Bs3X0Text16_Size, 2 103 dw BS3_DATA_NM(Bs3X0Text16_EndOfSegment) wrt BS3GROUPX0TEXT16 104 BS3_GLOBAL_DATA Bs3X1Text16_Size, 2 105 dw BS3_DATA_NM(Bs3X1Text16_EndOfSegment) wrt BS3GROUPX1TEXT16 106 BS3_GLOBAL_DATA Bs3X0Text16_FlatAddr, 4 107 dd BS3_DATA_NM(Bs3X0Text16_StartOfSegment) wrt BS3FLAT 108 BS3_GLOBAL_DATA Bs3X1Text16_FlatAddr, 4 109 dd BS3_DATA_NM(Bs3X1Text16_StartOfSegment) wrt BS3FLAT 110 112 111 section BS3DATA16CONST align=2 CLASS=BS3KIT_CLASS_DATA16 PUBLIC USE16 113 112 section BS3DATA16CONST2 align=2 CLASS=BS3KIT_CLASS_DATA16 PUBLIC USE16 114 113 section BS3DATA16_DATA align=2 CLASS=BS3KIT_CLASS_DATA16 PUBLIC USE16 115 114 %ifdef BS3_IS_DOS_EXE 116 115 section _NULL align=16 CLASS=BEGDATA PUBLIC USE16 117 116 section _AFTERNULL align=2 CLASS=BEGDATA PUBLIC USE16 118 117 %endif 119 118 section CONST align=2 CLASS=DATA PUBLIC USE16 120 119 section CONST2 align=2 CLASS=DATA PUBLIC USE16 121 120 section _DATA align=2 CLASS=DATA PUBLIC USE16 122 121 %ifdef BS3_IS_DOS_EXE 123 122 section XIB align=1 CLASS=DATA PUBLIC USE16 124 123 section XI align=1 CLASS=DATA PUBLIC USE16 … … 127 126 section YI align=1 CLASS=DATA PUBLIC USE16 128 127 section YIE align=1 CLASS=DATA PUBLIC USE16 129 128 %endif 130 129 section STRINGS align=2 CLASS=DATA PUBLIC USE16 131 130 section DATA align=2 CLASS=DATA PUBLIC USE16 132 131 section _BSS align=2 CLASS=BS3KIT_CLASS_BSS16 PUBLIC USE16 133 132 section BSS align=2 CLASS=BS3KIT_CLASS_BSS16 PUBLIC USE16 134 133 %ifdef BS3_IS_DOS_EXE 135 134 section STACK align=16 CLASS=STACK STACK USE16 136 135 %endif 137 136 section BS3DATA16_END align=2 CLASS=BS3KIT_CLASS_BSS16 PUBLIC USE16 138 %endif139 137 140 138 BS3_GLOBAL_DATA Bs3Data16_EndOfSegment, 0 141 139 142 %ifndef ASM_FORMAT_ELF 143 %ifndef BS3_IS_DOS_EXE 140 %ifndef BS3_IS_DOS_EXE 144 141 GROUP BS3KIT_GRPNM_DATA16 BS3DATA16 BS3DATA16_DATA _DATA DATA BS3DATA16CONST CONST BS3DATA16CONST2 CONST2 STRINGS _BSS BSS BS3DATA16_END 145 142 %else 146 143 GROUP BS3KIT_GRPNM_DATA16 \ 147 144 _NULL _AFTERNULL \ … … 149 146 _BSS BSS BS3DATA16_END \ 150 147 STACK 151 %endif152 148 %endif 153 149 … … 155 151 ; 16-bit real-mode text 156 152 ; 157 %ifdef ASM_FORMAT_ELF158 section BS3RMTEXT16_START align=16 progbits alloc exec nowrite159 %else160 153 section BS3RMTEXT16_START align=16 CLASS=BS3CLASS16RMCODE PUBLIC USE16 161 %endif162 154 BS3_GLOBAL_DATA Bs3RmText16_StartOfSegment, 0 163 155 db 10,13,'eye-catcher: BS3RMTEXT16',10,13 164 165 156 BS3_BEGIN_RMTEXT16 166 167 %ifdef ASM_FORMAT_ELF168 section BS3RMTEXT16_END align=1 progbits alloc exec nowrite169 %else170 157 section BS3RMTEXT16_END align=1 CLASS=BS3CLASS16RMCODE PUBLIC USE16 171 %endif172 173 158 BS3_GLOBAL_DATA Bs3RmText16_EndOfSegment, 0 159 160 161 ; 162 ; 16-bit extra text segment #0. 163 ; 164 section BS3X0TEXT16_START align=16 CLASS=BS3CLASS16X0CODE PUBLIC USE16 165 BS3_GLOBAL_DATA Bs3X0Text16_StartOfSegment, 0 166 db 10,13,'eye-catcher: BS3X0TEXT16',10,13 167 BS3_BEGIN_X0TEXT16 4 168 section BS3X0TEXT16_END align=16 CLASS=BS3CLASS16X0CODE PUBLIC USE16 169 BS3_GLOBAL_DATA Bs3X0Text16_EndOfSegment, 0 170 GROUP BS3GROUPX0TEXT16 BS3X0TEXT16_START BS3X0TEXT16 BS3X0TEXT16_END 171 172 173 ; 174 ; 16-bit extra text segment #1. 175 ; 176 section BS3X1TEXT16_START align=16 CLASS=BS3CLASS16X1CODE PUBLIC USE16 177 BS3_GLOBAL_DATA Bs3X1Text16_StartOfSegment, 0 178 db 10,13,'eye-catcher: BS3X1TEXT16',10,13 179 BS3_BEGIN_X1TEXT16 4 180 section BS3X1TEXT16_END align=16 CLASS=BS3CLASS16X1CODE PUBLIC USE16 181 BS3_GLOBAL_DATA Bs3X1Text16_EndOfSegment, 0 182 GROUP BS3GROUPX1TEXT16 BS3X1TEXT16_START BS3X1TEXT16 BS3X1TEXT16_END 174 183 175 184 … … 180 189 BS3_GLOBAL_DATA Bs3Text32_StartOfSegment, 0 181 190 db 10,13,'eye-catcher: BS3TEXT32',10,13 182 183 %ifdef ASM_FORMAT_ELF184 section BS3TEXT32_END align=1 progbits alloc exec nowrite185 %else186 191 section BS3TEXT32_END align=1 CLASS=BS3CLASS32CODE PUBLIC USE32 FLAT 187 %endif188 192 BS3_GLOBAL_DATA Bs3Text32_EndOfSegment, 0 189 193 … … 195 199 BS3_GLOBAL_DATA Bs3Text64_StartOfSegment, 0 196 200 db 10,13,'eye-catcher: BS3TEXT64',10,13 197 198 %ifdef ASM_FORMAT_ELF199 section BS3TEXT64_END align=1 progbits alloc exec nowrite200 %else201 201 section BS3TEXT64_END align=1 CLASS=BS3CLASS64CODE PUBLIC USE32 FLAT 202 %endif203 202 BS3_GLOBAL_DATA Bs3Text64_EndOfSegment, 0 204 203 … … 217 216 BS3_GLOBAL_DATA Bs3Data32_StartOfSegment, 0 218 217 db 10,13,'eye-catcher: BS3DATA32',10,13 219 %ifdef ASM_FORMAT_ELF220 section BS3DATA32_END align=16 progbits alloc noexec write221 %else222 218 section BS3DATA32CONST align=16 CLASS=FAR_DATA PUBLIC USE32 223 219 section BS3DATA32CONST2 align=16 CLASS=FAR_DATA PUBLIC USE32 … … 225 221 section BS3DATA32_BSS align=16 CLASS=FAR_DATA PUBLIC USE32 226 222 section BS3DATA32_END align=16 CLASS=FAR_DATA PUBLIC USE32 227 %endif228 223 BS3_GLOBAL_DATA Bs3Data32_EndOfSegment, 0 229 230 %ifndef ASM_FORMAT_ELF231 224 GROUP BS3DATA32_GROUP BS3DATA32 BS3DATA32_DATA BS3DATA32CONST BS3DATA32CONST2 BS3DATA32_BSS BS3DATA32_END 232 %endif233 225 234 226 ; … … 238 230 BS3_GLOBAL_DATA Bs3Data64_StartOfSegment, 0 239 231 db 10,13,'eye-catcher: BS3DATA64',10,13 240 %ifdef ASM_FORMAT_ELF241 section BS3DATA64_END align=16 progbits alloc noexec write242 %else243 232 section BS3DATA64CONST align=16 CLASS=FAR_DATA PUBLIC USE32 244 233 section BS3DATA64_BSS align=16 CLASS=FAR_DATA PUBLIC USE32 245 234 section BS3DATA64_END align=16 CLASS=FAR_DATA PUBLIC USE32 246 %endif247 235 BS3_GLOBAL_DATA Bs3Data64_EndOfSegment, 0 248 249 %ifndef ASM_FORMAT_ELF250 236 GROUP BS3DATA64_GROUP BS3DATA64 BS3DATA64CONST BS3DATA64_BSS BS3DATA64_END 251 %endif252 237 253 238 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-dosexe.asm
r60439 r60539 26 26 27 27 28 %include "bs3kit.mac"29 30 28 ; 31 29 ; Segment defs, grouping and related variables. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-pe16.asm
r59932 r60539 29 29 ;* Header Files * 30 30 ;********************************************************************************************************************************* 31 %include "bs3kit.mac"32 31 33 32 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-rm.asm
r60439 r60539 26 26 27 27 28 29 %include "bs3kit.mac"30 31 28 ; 32 29 ; Segment defs, grouping and related variables. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModes.c
r60311 r60539 40 40 * in 32-bit and 64-bit modes it is already flat. 41 41 */ 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. 45 48 */ 46 49 #if ARCH_BITS == 16 47 50 # 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)) 49 53 #else 50 54 # 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)) 52 57 #endif 53 58 … … 56 61 * Assembly Symbols * 57 62 *********************************************************************************************************************************/ 58 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInRM)(uint 16_t offCallback);59 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16)(uint 16_t offCallback);63 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInRM)(uint32_t uCallbackFarPtr); 64 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16)(uint32_t uCallbackFarPtr); 60 65 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_32)(uint32_t uFlatAddrCallback); 61 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_V86)(uint 16_t offCallback);66 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_V86)(uint32_t uCallbackFarPtr); 62 67 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE32)(uint32_t uFlatAddrCallback); 63 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE32_16)(uint 16_t offCallback);64 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPEV86)(uint 16_t offCallback);65 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16)(uint 16_t offCallback);68 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE32_16)(uint32_t uCallbackFarPtr); 69 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPEV86)(uint32_t uCallbackFarPtr); 70 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16)(uint32_t uCallbackFarPtr); 66 71 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_32)(uint32_t uFlatAddrCallback); 67 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_V86)(uint 16_t offCallback);72 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_V86)(uint32_t uCallbackFarPtr); 68 73 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP32)(uint32_t uFlatAddrCallback); 69 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP32_16)(uint 16_t offCallback);70 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPPV86)(uint 16_t offCallback);71 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16)(uint 16_t offCallback);74 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP32_16)(uint32_t uCallbackFarPtr); 75 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPPV86)(uint32_t uCallbackFarPtr); 76 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16)(uint32_t uCallbackFarPtr); 72 77 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_32)(uint32_t uFlatAddrCallback); 73 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_V86)(uint 16_t offCallback);78 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_V86)(uint32_t uCallbackFarPtr); 74 79 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32)(uint32_t uFlatAddrCallback); 75 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32_16)(uint 16_t offCallback);76 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAEV86)(uint 16_t offCallback);77 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM16)(uint 16_t offCallback);80 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32_16)(uint32_t uCallbackFarPtr); 81 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAEV86)(uint32_t uCallbackFarPtr); 82 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM16)(uint32_t uCallbackFarPtr); 78 83 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM32)(uint32_t uFlatAddrCallback); 79 84 BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM64)(uint32_t uFlatAddrCallback); … … 210 215 { 211 216 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)); 213 218 CHECK_RESULT(g_szBs3ModeName_rm); 214 219 } … … 227 232 { 228 233 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)); 230 235 CHECK_RESULT(g_szBs3ModeName_pe16); 231 236 } … … 247 252 { 248 253 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)); 250 255 CHECK_RESULT(g_szBs3ModeName_pe16_v86); 251 256 } … … 261 266 { 262 267 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)); 264 269 CHECK_RESULT(g_szBs3ModeName_pe32_16); 265 270 } … … 268 273 { 269 274 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)); 271 276 CHECK_RESULT(g_szBs3ModeName_pev86); 272 277 } … … 278 283 { 279 284 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)); 281 286 CHECK_RESULT(g_szBs3ModeName_pp16); 282 287 } … … 292 297 { 293 298 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)); 295 300 CHECK_RESULT(g_szBs3ModeName_pp16_v86); 296 301 } … … 306 311 { 307 312 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)); 309 314 CHECK_RESULT(g_szBs3ModeName_pp32_16); 310 315 } … … 313 318 { 314 319 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)); 316 321 CHECK_RESULT(g_szBs3ModeName_ppv86); 317 322 } … … 330 335 { 331 336 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)); 333 338 CHECK_RESULT(g_szBs3ModeName_pae16); 334 339 } … … 344 349 { 345 350 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)); 347 352 CHECK_RESULT(g_szBs3ModeName_pae16_v86); 348 353 } … … 358 363 { 359 364 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)); 361 366 CHECK_RESULT(g_szBs3ModeName_pae32_16); 362 367 } … … 365 370 { 366 371 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)); 368 373 CHECK_RESULT(g_szBs3ModeName_paev86); 369 374 } … … 382 387 { 383 388 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)); 385 390 CHECK_RESULT(g_szBs3ModeName_lm16); 386 391 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModesHlp.asm
r60439 r60539 219 219 BS3_SET_BITS TMPL_BITS 220 220 .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] 222 223 223 224 ; Mode switch, make the call, switch back. … … 229 230 mov cx, BS3_MODE_RM 230 231 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: 232 239 233 240 STRICT_SAVE_REGS … … 253 260 BS3_SET_BITS TMPL_BITS 254 261 .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] 256 264 257 265 ; Mode switch, make the call, switch back. … … 262 270 263 271 push BS3_MODE_PE16 264 call ax 272 push cs 273 push .return 274 push dx 275 push ax 276 retf 277 .return: 265 278 266 279 STRICT_SAVE_REGS … … 303 316 jmp TMPL_NM(bs3TestCallDoerPrologue) 304 317 .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] 306 320 307 321 ; Mode switch, make the call, switch back. … … 312 326 313 327 push BS3_MODE_PE16_V86 314 call ax 328 push cs 329 push .return 330 push dx 331 push ax 332 retf 333 .return: 315 334 316 335 STRICT_SAVE_REGS … … 355 374 BS3_SET_BITS TMPL_BITS 356 375 .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] 358 378 359 379 ; Mode switch, make the call, switch back. … … 364 384 365 385 push BS3_MODE_PE32_16 366 call ax 386 push cs 387 push .return 388 push dx 389 push ax 390 retf 391 .return: 367 392 368 393 STRICT_SAVE_REGS … … 383 408 BS3_SET_BITS TMPL_BITS 384 409 .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] 386 412 387 413 ; Mode switch, make the call, switch back. … … 392 418 393 419 push BS3_MODE_PEV86 394 call ax 420 push cs 421 push .return 422 push dx 423 push ax 424 retf 425 .return: 395 426 396 427 STRICT_SAVE_REGS … … 417 448 BS3_SET_BITS TMPL_BITS 418 449 .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] 420 452 421 453 ; Mode switch, make the call, switch back. … … 426 458 427 459 push BS3_MODE_PP16 428 call ax 460 push cs 461 push .return 462 push dx 463 push ax 464 retf 465 .return: 429 466 430 467 STRICT_SAVE_REGS … … 468 505 jmp TMPL_NM(bs3TestCallDoerPrologue) 469 506 .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] 471 509 472 510 ; Mode switch, make the call, switch back. … … 477 515 478 516 push BS3_MODE_PP16_V86 479 call ax 517 push cs 518 push .return 519 push dx 520 push ax 521 retf 522 .return: 480 523 481 524 STRICT_SAVE_REGS … … 520 563 BS3_SET_BITS TMPL_BITS 521 564 .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] 523 567 524 568 ; Mode switch, make the call, switch back. … … 529 573 530 574 push BS3_MODE_PP32_16 531 call ax 575 push cs 576 push .return 577 push dx 578 push ax 579 retf 580 .return: 532 581 533 582 STRICT_SAVE_REGS … … 548 597 BS3_SET_BITS TMPL_BITS 549 598 .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] 551 601 552 602 ; Mode switch, make the call, switch back. … … 557 607 558 608 push BS3_MODE_PPV86 559 call ax 609 push cs 610 push .return 611 push dx 612 push ax 613 retf 614 .return: 560 615 561 616 STRICT_SAVE_REGS … … 582 637 BS3_SET_BITS TMPL_BITS 583 638 .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] 585 641 586 642 ; Mode switch, make the call, switch back. … … 591 647 592 648 push BS3_MODE_PAE16 593 call ax 649 push cs 650 push .return 651 push dx 652 push ax 653 retf 654 .return: 594 655 595 656 STRICT_SAVE_REGS … … 633 694 jmp TMPL_NM(bs3TestCallDoerPrologue) 634 695 .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] 636 698 637 699 ; Mode switch, make the call, switch back. … … 642 704 643 705 push BS3_MODE_PAE16_V86 644 call ax 706 push cs 707 push .return 708 push dx 709 push ax 710 retf 711 .return: 645 712 646 713 STRICT_SAVE_REGS … … 685 752 BS3_SET_BITS TMPL_BITS 686 753 .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] 688 756 689 757 ; Mode switch, make the call, switch back. … … 694 762 695 763 push BS3_MODE_PAE32_16 696 call ax 764 push cs 765 push .return 766 push dx 767 push ax 768 retf 769 .return: 697 770 698 771 STRICT_SAVE_REGS … … 713 786 BS3_SET_BITS TMPL_BITS 714 787 .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] 716 790 717 791 ; Mode switch, make the call, switch back. … … 722 796 723 797 push BS3_MODE_PAEV86 724 call ax 798 push cs 799 push .return 800 push dx 801 push ax 802 retf 803 .return: 725 804 726 805 STRICT_SAVE_REGS … … 747 826 BS3_SET_BITS TMPL_BITS 748 827 .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] 750 830 751 831 ; Mode switch, make the call, switch back. … … 756 836 757 837 push BS3_MODE_LM16 758 call ax 838 push cs 839 push .return 840 push dx 841 push ax 842 retf 843 .return: 759 844 760 845 STRICT_SAVE_REGS -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c
r60527 r60539 43 43 Bs3CpuDetect_rm(); 44 44 Bs3InitMemory_rm(); 45 Bs3InitGdt_rm(); 45 46 46 47 ASMIntDisable(); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-system-data.asm
r60439 r60539 178 178 dw 00000h, 00000h, 00000h, 00000h ; Entry 0d8h - currently unused 179 179 dw 00000h, 00000h, 00000h, 00000h ; Entry 0e0h - currently unused 180 dw 00000h, 00000h, 00000h, 00000h ; Entry 0e8h - currently unused181 dw 00000h, 00000h, 00000h, 00000h ; Entry 0f0h - currently unused182 180 183 181 ; Misc selectors. 182 BS3_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 185 BS3_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 184 188 BS3_GLOBAL_DATA Bs3Gdte_R0_MMIO16, 8 ; Entry 0f8h 185 189 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 60 60 #define Bs3RegCtxRestore BS3_CMN_MANGLER(Bs3RegCtxRestore) 61 61 #define Bs3RegCtxSave BS3_CMN_MANGLER(Bs3RegCtxSave) 62 #define Bs3SelFlatCodeToRealMode BS3_CMN_MANGLER(Bs3SelFlatCodeToRealMode) 63 #define Bs3SelFlatCodeToProtFar16 BS3_CMN_MANGLER(Bs3SelFlatCodeToProtFar16) 62 64 #define Bs3SelFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelFar32ToFlat32) 63 65 #define Bs3SelProtFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelProtFar32ToFlat32) 66 #define Bs3SelRealModeCodeToProtMode BS3_CMN_MANGLER(Bs3SelRealModeCodeToProtMode) 64 67 #define Bs3Shutdown BS3_CMN_MANGLER(Bs3Shutdown) 65 68 #define Bs3SlabAlloc BS3_CMN_MANGLER(Bs3SlabAlloc) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r60527 r60539 1 1 /* $Id$ */ 2 2 /** @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. 4 4 */ 5 5 … … 60 60 #undef Bs3RegCtxRestore 61 61 #undef Bs3RegCtxSave 62 #undef Bs3SelFlatCodeToRealMode 63 #undef Bs3SelFlatCodeToProtFar16 62 64 #undef Bs3SelFar32ToFlat32 63 65 #undef Bs3SelProtFar32ToFlat32 66 #undef Bs3SelRealModeCodeToProtMode 64 67 #undef Bs3Shutdown 65 68 #undef Bs3SlabAlloc … … 105 108 #undef Bs3TrapRmV86SetGate 106 109 #undef Bs3TrapSetHandler 110 #undef Bs3TrapSetJmp 107 111 #undef Bs3TrapSetJmpAndRestore 108 112 #undef Bs3TrapUnsetJmp -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60527 r60539 228 228 #define BS3_SEL_TSS64_IOBP 0x00a0 /**< The 64-bit TSS selector. */ 229 229 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. */ 230 232 #define BS3_SEL_VMMDEV_MMIO16 0x00f8 /**< Selector for accessing the VMMDev MMIO segment at 0100000h from 16-bit code. */ 231 233 … … 554 556 * 555 557 * @param a_Name The name of the function or global variable. 556 * @todo fix code vs data issue with _f16557 558 */ 558 559 #define BS3_CMN_NM(a_Name) RT_CONCAT3(a_Name,_c,ARCH_BITS) … … 704 705 extern X86DESC BS3_FAR_DATA Bs3Gdte_Tss64Spare1; /**< @see BS3_SEL_TSS64_SPARE1 */ 705 706 extern X86DESC BS3_FAR_DATA Bs3Gdte_Tss64Iobp; /**< @see BS3_SEL_TSS64_IOBP */ 707 extern X86DESC BS3_FAR_DATA Bs3Gdte_X0TEXT16_CS; /**< @see BS3_SEL_X0TEXT16_CS */ 708 extern X86DESC BS3_FAR_DATA Bs3Gdte_X1TEXT16_CS; /**< @see BS3_SEL_X1TEXT16_CS */ 706 709 extern X86DESC BS3_FAR_DATA Bs3Gdte_R0_MMIO16; /**< @see BS3_SEL_VMMDEV_MMIO16 */ 707 710 … … 923 926 extern uint8_t BS3_FAR_DATA Bs3Data16_EndOfSegment; 924 927 928 /** Start of the BS3RMTEXT16 segment. */ 929 extern uint8_t BS3_FAR_DATA Bs3RmText16_StartOfSegment; 930 /** End of the BS3RMTEXT16 segment. */ 931 extern uint8_t BS3_FAR_DATA Bs3RmText16_EndOfSegment; 932 933 /** Start of the BS3X0TEXT16 segment. */ 934 extern uint8_t BS3_FAR_DATA Bs3X0Text16_StartOfSegment; 935 /** End of the BS3X0TEXT16 segment. */ 936 extern uint8_t BS3_FAR_DATA Bs3X0Text16_EndOfSegment; 937 /** The size of the BS3X0TEXT16 segment. */ 938 extern uint16_t BS3_FAR_DATA Bs3X0Text16_Size; 939 /** The flat start address of the BS3X1TEXT16 segment. */ 940 extern uint32_t BS3_FAR_DATA Bs3X0Text16_FlatAddr; 941 942 /** Start of the BS3X1TEXT16 segment. */ 943 extern uint8_t BS3_FAR_DATA Bs3X1Text16_StartOfSegment; 944 /** End of the BS3X1TEXT16 segment. */ 945 extern uint8_t BS3_FAR_DATA Bs3X1Text16_EndOfSegment; 946 /** The size of the BS3X1TEXT16 segment. */ 947 extern uint16_t BS3_FAR_DATA Bs3X1Text16_Size; 948 /** The flat start address of the BS3X1TEXT16 segment. */ 949 extern uint32_t BS3_FAR_DATA Bs3X1Text16_FlatAddr; 950 925 951 /** Start of the BS3TEXT32 segment. */ 926 952 extern uint8_t BS3_FAR_DATA Bs3Text32_StartOfSegment; … … 1487 1513 BS3_CMN_PROTO(uint32_t, Bs3SelProtFar32ToFlat32,(uint32_t off, uint16_t uSel), true); 1488 1514 1489 1490 1515 /** 1491 1516 * Converts a current mode 32-bit far pointer to a 32-bit flat address. … … 1496 1521 */ 1497 1522 BS3_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 */ 1530 BS3_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 */ 1538 BS3_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 */ 1547 BS3_CMN_PROTO(uint32_t, Bs3SelFlatCodeToProtFar16,(uint32_t uFlatAddr), false); 1498 1548 1499 1549 /** … … 2319 2369 const char * BS3_FAR pszSubTest; 2320 2370 2321 PFNBS3TESTDOMODEpfnDoRM;2322 2323 PFNBS3TESTDOMODEpfnDoPE16;2371 FPFNBS3TESTDOMODE pfnDoRM; 2372 2373 FPFNBS3TESTDOMODE pfnDoPE16; 2324 2374 FPFNBS3TESTDOMODE pfnDoPE16_32; 2325 PFNBS3TESTDOMODEpfnDoPE16_V86;2375 FPFNBS3TESTDOMODE pfnDoPE16_V86; 2326 2376 FPFNBS3TESTDOMODE pfnDoPE32; 2327 PFNBS3TESTDOMODEpfnDoPE32_16;2328 PFNBS3TESTDOMODEpfnDoPEV86;2329 2330 PFNBS3TESTDOMODEpfnDoPP16;2377 FPFNBS3TESTDOMODE pfnDoPE32_16; 2378 FPFNBS3TESTDOMODE pfnDoPEV86; 2379 2380 FPFNBS3TESTDOMODE pfnDoPP16; 2331 2381 FPFNBS3TESTDOMODE pfnDoPP16_32; 2332 PFNBS3TESTDOMODEpfnDoPP16_V86;2382 FPFNBS3TESTDOMODE pfnDoPP16_V86; 2333 2383 FPFNBS3TESTDOMODE pfnDoPP32; 2334 PFNBS3TESTDOMODEpfnDoPP32_16;2335 PFNBS3TESTDOMODEpfnDoPPV86;2336 2337 PFNBS3TESTDOMODEpfnDoPAE16;2384 FPFNBS3TESTDOMODE pfnDoPP32_16; 2385 FPFNBS3TESTDOMODE pfnDoPPV86; 2386 2387 FPFNBS3TESTDOMODE pfnDoPAE16; 2338 2388 FPFNBS3TESTDOMODE pfnDoPAE16_32; 2339 PFNBS3TESTDOMODEpfnDoPAE16_V86;2389 FPFNBS3TESTDOMODE pfnDoPAE16_V86; 2340 2390 FPFNBS3TESTDOMODE pfnDoPAE32; 2341 PFNBS3TESTDOMODEpfnDoPAE32_16;2342 PFNBS3TESTDOMODEpfnDoPAEV86;2343 2344 PFNBS3TESTDOMODEpfnDoLM16;2391 FPFNBS3TESTDOMODE pfnDoPAE32_16; 2392 FPFNBS3TESTDOMODE pfnDoPAEV86; 2393 2394 FPFNBS3TESTDOMODE pfnDoLM16; 2345 2395 FPFNBS3TESTDOMODE pfnDoLM32; 2346 2396 FPFNBS3TESTDOMODE pfnDoLM64; … … 2380 2430 /** A set of standard protypes to go with #BS3TESTMODEENTRY_CMN. */ 2381 2431 #define BS3TESTMODE_PROTOTYPES_CMN(a_BaseNm) \ 2382 FNBS3TESTDOMODE 2432 FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _c16); \ 2383 2433 FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _c32); \ 2384 2434 FNBS3TESTDOMODE BS3_FAR_CODE RT_CONCAT(a_BaseNm, _c64) … … 2414 2464 /** A set of standard protypes to go with #BS3TESTMODEENTRY_MODE. */ 2415 2465 #define BS3TESTMODE_PROTOTYPES_MODE(a_BaseNm) \ 2416 FNBS3TESTDOMODE 2417 FNBS3TESTDOMODE 2418 FNBS3TESTDOMODE BS3_FAR_CODE 2419 FNBS3TESTDOMODE 2420 FNBS3TESTDOMODE BS3_FAR_CODE 2421 FNBS3TESTDOMODE 2422 FNBS3TESTDOMODE 2423 FNBS3TESTDOMODE 2424 FNBS3TESTDOMODE BS3_FAR_CODE 2425 FNBS3TESTDOMODE 2426 FNBS3TESTDOMODE BS3_FAR_CODE 2427 FNBS3TESTDOMODE 2428 FNBS3TESTDOMODE 2429 FNBS3TESTDOMODE 2430 FNBS3TESTDOMODE BS3_FAR_CODE 2431 FNBS3TESTDOMODE 2432 FNBS3TESTDOMODE BS3_FAR_CODE 2433 FNBS3TESTDOMODE 2434 FNBS3TESTDOMODE 2435 FNBS3TESTDOMODE 2436 FNBS3TESTDOMODE BS3_FAR_CODE 2437 FNBS3TESTDOMODE BS3_FAR_CODE 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) 2438 2488 2439 2489 /** @} */ … … 2451 2501 */ 2452 2502 BS3_DECL_FAR(void) Bs3InitMemory_rm(void); 2503 2504 /** 2505 * Initialized the X0TEXT16 and X1TEXT16 GDT entries. 2506 */ 2507 BS3_DECL_FAR(void) Bs3InitGdt_rm(void); 2453 2508 2454 2509 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r60527 r60539 317 317 318 318 319 %macro BS3_BEGIN_TEXT16 0 319 %macro BS3_BEGIN_TEXT16 0-1 2 320 320 %ifndef BS3_BEGIN_TEXT16_NOT_FIRST 321 321 %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 326 334 %endif 327 335 %else … … 336 344 %ifndef BS3_BEGIN_TEXT16_NEARSTUBS_NOT_FIRST 337 345 %define BS3_BEGIN_TEXT16_NEARSTUBS_NOT_FIRST 338 %ifdef ASM_FORMAT_ELF339 section BS3TEXT16_NEARSTUBS align=1 progbits alloc exec nowrite340 %else341 346 section BS3TEXT16_NEARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 342 %endif343 347 %else 344 348 section BS3TEXT16_NEARSTUBS … … 352 356 %ifndef BS3_BEGIN_TEXT16_FARSTUBS_NOT_FIRST 353 357 %define BS3_BEGIN_TEXT16_FARSTUBS_NOT_FIRST 354 %ifdef ASM_FORMAT_ELF355 section BS3TEXT16_FARSTUBS align=1 progbits alloc exec nowrite356 %else357 358 section BS3TEXT16_FARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 358 %endif359 359 %else 360 360 section BS3TEXT16_FARSTUBS … … 365 365 %endmacro 366 366 367 %macro BS3_BEGIN_RMTEXT16 0 367 %macro BS3_BEGIN_RMTEXT16 0-1 2 368 368 %ifndef BS3_BEGIN_RMTEXT16_NOT_FIRST 369 369 %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 374 373 %endif 375 374 %else … … 381 380 %endmacro 382 381 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 384 414 %ifndef BS3_BEGIN_DATA16_NOT_FIRST 385 415 %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. 391 418 GROUP BS3KIT_GRPNM_DATA16 BS3DATA16 392 %endif393 419 %endif 394 420 %else … … 400 426 %endmacro 401 427 402 %macro BS3_BEGIN_TEXT32 0 428 %macro BS3_BEGIN_TEXT32 0-1 2 403 429 %ifndef BS3_BEGIN_TEXT32_NOT_FIRST 404 430 %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 410 432 %else 411 433 section BS3TEXT32 … … 416 438 %endmacro 417 439 418 %macro BS3_BEGIN_DATA32 0 440 %macro BS3_BEGIN_DATA32 0-1 16 419 441 %ifndef BS3_BEGIN_DATA32_NOT_FIRST 420 442 %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. 426 444 %else 427 445 section BS3DATA32 … … 432 450 %endmacro 433 451 434 %macro BS3_BEGIN_TEXT64 0 452 %macro BS3_BEGIN_TEXT64 0-1 2 435 453 %ifndef BS3_BEGIN_TEXT64_NOT_FIRST 436 454 %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 442 456 %else 443 457 section BS3TEXT64 … … 448 462 %endmacro 449 463 450 %macro BS3_BEGIN_DATA64 0 464 %macro BS3_BEGIN_DATA64 0-1 16 451 465 %ifndef BS3_BEGIN_DATA64_NOT_FIRST 452 466 %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) 458 468 %else 459 469 section BS3DATA64 … … 465 475 466 476 ;; The system data segment containing the GDT, TSSes and IDTs. 467 %macro BS3_BEGIN_SYSTEM16 0 477 %macro BS3_BEGIN_SYSTEM16 0-1 16 468 478 %ifndef BS3_BEGIN_SYSTEM16_NOT_FIRST 469 479 %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 475 481 %else 476 482 section BS3SYSTEM16 … … 804 810 BS3_PROC_BEGIN_CMN %1, BS3_PBC_FAR 805 811 CPU 8086 812 inc bp ; Odd bp is far call indicator. 806 813 push bp 807 814 mov bp, sp … … 814 821 add sp, %2 815 822 pop bp 823 dec bp 816 824 retf 817 825 BS3_PROC_END_CMN %1 … … 1446 1454 %define BS3_SEL_TSS64_IOBP 00a0h ;;< The 64-bit TSS selector. 1447 1455 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. 1448 1458 %define BS3_SEL_VMMDEV_MMIO16 00f8h ;;< Selector for accessing the VMMDev MMIO segment at 0100000h from 16-bit code. 1449 1459
Note:
See TracChangeset
for help on using the changeset viewer.