- Timestamp:
- Nov 15, 2015 9:56:46 PM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r58680 r58694 165 165 endif 166 166 167 # 167 168 # BS3Kit template for assembly and 16-bit code. 169 # 168 170 # Note! Using -d1 as -d1+ and -d2 causes suboptimal code to be generated (strlen 169 171 # reloading string pointer argument all the time). … … 192 194 # disable 1014, 1023, 2120, 1080 193 195 196 # linker options: 197 # system dos: Link a 16-bit DOS binary. 198 # output raw ...: Produce a raw DOS binary for loading at flat address 10000h. 199 # The following is for ordering segments. 200 # option start=_start: The start symbol in bs3-first-xxx.asm. 201 # debug codeview/dwarf all: Full debug information either in codeview or dwarf. 202 # option symfile: Produce a separate symbol file with the debug info. 203 # option map: Produce a map file. 204 # option statics: ? 205 # option verbose: Verbose map file? 206 # option disable 1014: Disable warning about 207 # option disable 1080: Disable warning about 208 # option disable 1150: Disable warning about 209 # 210 # Note! We're pushing DATA16 to 0x20000 because it's impossible to force wlink 211 # to give us a real-mode + GDT compatible alignment (0ffffff80h), i.e. 212 # real-mode address on the form 0fff8:0000. 194 213 TEMPLATE_VBoxBS3KitImg_LDFLAGS = system dos \ 195 214 debug $(BS3_OW_DBG_LDOPT) all \ … … 199 218 output raw offset=0x10000 \ 200 219 order \ 201 clname BS3CODE16 220 clname BS3CODE16 segaddr=0x1000 \ 202 221 segment BS3TEXT16 \ 203 segment text \ 222 segment BS3TEXT16_END \ 223 clname BS3SYSTEM16 segaddr=0x2000 \ 224 segment BS3SYSTEM16 \ 204 225 clname FAR_DATA \ 205 segment BS3DATA16 \226 segment BS3DATA16 segaddr=0x2700 \ 206 227 segment BS3DATA16CONST \ 207 228 segment BS3DATA16CONST2 \ 208 229 segment BS3DATA16_DATA \ 230 segment BS3DATA16_END \ 209 231 segment BS3DATA32 \ 210 232 segment BS3DATA32_CONST \ … … 221 243 segment .rdata \ 222 244 clname DATA \ 223 245 segment BS3DATA64 \ 224 246 segment DATA64 \ 225 247 segment .data … … 334 356 bs3kit-common-16_TEMPLATE = VBoxBS3KitImg 335 357 bs3kit-common-16_DEFS = TMPL_PE16 BS3_CMN_ONLY 336 bs3kit-common-16_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES) 358 bs3kit-common-16_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES) \ 359 bs3-system-data.asm 337 360 338 361 # The 32-bit BS3Kit library. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-bootsector.asm
r58609 r58694 104 104 105 105 ; save the registers. 106 mov [cs:BS3_ REG_SAVE_ADDR+ BS3REGS.rax], eax107 mov [cs:BS3_ REG_SAVE_ADDR+ BS3REGS.rsp], esp108 mov [cs:BS3_ REG_SAVE_ADDR+ BS3REGS.rbp], ebp106 mov [cs:BS3_ADDR_REG_SAVE + BS3REGS.rax], eax 107 mov [cs:BS3_ADDR_REG_SAVE + BS3REGS.rsp], esp 108 mov [cs:BS3_ADDR_REG_SAVE + BS3REGS.rbp], ebp 109 109 mov ax, ss 110 mov [cs:BS3_ REG_SAVE_ADDR+ BS3REGS.ss], ax110 mov [cs:BS3_ADDR_REG_SAVE + BS3REGS.ss], ax 111 111 mov ax, ds 112 mov [cs:BS3_ REG_SAVE_ADDR+ BS3REGS.ds], ax112 mov [cs:BS3_ADDR_REG_SAVE + BS3REGS.ds], ax 113 113 mov ax, es 114 mov [cs:BS3_ REG_SAVE_ADDR+ BS3REGS.es], ax114 mov [cs:BS3_ADDR_REG_SAVE + BS3REGS.es], ax 115 115 mov ax, fs 116 mov [cs:BS3_ REG_SAVE_ADDR+ BS3REGS.fs], ax116 mov [cs:BS3_ADDR_REG_SAVE + BS3REGS.fs], ax 117 117 mov ax, gs 118 118 … … 124 124 mov gs, ax 125 125 mov ss, ax 126 mov esp, BS3_STACK_ADDR 127 mov [esp], eax ; clear the first 16 bytes 128 mov [esp + 04h], eax 129 mov [esp + 08h], eax ; fake rbp. 130 mov [esp + 0ch], eax ; fake ebp and bp 126 mov esp, BS3_ADDR_STACK 131 127 mov ebp, esp 128 mov [ebp], eax ; clear the first 16 bytes (terminates the ebp chain) 129 mov [ebp + 04h], eax 130 mov [ebp + 08h], eax 131 mov [ebp + 0ch], eax 132 132 133 133 ; Save more registers now that ds is known and the stack is usable. 134 134 pushfd 135 135 pop eax 136 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.rflags], eax137 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.rbx], ebx138 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.rcx], ecx139 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.rdx], edx140 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.rsi], esi141 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.rdi], edi136 mov [BS3_ADDR_REG_SAVE + BS3REGS.rflags], eax 137 mov [BS3_ADDR_REG_SAVE + BS3REGS.rbx], ebx 138 mov [BS3_ADDR_REG_SAVE + BS3REGS.rcx], ecx 139 mov [BS3_ADDR_REG_SAVE + BS3REGS.rdx], edx 140 mov [BS3_ADDR_REG_SAVE + BS3REGS.rsi], esi 141 mov [BS3_ADDR_REG_SAVE + BS3REGS.rdi], edi 142 142 mov eax, cr2 143 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.cr2], eax143 mov [BS3_ADDR_REG_SAVE + BS3REGS.cr2], eax 144 144 mov eax, cr3 145 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.cr3], eax145 mov [BS3_ADDR_REG_SAVE + BS3REGS.cr3], eax 146 146 mov eax, cr4 147 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.cr4], eax148 mov byte [BS3_ REG_SAVE_ADDR+ BS3REGS.cBits], 16147 mov [BS3_ADDR_REG_SAVE + BS3REGS.cr4], eax 148 mov byte [BS3_ADDR_REG_SAVE + BS3REGS.cBits], 16 149 149 xor eax, eax 150 mov [cs:BS3_ REG_SAVE_ADDR+ BS3REGS.cs], ax150 mov [cs:BS3_ADDR_REG_SAVE + BS3REGS.cs], ax 151 151 mov ax, start 152 mov [cs:BS3_ REG_SAVE_ADDR+ BS3REGS.rip], eax152 mov [cs:BS3_ADDR_REG_SAVE + BS3REGS.rip], eax 153 153 154 154 ; Make sure caching is enabled and alignment is off. 155 155 mov eax, cr0 156 mov [BS3_ REG_SAVE_ADDR+ BS3REGS.cr0], eax156 mov [BS3_ADDR_REG_SAVE + BS3REGS.cr0], eax 157 157 and eax, ~(X86_CR0_NW | X86_CR0_CD | X86_CR0_AM) 158 158 mov cr0, eax … … 165 165 ; Call the user 'main' procedure (shouldn't return). 166 166 ; 167 call 1000h:0000h167 call BS3_SEL_TEXT16:0000h 168 168 169 169 ; Panic/hang. … … 214 214 mov esi, [g_cLargeTotalSectors] 215 215 dec esi 216 mov di, BS3_ LOAD_ADDR/ 16 ; The current load segment.216 mov di, BS3_ADDR_LOAD / 16 ; The current load segment. 217 217 mov cx, 0002h ; ch/cylinder=0 (0-based); cl/sector=2 (1-based) 218 218 xor dh, dh ; dh/head=0 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-rm.asm
r58628 r58694 25 25 ; 26 26 27 28 27 29 %include "bs3kit.mac" 28 30 31 29 32 ; 30 ; Just in case this helps the linker, define all the segments. 33 ; Define all the segments and their grouping, just to get that right once at 34 ; the start of everything. 31 35 ; 36 37 ; 16-bit text 32 38 BS3_BEGIN_TEXT16 39 BS3_GLOBAL_DATA Bs3Text16_StartOfSegment, 0 33 40 41 %ifdef ASM_FORMAT_ELF 42 section BS3TEXT16_END align=2 progbits alloc exec nowrite 43 %else 44 section BS3TEXT16_END align=2 CLASS=BS3CODE16 PUBLIC USE16 45 %endif 46 BS3_GLOBAL_DATA Bs3Text16_EndOfSegment, 0 47 48 %ifndef ASM_FORMAT_ELF 49 GROUP CGROUP16 BS3TEXT16 BS3TEXT16_END 50 %endif 51 52 ; 16-bit data 34 53 BS3_BEGIN_DATA16 54 BS3_GLOBAL_DATA Bs3Data16_StartOfSegment, 0 55 db 10,13,'eye-catcher: BS3DATA16',10,13 56 %ifdef ASM_FORMAT_ELF 57 section BS3DATA16CONST align=2 progbits alloc noexec write 58 section BS3DATA16CONST2 align=2 progbits alloc noexec write 59 section BS3DATA16_DATA align=2 progbits alloc noexec write 60 section BS3DATA16_END align=2 progbits alloc noexec write 61 %else 62 section BS3DATA16CONST align=2 CLASS=FAR_DATA PUBLIC USE16 63 section BS3DATA16CONST2 align=2 CLASS=FAR_DATA PUBLIC USE16 64 section BS3DATA16_DATA align=2 CLASS=FAR_DATA PUBLIC USE16 65 section BS3DATA16_END align=2 CLASS=FAR_DATA PUBLIC USE16 66 %endif 67 BS3_GLOBAL_DATA Bs3Data16_EndOfSegment, 0 35 68 69 %ifndef ASM_FORMAT_ELF 70 GROUP BS3DATA16_GROUP BS3DATA16 BS3DATA16CONST BS3DATA16CONST2 BS3DATA16_END 71 %endif 72 73 ; 32-bit text 36 74 BS3_BEGIN_TEXT32 75 BS3_GLOBAL_DATA Bs3Text32_StartOfSegment, 0 76 db 10,13,'eye-catcher: BS3TEXT32',10,13 37 77 78 %ifdef ASM_FORMAT_ELF 79 section BS3TEXT32_END align=1 progbits alloc exec nowrite 80 %else 81 section BS3TEXT32_END align=1 CLASS=BS3CODE32 PUBLIC USE32 FLAT 82 %endif 83 BS3_GLOBAL_DATA Bs3Text32_EndOfSegment, 0 84 85 ; 64-bit text 86 BS3_BEGIN_TEXT64 87 BS3_GLOBAL_DATA Bs3Text64_StartOfSegment, 0 88 db 10,13,'eye-catcher: BS3TEXT64',10,13 89 90 %ifdef ASM_FORMAT_ELF 91 section BS3TEXT64_END align=1 progbits alloc exec nowrite 92 %else 93 section BS3TEXT64_END align=1 CLASS=CODE PUBLIC USE32 FLAT 94 %endif 95 BS3_GLOBAL_DATA Bs3Text64_EndOfSegment, 0 96 97 ; 32-bit data 38 98 BS3_BEGIN_DATA32 99 BS3_GLOBAL_DATA Bs3Data32_StartOfSegment, 0 100 db 10,13,'eye-catcher: BS3DATA32',10,13 101 %ifdef ASM_FORMAT_ELF 102 section BS3DATA32_END align=16 progbits alloc noexec write 103 %else 104 section BS3DATA32_END align=16 CLASS=FAR_DATA PUBLIC USE32 FLAT 105 %endif 106 BS3_GLOBAL_DATA Bs3Data32_EndOfSegment, 0 39 107 40 BS3_BEGIN_TEXT64 108 ; 64-bit data 109 BS3_BEGIN_DATA64 110 BS3_GLOBAL_DATA Bs3Data64_StartOfSegment, 0 111 db 10,13,'eye-catcher: BS3DATA64',10,13 112 %ifdef ASM_FORMAT_ELF 113 section BS3DATA64_END align=16 progbits alloc noexec write 114 %else 115 section BS3DATA64_END align=16 CLASS=DATA PUBLIC USE32 FLAT 116 %endif 117 BS3_GLOBAL_DATA Bs3Data64_EndOfSegment, 0 41 118 42 BS3_BEGIN_DATA64 119 BS3_BEGIN_SYSTEM16 120 43 121 44 122 … … 49 127 extern BS3_CMN_NM(Bs3Shutdown) 50 128 extern NAME(Main_rm) 51 extern _Bs3PrintStrSpacesColonSpace_c1652 extern _Bs3PrintStrSpacesColonSpace_c3253 extern Bs3PrintStrSpacesColonSpace_c6454 129 130 BS3_BEGIN_SYSTEM16 131 extern BS3_DATA_NM(Bs3Gdt) 132 extern BS3_DATA_NM(Bs3Lgdt_Gdt) 55 133 56 134 ; … … 59 137 BS3_BEGIN_TEXT16 60 138 GLOBALNAME start 139 jmp .after_eye_catcher 140 db 10,13,'eye-catcher: BS3TEXT16',10,13 141 .after_eye_catcher: 142 mov ax, BS3SYSTEM16 143 mov ds, ax 144 lgdt [BS3_DATA_NM(Bs3Lgdt_Gdt)] 145 mov ax, X86_CR0_PE 146 lmsw ax 147 cli 148 hlt 149 61 150 mov ax, BS3DATA16 62 151 mov es, ax -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r58675 r58694 36 36 # undef IN_RING0 37 37 #endif 38 #include <iprt/x86.h> 38 39 39 40 40 41 /** @defgroup grp_bs3kit BS3Kit 41 42 * @{ */ 43 44 45 /** @name BS3_ADDR_XXX - Static Memory Allocation 46 * @{ */ 47 /** The flat load address for the code after the bootsector. */ 48 #define BS3_ADDR_LOAD 0x10000 49 /** Where we save the boot registers during init. 50 * Located right before the code. */ 51 #define BS3_ADDR_REG_SAVE (BS3_ADDR_LOAD - sizeof(BS3REGS) - 8) 52 /** Where the stack starts (initial RSP value). 53 * Located 16 bytes (assumed by boot sector) before the saved registers. 54 * SS.BASE=0. The size is a little short of 32KB */ 55 #define BS3_ADDR_STACK (BS3_ADDR_REG_SAVE - 16) 56 /** The ring-0 stack (8KB) for ring transitions. */ 57 #define BS3_ADDR_STACK_R0 0x06000 58 /** The ring-1 stack (8KB) for ring transitions. */ 59 #define BS3_ADDR_STACK_R1 0x04000 60 /** The ring-2 stack (8KB) for ring transitions. */ 61 #define BS3_ADDR_STACK_R2 0x02000 62 /** IST1 ring-0 stack for long mode (4KB), used for double faults elsewhere. */ 63 #define BS3_ADDR_STACK_R0_IST1 0x09000 64 /** IST2 ring-0 stack for long mode (3KB), used for spare 0 stack elsewhere. */ 65 #define BS3_ADDR_STACK_R0_IST2 0x08000 66 /** IST3 ring-0 stack for long mode (1KB). */ 67 #define BS3_ADDR_STACK_R0_IST3 0x07400 68 /** IST4 ring-0 stack for long mode (1KB), used for spare 1 stack elsewhere. */ 69 #define BS3_ADDR_STACK_R0_IST4 0x07000 70 /** IST5 ring-0 stack for long mode (1KB). */ 71 #define BS3_ADDR_STACK_R0_IST5 0x06c00 72 /** IST6 ring-0 stack for long mode (1KB). */ 73 #define BS3_ADDR_STACK_R0_IST6 0x06800 74 /** IST7 ring-0 stack for long mode (1KB). */ 75 #define BS3_ADDR_STACK_R0_IST7 0x06400 76 77 /** The base address of the BS3TEXT16 segment (same as BS3_LOAD_ADDR). 78 * @sa BS3_SEL_TEXT16 */ 79 #define BS3_ADDR_BS3TEXT16 0x10000 80 /** The base address of the BS3SYSTEM16 segment. 81 * @sa BS3_SEL_SYSTEM16 */ 82 #define BS3_ADDR_BS3SYSTEM16 0x20000 83 /** The base address of the BS3DATA16 segment. 84 * @sa BS3_SEL_DATA16 */ 85 #define BS3_ADDR_BS3DATA16 0x27000 86 /** @} */ 87 88 /** @name BS3_SEL_XXX - GDT selector assignments. 89 * 90 * The real mode segment numbers for BS16TEXT, BS16DATA and BS16SYSTEM are 91 * present in the GDT, this allows the 16-bit C/C++ and assembly code to 92 * continue using the real mode segment values in ring-0 protected mode. 93 * 94 * The three segments have fixed locations: 95 * | segment | flat address | real mode segment | 96 * | ----------- | ------------ | ----------------- | 97 * | BS3TEXT16 | 0x00010000 | 1000h | 98 * | BS3SYSTEM16 | 0x00020000 | 2000h | 99 * | BS3DATA16 | 0x00027000 | 2700h | 100 * 101 * This means that we've got a lot of GDT space to play around with. 102 * 103 * @{ */ 104 #define BS3_SEL_LDT 0x0010 /**< The LDT selector for Bs3Ldt. */ 105 #define BS3_SEL_TSS16 0x0020 /**< The 16-bit TSS selector. */ 106 #define BS3_SEL_TSS16_DF 0x0028 /**< The 16-bit TSS selector for double faults. */ 107 #define BS3_SEL_TSS16_SPARE0 0x0030 /**< The 16-bit TSS selector for testing. */ 108 #define BS3_SEL_TSS16_SPARE1 0x0038 /**< The 16-bit TSS selector for testing. */ 109 #define BS3_SEL_TSS32 0x0040 /**< The 32-bit TSS selector. */ 110 #define BS3_SEL_TSS32_DF 0x0048 /**< The 32-bit TSS selector for double faults. */ 111 #define BS3_SEL_TSS32_SPARE0 0x0050 /**< The 32-bit TSS selector for testing. */ 112 #define BS3_SEL_TSS32_SPARE1 0x0058 /**< The 32-bit TSS selector for testing. */ 113 #define BS3_SEL_TSS32_IOBP_IRB 0x0060 /**< The 32-bit TSS selector with I/O permission and interrupt redirection bitmaps. */ 114 #define BS3_SEL_TSS32_IRB 0x0068 /**< The 32-bit TSS selector with only interrupt redirection bitmap (IOPB stripped by limit). */ 115 #define BS3_SEL_TSS64 0x0070 /**< The 64-bit TSS selector. */ 116 #define BS3_SEL_TSS64_SPARE0 0x0080 /**< The 64-bit TSS selector. */ 117 #define BS3_SEL_TSS64_SPARE1 0x0090 /**< The 64-bit TSS selector. */ 118 #define BS3_SEL_TSS64_IOBP 0x00a0 /**< The 64-bit TSS selector. */ 119 120 #define BS3_SEL_VMMDEV_MMIO16 0x00f8 /**< Selector for accessing the VMMDev MMIO segment at 0100000h from 16-bit code. */ 121 122 #define BS3_SEL_R0_FIRST 0x0100 /**< The first selector in the ring-0 block. */ 123 #define BS3_SEL_R0_CS16 0x0100 /**< ring-0: 16-bit code selector, base 0x10000. */ 124 #define BS3_SEL_R0_DS16 0x0108 /**< ring-0: 16-bit data selector, base 0x23000. */ 125 #define BS3_SEL_R0_SS16 0x0110 /**< ring-0: 16-bit stack selector, base 0x00000. */ 126 #define BS3_SEL_R0_CS32 0x0118 /**< ring-0: 32-bit flat code selector. */ 127 #define BS3_SEL_R0_DS32 0x0120 /**< ring-0: 32-bit flat data selector. */ 128 #define BS3_SEL_R0_SS32 0x0128 /**< ring-0: 32-bit flat stack selector. */ 129 #define BS3_SEL_R0_CS64 0x0130 /**< ring-0: 64-bit flat code selector. */ 130 #define BS3_SEL_R0_DS64 0x0138 /**< ring-0: 64-bit flat data & stack selector. */ 131 #define BS3_SEL_R0_CS16_EO 0x0140 /**< ring-0: 16-bit execute-only code selector, not accessed, 0xfffe limit, CS16 base. */ 132 #define BS3_SEL_R0_CS16_CNF 0x0148 /**< ring-0: 16-bit conforming code selector, not accessed, 0xfffe limit, CS16 base. */ 133 #define BS3_SEL_R0_CS16_CNF_EO 0x0150 /**< ring-0: 16-bit execute-only conforming code selector, not accessed, 0xfffe limit, CS16 base. */ 134 #define BS3_SEL_R0_CS32_EO 0x0158 /**< ring-0: 32-bit execute-only code selector, not accessed, flat. */ 135 #define BS3_SEL_R0_CS32_CNF 0x0160 /**< ring-0: 32-bit conforming code selector, not accessed, flat. */ 136 #define BS3_SEL_R0_CS32_CNF_EO 0x0168 /**< ring-0: 32-bit execute-only conforming code selector, not accessed, flat. */ 137 #define BS3_SEL_R0_CS64_EO 0x0170 /**< ring-0: 64-bit execute-only code selector, not accessed, flat. */ 138 #define BS3_SEL_R0_CS64_CNF 0x0178 /**< ring-0: 64-bit conforming code selector, not accessed, flat. */ 139 #define BS3_SEL_R0_CS64_CNF_EO 0x0180 /**< ring-0: 64-bit execute-only conforming code selector, not accessed, flat. */ 140 141 #define BS3_SEL_R1_FIRST 0x0200 /**< The first selector in the ring-1 block. */ 142 #define BS3_SEL_R1_CS16 0x0200 /**< ring-1: 16-bit code selector, base 0x10000. */ 143 #define BS3_SEL_R1_DS16 0x0208 /**< ring-1: 16-bit data selector, base 0x23000. */ 144 #define BS3_SEL_R1_SS16 0x0210 /**< ring-1: 16-bit stack selector, base 0x00000. */ 145 #define BS3_SEL_R1_CS32 0x0218 /**< ring-1: 32-bit flat code selector. */ 146 #define BS3_SEL_R1_DS32 0x0220 /**< ring-1: 32-bit flat data selector. */ 147 #define BS3_SEL_R1_SS32 0x0228 /**< ring-1: 32-bit flat stack selector. */ 148 #define BS3_SEL_R1_CS64 0x0230 /**< ring-1: 64-bit flat code selector. */ 149 #define BS3_SEL_R1_DS64 0x0238 /**< ring-1: 64-bit flat data & stack selector. */ 150 #define BS3_SEL_R1_CS16_EO 0x0240 /**< ring-1: 16-bit execute-only code selector, not accessed, 0xfffe limit, CS16 base. */ 151 #define BS3_SEL_R1_CS16_CNF 0x0248 /**< ring-1: 16-bit conforming code selector, not accessed, 0xfffe limit, CS16 base. */ 152 #define BS3_SEL_R1_CS16_CNF_EO 0x0250 /**< ring-1: 16-bit execute-only conforming code selector, not accessed, 0xfffe limit, CS16 base. */ 153 #define BS3_SEL_R1_CS32_EO 0x0258 /**< ring-1: 32-bit execute-only code selector, not accessed, flat. */ 154 #define BS3_SEL_R1_CS32_CNF 0x0260 /**< ring-1: 32-bit conforming code selector, not accessed, flat. */ 155 #define BS3_SEL_R1_CS32_CNF_EO 0x0268 /**< ring-1: 32-bit execute-only conforming code selector, not accessed, flat. */ 156 #define BS3_SEL_R1_CS64_EO 0x0270 /**< ring-1: 64-bit execute-only code selector, not accessed, flat. */ 157 #define BS3_SEL_R1_CS64_CNF 0x0278 /**< ring-1: 64-bit conforming code selector, not accessed, flat. */ 158 #define BS3_SEL_R1_CS64_CNF_EO 0x0280 /**< ring-1: 64-bit execute-only conforming code selector, not accessed, flat. */ 159 160 #define BS3_SEL_R2_FIRST 0x0300 /**< The first selector in the ring-2 block. */ 161 #define BS3_SEL_R2_CS16 0x0300 /**< ring-2: 16-bit code selector, base 0x10000. */ 162 #define BS3_SEL_R2_DS16 0x0308 /**< ring-2: 16-bit data selector, base 0x23000. */ 163 #define BS3_SEL_R2_SS16 0x0310 /**< ring-2: 16-bit stack selector, base 0x00000. */ 164 #define BS3_SEL_R2_CS32 0x0318 /**< ring-2: 32-bit flat code selector. */ 165 #define BS3_SEL_R2_DS32 0x0320 /**< ring-2: 32-bit flat data selector. */ 166 #define BS3_SEL_R2_SS32 0x0328 /**< ring-2: 32-bit flat stack selector. */ 167 #define BS3_SEL_R2_CS64 0x0330 /**< ring-2: 64-bit flat code selector. */ 168 #define BS3_SEL_R2_DS64 0x0338 /**< ring-2: 64-bit flat data & stack selector. */ 169 #define BS3_SEL_R2_CS16_EO 0x0340 /**< ring-2: 16-bit execute-only code selector, not accessed, 0xfffe limit, CS16 base. */ 170 #define BS3_SEL_R2_CS16_CNF 0x0348 /**< ring-2: 16-bit conforming code selector, not accessed, 0xfffe limit, CS16 base. */ 171 #define BS3_SEL_R2_CS16_CNF_EO 0x0350 /**< ring-2: 16-bit execute-only conforming code selector, not accessed, 0xfffe limit, CS16 base. */ 172 #define BS3_SEL_R2_CS32_EO 0x0358 /**< ring-2: 32-bit execute-only code selector, not accessed, flat. */ 173 #define BS3_SEL_R2_CS32_CNF 0x0360 /**< ring-2: 32-bit conforming code selector, not accessed, flat. */ 174 #define BS3_SEL_R2_CS32_CNF_EO 0x0368 /**< ring-2: 32-bit execute-only conforming code selector, not accessed, flat. */ 175 #define BS3_SEL_R2_CS64_EO 0x0370 /**< ring-2: 64-bit execute-only code selector, not accessed, flat. */ 176 #define BS3_SEL_R2_CS64_CNF 0x0378 /**< ring-2: 64-bit conforming code selector, not accessed, flat. */ 177 #define BS3_SEL_R2_CS64_CNF_EO 0x0380 /**< ring-2: 64-bit execute-only conforming code selector, not accessed, flat. */ 178 179 #define BS3_SEL_R3_FIRST 0x0400 /**< The first selector in the ring-3 block. */ 180 #define BS3_SEL_R3_CS16 0x0400 /**< ring-3: 16-bit code selector, base 0x10000. */ 181 #define BS3_SEL_R3_DS16 0x0408 /**< ring-3: 16-bit data selector, base 0x23000. */ 182 #define BS3_SEL_R3_SS16 0x0410 /**< ring-3: 16-bit stack selector, base 0x00000. */ 183 #define BS3_SEL_R3_CS32 0x0418 /**< ring-3: 32-bit flat code selector. */ 184 #define BS3_SEL_R3_DS32 0x0420 /**< ring-3: 32-bit flat data selector. */ 185 #define BS3_SEL_R3_SS32 0x0428 /**< ring-3: 32-bit flat stack selector. */ 186 #define BS3_SEL_R3_CS64 0x0430 /**< ring-3: 64-bit flat code selector. */ 187 #define BS3_SEL_R3_DS64 0x0438 /**< ring-3: 64-bit flat data & stack selector. */ 188 #define BS3_SEL_R3_CS16_EO 0x0440 /**< ring-3: 16-bit execute-only code selector, not accessed, 0xfffe limit, CS16 base. */ 189 #define BS3_SEL_R3_CS16_CNF 0x0448 /**< ring-3: 16-bit conforming code selector, not accessed, 0xfffe limit, CS16 base. */ 190 #define BS3_SEL_R3_CS16_CNF_EO 0x0450 /**< ring-3: 16-bit execute-only conforming code selector, not accessed, 0xfffe limit, CS16 base. */ 191 #define BS3_SEL_R3_CS32_EO 0x0458 /**< ring-3: 32-bit execute-only code selector, not accessed, flat. */ 192 #define BS3_SEL_R3_CS32_CNF 0x0460 /**< ring-3: 32-bit conforming code selector, not accessed, flat. */ 193 #define BS3_SEL_R3_CS32_CNF_EO 0x0468 /**< ring-3: 32-bit execute-only conforming code selector, not accessed, flat. */ 194 #define BS3_SEL_R3_CS64_EO 0x0470 /**< ring-3: 64-bit execute-only code selector, not accessed, flat. */ 195 #define BS3_SEL_R3_CS64_CNF 0x0478 /**< ring-3: 64-bit conforming code selector, not accessed, flat. */ 196 #define BS3_SEL_R3_CS64_CNF_EO 0x0480 /**< ring-3: 64-bit execute-only conforming code selector, not accessed, flat. */ 197 198 #define BS3_SEL_SPARE_FIRST 0x0500 /**< The first selector in the spare block */ 199 #define BS3_SEL_SPARE_00 0x0500 /**< Spare selector number 00h. */ 200 #define BS3_SEL_SPARE_01 0x0508 /**< Spare selector number 01h. */ 201 #define BS3_SEL_SPARE_02 0x0510 /**< Spare selector number 02h. */ 202 #define BS3_SEL_SPARE_03 0x0518 /**< Spare selector number 03h. */ 203 #define BS3_SEL_SPARE_04 0x0520 /**< Spare selector number 04h. */ 204 #define BS3_SEL_SPARE_05 0x0528 /**< Spare selector number 05h. */ 205 #define BS3_SEL_SPARE_06 0x0530 /**< Spare selector number 06h. */ 206 #define BS3_SEL_SPARE_07 0x0538 /**< Spare selector number 07h. */ 207 #define BS3_SEL_SPARE_08 0x0540 /**< Spare selector number 08h. */ 208 #define BS3_SEL_SPARE_09 0x0548 /**< Spare selector number 09h. */ 209 #define BS3_SEL_SPARE_0a 0x0550 /**< Spare selector number 0ah. */ 210 #define BS3_SEL_SPARE_0b 0x0558 /**< Spare selector number 0bh. */ 211 #define BS3_SEL_SPARE_0c 0x0560 /**< Spare selector number 0ch. */ 212 #define BS3_SEL_SPARE_0d 0x0568 /**< Spare selector number 0dh. */ 213 #define BS3_SEL_SPARE_0e 0x0570 /**< Spare selector number 0eh. */ 214 #define BS3_SEL_SPARE_0f 0x0578 /**< Spare selector number 0fh. */ 215 #define BS3_SEL_SPARE_10 0x0580 /**< Spare selector number 10h. */ 216 #define BS3_SEL_SPARE_11 0x0588 /**< Spare selector number 11h. */ 217 #define BS3_SEL_SPARE_12 0x0590 /**< Spare selector number 12h. */ 218 #define BS3_SEL_SPARE_13 0x0598 /**< Spare selector number 13h. */ 219 #define BS3_SEL_SPARE_14 0x05a0 /**< Spare selector number 14h. */ 220 #define BS3_SEL_SPARE_15 0x05a8 /**< Spare selector number 15h. */ 221 #define BS3_SEL_SPARE_16 0x05b0 /**< Spare selector number 16h. */ 222 #define BS3_SEL_SPARE_17 0x05b8 /**< Spare selector number 17h. */ 223 #define BS3_SEL_SPARE_18 0x05c0 /**< Spare selector number 18h. */ 224 #define BS3_SEL_SPARE_19 0x05c8 /**< Spare selector number 19h. */ 225 #define BS3_SEL_SPARE_1a 0x05d0 /**< Spare selector number 1ah. */ 226 #define BS3_SEL_SPARE_1b 0x05d8 /**< Spare selector number 1bh. */ 227 #define BS3_SEL_SPARE_1c 0x05e0 /**< Spare selector number 1ch. */ 228 #define BS3_SEL_SPARE_1d 0x05e8 /**< Spare selector number 1dh. */ 229 #define BS3_SEL_SPARE_1e 0x05f0 /**< Spare selector number 1eh. */ 230 #define BS3_SEL_SPARE_1f 0x05f8 /**< Spare selector number 1fh. */ 231 232 #define BS3_SEL_TILED 0x0600 /**< 16-bit data tiling: First - base=0x00000000, limit=64KB. */ 233 #define BS3_SEL_TILED_LAST 0x0df8 /**< 16-bit data tiling: Last - base=0x00ff0000, limit=64KB. */ 234 #define BS3_SEL_TILED_AREA_SIZE 0x001000000 /**< 16-bit data tiling: Size of addressable area, in bytes. (16 MB) */ 235 236 #define BS3_SEL_FREE_PART1 0x0e00 /**< Free selector space - part \#1. */ 237 #define BS3_SEL_FREE_PART1_LAST 0x0ff8 /**< Free selector space - part \#1, last entry. */ 238 239 #define BS3_SEL_TEXT16 0x1000 /**< The BS3TEXT16 selector. */ 240 241 #define BS3_SEL_FREE_PART2 0x1008 /**< Free selector space - part \#2. */ 242 #define BS3_SEL_FREE_PART2_LAST 0x1ff8 /**< Free selector space - part \#2, last entry. */ 243 244 #define BS3_SEL_SYSTEM16 0x2000 /**< The BS3SYSTEM16 selector. */ 245 246 #define BS3_SEL_FREE_PART3 0x2008 /**< Free selector space - part \#3. */ 247 #define BS3_SEL_FREE_PART3_LAST 0x26f8 /**< Free selector space - part \#3, last entry. */ 248 249 #define BS3_SEL_DATA16 0x2700 /**< The BS3DATA16 selector. */ 250 251 #define BS3_SEL_GDT_LIMIT 0x2707 /**< The GDT limit. */ 252 /** @} */ 253 42 254 43 255 /** @def BS3_FAR … … 88 300 */ 89 301 #define BS3_CMN_NM(a_Name) RT_CONCAT3(a_Name,_c,ARCH_BITS) 302 303 /** 304 * Constructs a data name. 305 * 306 * Example: BS3_DATA_NM(Bs3Gdt) 307 * 308 * @param a_Name The name of the global variable. 309 */ 310 #if ARCH_BITS == 64 311 # define BS3_DATA_NM(a_Name) RT_CONCAT(_,a_Name) 312 #else 313 # define BS3_DATA_NM(a_Name) a_Name 314 #endif 90 315 91 316 /** … … 140 365 141 366 367 /** @defgroup grp_bs3kit_system System structures 368 * @{ */ 369 /** The GDT, indexed by BS3_SEL_XXX shifted by 3. */ 370 extern X86DESC BS3_DATA_NM(Bs3Gdt)[(BS3_SEL_GDT_LIMIT + 1) / 8]; 371 372 extern X86DESC64 BS3_DATA_NM(Bs3Gdt_Ldt); /**< @see BS3_SEL_LDT */ 373 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss16); /**< @see BS3_SEL_TSS16 */ 374 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss16DoubleFault); /**< @see BS3_SEL_TSS16_DF */ 375 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss16Spare0); /**< @see BS3_SEL_TSS16_SPARE0 */ 376 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss16Spare1); /**< @see BS3_SEL_TSS16_SPARE1 */ 377 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss32); /**< @see BS3_SEL_TSS32 */ 378 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss32DoubleFault); /**< @see BS3_SEL_TSS32_DF */ 379 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss32Spare0); /**< @see BS3_SEL_TSS32_SPARE0 */ 380 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss32Spare1); /**< @see BS3_SEL_TSS32_SPARE1 */ 381 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss32IobpIntRedirBm); /**< @see BS3_SEL_TSS32_IOBP_IRB */ 382 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss32IntRedirBm); /**< @see BS3_SEL_TSS32_IRB */ 383 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss64); /**< @see BS3_SEL_TSS64 */ 384 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss64Spare0); /**< @see BS3_SEL_TSS64_SPARE0 */ 385 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss64Spare1); /**< @see BS3_SEL_TSS64_SPARE1 */ 386 extern X86DESC BS3_DATA_NM(Bs3Gdte_Tss64Iobp); /**< @see BS3_SEL_TSS64_IOBP */ 387 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_MMIO16); /**< @see BS3_SEL_VMMDEV_MMIO16 */ 388 389 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_First); /**< @see BS3_SEL_R0_FIRST */ 390 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS16); /**< @see BS3_SEL_R0_CS16 */ 391 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_DS16); /**< @see BS3_SEL_R0_DS16 */ 392 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_SS16); /**< @see BS3_SEL_R0_SS16 */ 393 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS32); /**< @see BS3_SEL_R0_CS32 */ 394 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_DS32); /**< @see BS3_SEL_R0_DS32 */ 395 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_SS32); /**< @see BS3_SEL_R0_SS32 */ 396 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS64); /**< @see BS3_SEL_R0_CS64 */ 397 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_DS64); /**< @see BS3_SEL_R0_DS64 */ 398 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS16_EO); /**< @see BS3_SEL_R0_CS16_EO */ 399 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS16_CNF); /**< @see BS3_SEL_R0_CS16_CNF */ 400 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS16_CND_EO); /**< @see BS3_SEL_R0_CS16_CNF_EO */ 401 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS32_EO); /**< @see BS3_SEL_R0_CS32_EO */ 402 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS32_CNF); /**< @see BS3_SEL_R0_CS32_CNF */ 403 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS32_CNF_EO); /**< @see BS3_SEL_R0_CS32_CNF_EO */ 404 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS64_EO); /**< @see BS3_SEL_R0_CS64_EO */ 405 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS64_CNF); /**< @see BS3_SEL_R0_CS64_CNF */ 406 extern X86DESC BS3_DATA_NM(Bs3Gdte_R0_CS64_CNF_EO); /**< @see BS3_SEL_R0_CS64_CNF_EO */ 407 408 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_First); /**< @see BS3_SEL_R1_FIRST */ 409 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS16); /**< @see BS3_SEL_R1_CS16 */ 410 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_DS16); /**< @see BS3_SEL_R1_DS16 */ 411 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_SS16); /**< @see BS3_SEL_R1_SS16 */ 412 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS32); /**< @see BS3_SEL_R1_CS32 */ 413 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_DS32); /**< @see BS3_SEL_R1_DS32 */ 414 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_SS32); /**< @see BS3_SEL_R1_SS32 */ 415 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS64); /**< @see BS3_SEL_R1_CS64 */ 416 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_DS64); /**< @see BS3_SEL_R1_DS64 */ 417 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS16_EO); /**< @see BS3_SEL_R1_CS16_EO */ 418 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS16_CNF); /**< @see BS3_SEL_R1_CS16_CNF */ 419 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS16_CND_EO); /**< @see BS3_SEL_R1_CS16_CNF_EO */ 420 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS32_EO); /**< @see BS3_SEL_R1_CS32_EO */ 421 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS32_CNF); /**< @see BS3_SEL_R1_CS32_CNF */ 422 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS32_CNF_EO); /**< @see BS3_SEL_R1_CS32_CNF_EO */ 423 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS64_EO); /**< @see BS3_SEL_R1_CS64_EO */ 424 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS64_CNF); /**< @see BS3_SEL_R1_CS64_CNF */ 425 extern X86DESC BS3_DATA_NM(Bs3Gdte_R1_CS64_CNF_EO); /**< @see BS3_SEL_R1_CS64_CNF_EO */ 426 427 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_First); /**< @see BS3_SEL_R2_FIRST */ 428 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS16); /**< @see BS3_SEL_R2_CS16 */ 429 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_DS16); /**< @see BS3_SEL_R2_DS16 */ 430 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_SS16); /**< @see BS3_SEL_R2_SS16 */ 431 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS32); /**< @see BS3_SEL_R2_CS32 */ 432 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_DS32); /**< @see BS3_SEL_R2_DS32 */ 433 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_SS32); /**< @see BS3_SEL_R2_SS32 */ 434 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS64); /**< @see BS3_SEL_R2_CS64 */ 435 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_DS64); /**< @see BS3_SEL_R2_DS64 */ 436 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS16_EO); /**< @see BS3_SEL_R2_CS16_EO */ 437 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS16_CNF); /**< @see BS3_SEL_R2_CS16_CNF */ 438 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS16_CND_EO); /**< @see BS3_SEL_R2_CS16_CNF_EO */ 439 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS32_EO); /**< @see BS3_SEL_R2_CS32_EO */ 440 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS32_CNF); /**< @see BS3_SEL_R2_CS32_CNF */ 441 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS32_CNF_EO); /**< @see BS3_SEL_R2_CS32_CNF_EO */ 442 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS64_EO); /**< @see BS3_SEL_R2_CS64_EO */ 443 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS64_CNF); /**< @see BS3_SEL_R2_CS64_CNF */ 444 extern X86DESC BS3_DATA_NM(Bs3Gdte_R2_CS64_CNF_EO); /**< @see BS3_SEL_R2_CS64_CNF_EO */ 445 446 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_First); /**< @see BS3_SEL_R3_FIRST */ 447 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS16); /**< @see BS3_SEL_R3_CS16 */ 448 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_DS16); /**< @see BS3_SEL_R3_DS16 */ 449 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_SS16); /**< @see BS3_SEL_R3_SS16 */ 450 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS32); /**< @see BS3_SEL_R3_CS32 */ 451 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_DS32); /**< @see BS3_SEL_R3_DS32 */ 452 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_SS32); /**< @see BS3_SEL_R3_SS32 */ 453 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS64); /**< @see BS3_SEL_R3_CS64 */ 454 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_DS64); /**< @see BS3_SEL_R3_DS64 */ 455 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS16_EO); /**< @see BS3_SEL_R3_CS16_EO */ 456 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS16_CNF); /**< @see BS3_SEL_R3_CS16_CNF */ 457 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS16_CND_EO); /**< @see BS3_SEL_R3_CS16_CNF_EO */ 458 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS32_EO); /**< @see BS3_SEL_R3_CS32_EO */ 459 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS32_CNF); /**< @see BS3_SEL_R3_CS32_CNF */ 460 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS32_CNF_EO); /**< @see BS3_SEL_R3_CS32_CNF_EO */ 461 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS64_EO); /**< @see BS3_SEL_R3_CS64_EO */ 462 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS64_CNF); /**< @see BS3_SEL_R3_CS64_CNF */ 463 extern X86DESC BS3_DATA_NM(Bs3Gdte_R3_CS64_CNF_EO); /**< @see BS3_SEL_R3_CS64_CNF_EO */ 464 465 extern X86DESC BS3_DATA_NM(Bs3GdteSpare00); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_00 */ 466 extern X86DESC BS3_DATA_NM(Bs3GdteSpare01); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_01 */ 467 extern X86DESC BS3_DATA_NM(Bs3GdteSpare02); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_02 */ 468 extern X86DESC BS3_DATA_NM(Bs3GdteSpare03); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_03 */ 469 extern X86DESC BS3_DATA_NM(Bs3GdteSpare04); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_04 */ 470 extern X86DESC BS3_DATA_NM(Bs3GdteSpare05); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_05 */ 471 extern X86DESC BS3_DATA_NM(Bs3GdteSpare06); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_06 */ 472 extern X86DESC BS3_DATA_NM(Bs3GdteSpare07); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_07 */ 473 extern X86DESC BS3_DATA_NM(Bs3GdteSpare08); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_08 */ 474 extern X86DESC BS3_DATA_NM(Bs3GdteSpare09); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_09 */ 475 extern X86DESC BS3_DATA_NM(Bs3GdteSpare0a); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_0a */ 476 extern X86DESC BS3_DATA_NM(Bs3GdteSpare0b); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_0b */ 477 extern X86DESC BS3_DATA_NM(Bs3GdteSpare0c); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_0c */ 478 extern X86DESC BS3_DATA_NM(Bs3GdteSpare0d); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_0d */ 479 extern X86DESC BS3_DATA_NM(Bs3GdteSpare0e); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_0e */ 480 extern X86DESC BS3_DATA_NM(Bs3GdteSpare0f); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_0f */ 481 extern X86DESC BS3_DATA_NM(Bs3GdteSpare10); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_10 */ 482 extern X86DESC BS3_DATA_NM(Bs3GdteSpare11); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_11 */ 483 extern X86DESC BS3_DATA_NM(Bs3GdteSpare12); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_12 */ 484 extern X86DESC BS3_DATA_NM(Bs3GdteSpare13); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_13 */ 485 extern X86DESC BS3_DATA_NM(Bs3GdteSpare14); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_14 */ 486 extern X86DESC BS3_DATA_NM(Bs3GdteSpare15); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_15 */ 487 extern X86DESC BS3_DATA_NM(Bs3GdteSpare16); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_16 */ 488 extern X86DESC BS3_DATA_NM(Bs3GdteSpare17); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_17 */ 489 extern X86DESC BS3_DATA_NM(Bs3GdteSpare18); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_18 */ 490 extern X86DESC BS3_DATA_NM(Bs3GdteSpare19); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_19 */ 491 extern X86DESC BS3_DATA_NM(Bs3GdteSpare1a); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_1a */ 492 extern X86DESC BS3_DATA_NM(Bs3GdteSpare1b); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_1b */ 493 extern X86DESC BS3_DATA_NM(Bs3GdteSpare1c); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_1c */ 494 extern X86DESC BS3_DATA_NM(Bs3GdteSpare1d); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_1d */ 495 extern X86DESC BS3_DATA_NM(Bs3GdteSpare1e); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_1e */ 496 extern X86DESC BS3_DATA_NM(Bs3GdteSpare1f); /**< GDT entry for playing with in testcases. @see BS3_SEL_SPARE_1f */ 497 498 /** GDTs setting up the tiled 16-bit access to the first 16 MBs of memory. 499 * @see BS3_SEL_TILED, BS3_SEL_TILED_LAST, BS3_SEL_TILED_AREA_SIZE */ 500 extern X86DESC BS3_DATA_NM(Bs3GdteTiled)[256]; 501 /** Free GDTes, part \#1. */ 502 extern X86DESC BS3_DATA_NM(Bs3GdteFreePart1)[64]; 503 /** The BS3CODE16 GDT entry. @see BS3_SEL_TEXT16 */ 504 extern X86DESC BS3_DATA_NM(Bs3Gdte_CODE16); 505 /** Free GDTes, part \#2. */ 506 extern X86DESC BS3_DATA_NM(Bs3GdteFreePart2)[511]; 507 /** The BS3SYSTEM16 GDT entry. */ 508 extern X86DESC BS3_DATA_NM(Bs3Gdte_SYSTEM16); 509 /** Free GDTes, part \#3. */ 510 extern X86DESC BS3_DATA_NM(Bs3GdteFreePart3)[223]; 511 /** The BS3DATA16 GDT entry. */ 512 extern X86DESC BS3_DATA_NM(Bs3Gdte_DATA16); 513 /** The end of the GDT (exclusive). */ 514 extern X86DESC BS3_DATA_NM(Bs3GdtEnd); 515 516 /** The default 16-bit TSS. */ 517 extern X86TSS16 BS3_DATA_NM(Bs3Tss16); 518 extern X86TSS16 BS3_DATA_NM(Bs3Tss16DoubleFault); 519 extern X86TSS16 BS3_DATA_NM(Bs3Tss16Spare0); 520 extern X86TSS16 BS3_DATA_NM(Bs3Tss16Spare1); 521 /** The default 32-bit TSS. */ 522 extern X86TSS32 BS3_DATA_NM(Bs3Tss32); 523 extern X86TSS32 BS3_DATA_NM(Bs3Tss32DoubleFault); 524 extern X86TSS32 BS3_DATA_NM(Bs3Tss32Spare0); 525 extern X86TSS32 BS3_DATA_NM(Bs3Tss32Spare1); 526 /** The default 64-bit TSS. */ 527 extern X86TSS64 BS3_DATA_NM(Bs3Tss64); 528 extern X86TSS64 BS3_DATA_NM(Bs3Tss64Spare0); 529 extern X86TSS64 BS3_DATA_NM(Bs3Tss64Spare1); 530 extern X86TSS64 BS3_DATA_NM(Bs3Tss64WithIopb); 531 extern X86TSS32 BS3_DATA_NM(Bs3Tss32WithIopb); 532 /** Interrupt redirection bitmap used by Bs3Tss32WithIopb. */ 533 extern uint8_t BS3_DATA_NM(Bs3SharedIntRedirBm)[32]; 534 /** I/O permission bitmap used by Bs3Tss32WithIopb and Bs3Tss64WithIopb. */ 535 extern uint8_t BS3_DATA_NM(Bs3SharedIobp)[8192+2]; 536 /** End of the I/O permission bitmap (exclusive). */ 537 extern uint8_t BS3_DATA_NM(Bs3SharedIobpEnd); 538 /** 16-bit IDT. */ 539 extern X86DESC BS3_DATA_NM(Bs3Idt16)[256]; 540 /** 32-bit IDT. */ 541 extern X86DESC BS3_DATA_NM(Bs3Idt32)[256]; 542 /** 64-bit IDT. */ 543 extern X86DESC64 BS3_DATA_NM(Bs3Idt64)[256]; 544 /** Structure for the LIDT instruction for loading the 16-bit IDT. */ 545 extern X86XDTR64 BS3_DATA_NM(Bs3Lidt_Idt16); 546 /** Structure for the LIDT instruction for loading the 32-bit IDT. */ 547 extern X86XDTR64 BS3_DATA_NM(Bs3Lidt_Idt32); 548 /** Structure for the LIDT instruction for loading the 64-bit IDT. */ 549 extern X86XDTR64 BS3_DATA_NM(Bs3Lidt_Idt64); 550 /** Structure for the LIDT instruction for loading the real mode interrupt 551 * vector table.. */ 552 extern X86XDTR64 BS3_DATA_NM(Bs3Lidt_Ivt); 553 /** Structure for the LGDT instruction for loading the GDT. */ 554 extern X86XDTR64 BS3_DATA_NM(Bs3Lgdt_Gdt); 555 /** The LDT (all entries are empty, fill in for testing). */ 556 extern X86DESC BS3_DATA_NM(Bs3Ldt)[118]; 557 /** The end of the LDT (exclusive). */ 558 extern X86DESC BS3_DATA_NM(Bs3LdtEnd); 559 560 561 562 142 563 /** @defgroup grp_bs3kit_cmn Common Functions and Data 143 564 * -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r58675 r58694 127 127 %define BS3_BEGIN_TEXT16_NOT_FIRST 128 128 %ifdef ASM_FORMAT_ELF 129 section BS3TEXT16 align= 1progbits alloc exec nowrite129 section BS3TEXT16 align=2 progbits alloc exec nowrite 130 130 %else 131 section BS3TEXT16 align=1 CLASS=BS3CODE16 PUBLIC USE16 132 %endif 133 131 section BS3TEXT16 align=2 CLASS=BS3CODE16 PUBLIC USE16 132 %endif 134 133 %else 135 134 section BS3TEXT16 … … 206 205 %endif 207 206 BS3_SET_BITS 64 207 %endmacro 208 209 ;; The system data segment containing the GDT, TSSes and IDTs. 210 %macro BS3_BEGIN_SYSTEM16 0 211 %ifndef BS3_BEGIN_SYSTEM16_NOT_FIRST 212 %define BS3_BEGIN_SYSTEM16_NOT_FIRST 213 %ifdef ASM_FORMAT_ELF 214 section BS3SYSTEM16 align=16 progbits alloc noexec write 215 %else 216 section BS3SYSTEM16 align=16 CLASS=BS3SYSTEM16 PUBLIC USE16 217 %endif 218 %else 219 section BS3SYSTEM16 220 %endif 221 BS3_SET_BITS 16 208 222 %endmacro 209 223 … … 275 289 276 290 ;; 291 ; Mangles a 16-bit and 32-bit accessible data name. 292 ; @remarks Requires the use of the BS3_SET_BITS macro instead of the BITS directive. 293 %define BS3_DATA_NM(a_Name) _ %+ a_Name 294 295 ;; 277 296 ; Extern macro which mangles a DATA16 symbol correctly, redefining the 278 297 ; unmangled name to the mangled one for ease of use. … … 310 329 %endif 311 330 %1: 331 %endmacro 332 333 ;; 334 ; Global data unmangled label. 335 ; 336 ; @param %1 The unmangled name. 337 ; @param %2 The size (0 is fine). 338 ; 339 %macro BS3_GLOBAL_DATA 2 340 BS3_GLOBAL_NAME_EX BS3_DATA_NM(%1), , %2 312 341 %endmacro 313 342 … … 457 486 ; @{ 458 487 ;; The flat load address for the code after the bootsector. 459 %define BS3_ LOAD_ADDR010000h488 %define BS3_ADDR_LOAD 010000h 460 489 ;; Where we save the boot registers during init. 461 490 ; Located right before the code. 462 %define BS3_ REG_SAVE_ADDR (BS3_LOAD_ADDR- BS3REGS_size - 8)491 %define BS3_ADDR_REG_SAVE (BS3_ADDR_LOAD - BS3REGS_size - 8) 463 492 ;; Where the stack starts (initial RSP value). 464 ; Located right before the saved registers. SS.BASE=0. 465 %define BS3_STACK_ADDR (BS3_REG_SAVE_ADDR - 16) 493 ; Located 16 bytes (assumed by boot sector) before the saved registers. SS.BASE=0. 494 %define BS3_ADDR_STACK (BS3_ADDR_REG_SAVE - 16) 495 ;; The ring-0 stack (8KB) for ring transitions. 496 %define BS3_ADDR_STACK_R0 006000h 497 ;; The ring-1 stack (8KB) for ring transitions. 498 %define BS3_ADDR_STACK_R1 004000h 499 ;; The ring-2 stack (8KB) for ring transitions. 500 %define BS3_ADDR_STACK_R2 002000h 501 ;; IST1 ring-0 stack for long mode (4KB), used for double faults elsewhere. 502 %define BS3_ADDR_STACK_R0_IST1 009000h 503 ;; IST2 ring-0 stack for long mode (3KB), used for spare 0 stack elsewhere. 504 %define BS3_ADDR_STACK_R0_IST2 008000h 505 ;; IST3 ring-0 stack for long mode (1KB). 506 %define BS3_ADDR_STACK_R0_IST3 007400h 507 ;; IST4 ring-0 stack for long mode (1KB), used for spare 1 stack elsewhere. 508 %define BS3_ADDR_STACK_R0_IST4 007000h 509 ;; IST5 ring-0 stack for long mode (1KB). 510 %define BS3_ADDR_STACK_R0_IST5 006c00h 511 ;; IST6 ring-0 stack for long mode (1KB). 512 %define BS3_ADDR_STACK_R0_IST6 006800h 513 ;; IST7 ring-0 stack for long mode (1KB). 514 %define BS3_ADDR_STACK_R0_IST7 006400h 515 516 ;; The base address of the BS3TEXT16 segment (same as BS3_LOAD_ADDR). 517 ;; @sa BS3_SEL_TEXT16 518 %define BS3_ADDR_BS3TEXT16 010000h 519 ;; The base address of the BS3SYSTEM16 segment. 520 ;; @sa BS3_SEL_SYSTEM16 521 %define BS3_ADDR_BS3SYSTEM16 020000h 522 ;; The base address of the BS3DATA16 segment. 523 ;; @sa BS3_SEL_DATA16 524 %define BS3_ADDR_BS3DATA16 027000h 466 525 ;; @} 467 526 … … 535 594 ;; @} 536 595 537 %endif 538 596 597 598 ;; @name BS3_SEL_XXX - GDT selectors 599 ;; @{ 600 601 %define BS3_SEL_LDT 0010h ;;< The LDT selector (requires setting up). 602 %define BS3_SEL_TSS16 0020h ;;< The 16-bit TSS selector. 603 %define BS3_SEL_TSS16_DF 0028h ;;< The 16-bit TSS selector for double faults. 604 %define BS3_SEL_TSS16_SPARE0 0030h ;;< The 16-bit TSS selector for testing. 605 %define BS3_SEL_TSS16_SPARE1 0038h ;;< The 16-bit TSS selector for testing. 606 %define BS3_SEL_TSS32 0040h ;;< The 32-bit TSS selector. 607 %define BS3_SEL_TSS32_DF 0048h ;;< The 32-bit TSS selector for double faults. 608 %define BS3_SEL_TSS32_SPARE0 0050h ;;< The 32-bit TSS selector for testing. 609 %define BS3_SEL_TSS32_SPARE1 0058h ;;< The 32-bit TSS selector for testing. 610 %define BS3_SEL_TSS32_IOBP_IRB 0060h ;;< The 32-bit TSS selector with I/O permission and interrupt redirection bitmaps. 611 %define BS3_SEL_TSS32_IRB 0068h ;;< The 32-bit TSS selector with only interrupt redirection bitmap (IOPB stripped by limit). 612 %define BS3_SEL_TSS64 0070h ;;< The 64-bit TSS selector. 613 %define BS3_SEL_TSS64_SPARE0 0080h ;;< The 64-bit TSS selector. 614 %define BS3_SEL_TSS64_SPARE1 0090h ;;< The 64-bit TSS selector. 615 %define BS3_SEL_TSS64_IOBP 00a0h ;;< The 64-bit TSS selector. 616 617 %define BS3_SEL_TSS16 0020h ;;< The 16-bit TSS selector. 618 %define BS3_SEL_TSS16_DF 0028h ;;< The 16-bit TSS selector for double faults. 619 %define BS3_SEL_TSS32 0030h ;;< The 32-bit TSS selector. 620 %define BS3_SEL_TSS32_DF 0038h ;;< The 32-bit TSS selector for double faults. 621 %define BS3_SEL_TSS64 0040h ;;< The 64-bit TSS selector. 622 %define BS3_SEL_VMMDEV_MMIO16 00f8h ;;< Selector for accessing the VMMDev MMIO segment at 0100000h from 16-bit code. 623 624 %define BS3_SEL_R0_FIRST 0100h ;;< The first selector in the ring-0 block. 625 %define BS3_SEL_R0_CS16 0100h ;;< ring-0: 16-bit code selector, base 0x10000. 626 %define BS3_SEL_R0_DS16 0108h ;;< ring-0: 16-bit data selector, base 0x23000. 627 %define BS3_SEL_R0_SS16 0110h ;;< ring-0: 16-bit stack selector, base 0x00000. 628 %define BS3_SEL_R0_CS32 0118h ;;< ring-0: 32-bit flat code selector. 629 %define BS3_SEL_R0_DS32 0120h ;;< ring-0: 32-bit flat data selector. 630 %define BS3_SEL_R0_SS32 0128h ;;< ring-0: 32-bit flat stack selector. 631 %define BS3_SEL_R0_CS64 0130h ;;< ring-0: 64-bit flat code selector. 632 %define BS3_SEL_R0_DS64 0138h ;;< ring-0: 64-bit flat data & stack selector. 633 %define BS3_SEL_R0_CS16_EO 0140h ;;< ring-0: 16-bit execute-only code selector, not accessed, 0xfffe limit, CS16 base. 634 %define BS3_SEL_R0_CS16_CNF 0148h ;;< ring-0: 16-bit conforming code selector, not accessed, 0xfffe limit, CS16 base. 635 %define BS3_SEL_R0_CS16_CNF_EO 0150h ;;< ring-0: 16-bit execute-only conforming code selector, not accessed, 0xfffe limit, CS16 base. 636 %define BS3_SEL_R0_CS32_EO 0158h ;;< ring-0: 32-bit execute-only code selector, not accessed, flat. 637 %define BS3_SEL_R0_CS32_CNF 0160h ;;< ring-0: 32-bit conforming code selector, not accessed, flat. 638 %define BS3_SEL_R0_CS32_CNF_EO 0168h ;;< ring-0: 32-bit execute-only conforming code selector, not accessed, flat. 639 %define BS3_SEL_R0_CS64_EO 0170h ;;< ring-0: 64-bit execute-only code selector, not accessed, flat. 640 %define BS3_SEL_R0_CS64_CNF 0178h ;;< ring-0: 64-bit conforming code selector, not accessed, flat. 641 %define BS3_SEL_R0_CS64_CNF_EO 0180h ;;< ring-0: 64-bit execute-only conforming code selector, not accessed, flat. 642 643 %define BS3_SEL_R1_FIRST 0200h ;;< The first selector in the ring-1 block. 644 %define BS3_SEL_R1_CS16 0200h ;;< ring-1: 16-bit code selector, base 0x10000. 645 %define BS3_SEL_R1_DS16 0208h ;;< ring-1: 16-bit data selector, base 0x23000. 646 %define BS3_SEL_R1_SS16 0210h ;;< ring-1: 16-bit stack selector, base 0x00000. 647 %define BS3_SEL_R1_CS32 0218h ;;< ring-1: 32-bit flat code selector. 648 %define BS3_SEL_R1_DS32 0220h ;;< ring-1: 32-bit flat data selector. 649 %define BS3_SEL_R1_SS32 0228h ;;< ring-1: 32-bit flat stack selector. 650 %define BS3_SEL_R1_CS64 0230h ;;< ring-1: 64-bit flat code selector. 651 %define BS3_SEL_R1_DS64 0238h ;;< ring-1: 64-bit flat data & stack selector. 652 %define BS3_SEL_R1_CS16_EO 0240h ;;< ring-1: 16-bit execute-only code selector, not accessed, 0xfffe limit, CS16 base. 653 %define BS3_SEL_R1_CS16_CNF 0248h ;;< ring-1: 16-bit conforming code selector, not accessed, 0xfffe limit, CS16 base. 654 %define BS3_SEL_R1_CS16_CNF_EO 0250h ;;< ring-1: 16-bit execute-only conforming code selector, not accessed, 0xfffe limit, CS16 base. 655 %define BS3_SEL_R1_CS32_EO 0258h ;;< ring-1: 32-bit execute-only code selector, not accessed, flat. 656 %define BS3_SEL_R1_CS32_CNF 0260h ;;< ring-1: 32-bit conforming code selector, not accessed, flat. 657 %define BS3_SEL_R1_CS32_CNF_EO 0268h ;;< ring-1: 32-bit execute-only conforming code selector, not accessed, flat. 658 %define BS3_SEL_R1_CS64_EO 0270h ;;< ring-1: 64-bit execute-only code selector, not accessed, flat. 659 %define BS3_SEL_R1_CS64_CNF 0278h ;;< ring-1: 64-bit conforming code selector, not accessed, flat. 660 %define BS3_SEL_R1_CS64_CNF_EO 0280h ;;< ring-1: 64-bit execute-only conforming code selector, not accessed, flat. 661 662 %define BS3_SEL_R2_FIRST 0300h ;;< The first selector in the ring-2 block. 663 %define BS3_SEL_R2_CS16 0300h ;;< ring-2: 16-bit code selector, base 0x10000. 664 %define BS3_SEL_R2_DS16 0308h ;;< ring-2: 16-bit data selector, base 0x23000. 665 %define BS3_SEL_R2_SS16 0310h ;;< ring-2: 16-bit stack selector, base 0x00000. 666 %define BS3_SEL_R2_CS32 0318h ;;< ring-2: 32-bit flat code selector. 667 %define BS3_SEL_R2_DS32 0320h ;;< ring-2: 32-bit flat data selector. 668 %define BS3_SEL_R2_SS32 0328h ;;< ring-2: 32-bit flat stack selector. 669 %define BS3_SEL_R2_CS64 0330h ;;< ring-2: 64-bit flat code selector. 670 %define BS3_SEL_R2_DS64 0338h ;;< ring-2: 64-bit flat data & stack selector. 671 %define BS3_SEL_R2_CS16_EO 0340h ;;< ring-2: 16-bit execute-only code selector, not accessed, 0xfffe limit, CS16 base. 672 %define BS3_SEL_R2_CS16_CNF 0348h ;;< ring-2: 16-bit conforming code selector, not accessed, 0xfffe limit, CS16 base. 673 %define BS3_SEL_R2_CS16_CNF_EO 0350h ;;< ring-2: 16-bit execute-only conforming code selector, not accessed, 0xfffe limit, CS16 base. 674 %define BS3_SEL_R2_CS32_EO 0358h ;;< ring-2: 32-bit execute-only code selector, not accessed, flat. 675 %define BS3_SEL_R2_CS32_CNF 0360h ;;< ring-2: 32-bit conforming code selector, not accessed, flat. 676 %define BS3_SEL_R2_CS32_CNF_EO 0368h ;;< ring-2: 32-bit execute-only conforming code selector, not accessed, flat. 677 %define BS3_SEL_R2_CS64_EO 0370h ;;< ring-2: 64-bit execute-only code selector, not accessed, flat. 678 %define BS3_SEL_R2_CS64_CNF 0378h ;;< ring-2: 64-bit conforming code selector, not accessed, flat. 679 %define BS3_SEL_R2_CS64_CNF_EO 0380h ;;< ring-2: 64-bit execute-only conforming code selector, not accessed, flat. 680 681 %define BS3_SEL_R3_FIRST 0400h ;;< The first selector in the ring-3 block. 682 %define BS3_SEL_R3_CS16 0400h ;;< ring-3: 16-bit code selector, base 0x10000. 683 %define BS3_SEL_R3_DS16 0408h ;;< ring-3: 16-bit data selector, base 0x23000. 684 %define BS3_SEL_R3_SS16 0410h ;;< ring-3: 16-bit stack selector, base 0x00000. 685 %define BS3_SEL_R3_CS32 0418h ;;< ring-3: 32-bit flat code selector. 686 %define BS3_SEL_R3_DS32 0420h ;;< ring-3: 32-bit flat data selector. 687 %define BS3_SEL_R3_SS32 0428h ;;< ring-3: 32-bit flat stack selector. 688 %define BS3_SEL_R3_CS64 0430h ;;< ring-3: 64-bit flat code selector. 689 %define BS3_SEL_R3_DS64 0438h ;;< ring-3: 64-bit flat data & stack selector. 690 %define BS3_SEL_R3_CS16_EO 0440h ;;< ring-3: 16-bit execute-only code selector, not accessed, 0xfffe limit, CS16 base. 691 %define BS3_SEL_R3_CS16_CNF 0448h ;;< ring-3: 16-bit conforming code selector, not accessed, 0xfffe limit, CS16 base. 692 %define BS3_SEL_R3_CS16_CNF_EO 0450h ;;< ring-3: 16-bit execute-only conforming code selector, not accessed, 0xfffe limit, CS16 base. 693 %define BS3_SEL_R3_CS32_EO 0458h ;;< ring-3: 32-bit execute-only code selector, not accessed, flat. 694 %define BS3_SEL_R3_CS32_CNF 0460h ;;< ring-3: 32-bit conforming code selector, not accessed, flat. 695 %define BS3_SEL_R3_CS32_CNF_EO 0468h ;;< ring-3: 32-bit execute-only conforming code selector, not accessed, flat. 696 %define BS3_SEL_R3_CS64_EO 0470h ;;< ring-3: 64-bit execute-only code selector, not accessed, flat. 697 %define BS3_SEL_R3_CS64_CNF 0478h ;;< ring-3: 64-bit conforming code selector, not accessed, flat. 698 %define BS3_SEL_R3_CS64_CNF_EO 0480h ;;< ring-3: 64-bit execute-only conforming code selector, not accessed, flat. 699 700 %define BS3_SEL_SPARE_FIRST 0500h ;;< The first selector in the spare block 701 %define BS3_SEL_SPARE_00 0500h ;;< Spare selector number 00h. 702 %define BS3_SEL_SPARE_01 0508h ;;< Spare selector number 01h. 703 %define BS3_SEL_SPARE_02 0510h ;;< Spare selector number 02h. 704 %define BS3_SEL_SPARE_03 0518h ;;< Spare selector number 03h. 705 %define BS3_SEL_SPARE_04 0520h ;;< Spare selector number 04h. 706 %define BS3_SEL_SPARE_05 0528h ;;< Spare selector number 05h. 707 %define BS3_SEL_SPARE_06 0530h ;;< Spare selector number 06h. 708 %define BS3_SEL_SPARE_07 0538h ;;< Spare selector number 07h. 709 %define BS3_SEL_SPARE_08 0540h ;;< Spare selector number 08h. 710 %define BS3_SEL_SPARE_09 0548h ;;< Spare selector number 09h. 711 %define BS3_SEL_SPARE_0a 0550h ;;< Spare selector number 0ah. 712 %define BS3_SEL_SPARE_0b 0558h ;;< Spare selector number 0bh. 713 %define BS3_SEL_SPARE_0c 0560h ;;< Spare selector number 0ch. 714 %define BS3_SEL_SPARE_0d 0568h ;;< Spare selector number 0dh. 715 %define BS3_SEL_SPARE_0e 0570h ;;< Spare selector number 0eh. 716 %define BS3_SEL_SPARE_0f 0578h ;;< Spare selector number 0fh. 717 %define BS3_SEL_SPARE_10 0580h ;;< Spare selector number 10h. 718 %define BS3_SEL_SPARE_11 0588h ;;< Spare selector number 11h. 719 %define BS3_SEL_SPARE_12 0590h ;;< Spare selector number 12h. 720 %define BS3_SEL_SPARE_13 0598h ;;< Spare selector number 13h. 721 %define BS3_SEL_SPARE_14 05a0h ;;< Spare selector number 14h. 722 %define BS3_SEL_SPARE_15 05a8h ;;< Spare selector number 15h. 723 %define BS3_SEL_SPARE_16 05b0h ;;< Spare selector number 16h. 724 %define BS3_SEL_SPARE_17 05b8h ;;< Spare selector number 17h. 725 %define BS3_SEL_SPARE_18 05c0h ;;< Spare selector number 18h. 726 %define BS3_SEL_SPARE_19 05c8h ;;< Spare selector number 19h. 727 %define BS3_SEL_SPARE_1a 05d0h ;;< Spare selector number 1ah. 728 %define BS3_SEL_SPARE_1b 05d8h ;;< Spare selector number 1bh. 729 %define BS3_SEL_SPARE_1c 05e0h ;;< Spare selector number 1ch. 730 %define BS3_SEL_SPARE_1d 05e8h ;;< Spare selector number 1dh. 731 %define BS3_SEL_SPARE_1e 05f0h ;;< Spare selector number 1eh. 732 %define BS3_SEL_SPARE_1f 05f8h ;;< Spare selector number 1fh. 733 734 %define BS3_SEL_TILED 0600h ;;< 16-bit data tiling: First - base=0x00000000, limit=64KB. 735 %define BS3_SEL_TILED_LAST 0df8h ;;< 16-bit data tiling: Last - base=0x00ff0000, limit=64KB. 736 %define BS3_SEL_TILED_AREA_SIZE 001000000h ;;< 16-bit data tiling: Size of addressable area, in bytes. (16 MB) 737 738 %define BS3_SEL_FREE_PART1 0e00h ;;< Free selector space - part \#1. 739 %define BS3_SEL_FREE_PART1_LAST 0ff8h ;;< Free selector space - part \#1, last entry. 740 741 %define BS3_SEL_TEXT16 1000h ;;< The BS3TEXT16 selector. 742 743 %define BS3_SEL_FREE_PART2 1008h ;;< Free selector space - part \#2. 744 %define BS3_SEL_FREE_PART2_LAST 1ff8h ;;< Free selector space - part \#2, last entry. 745 746 %define BS3_SEL_SYSTEM16 2000h ;;< The BS3SYSTEM16 selector. 747 748 %define BS3_SEL_FREE_PART3 2008h ;;< Free selector space - part \#3. 749 %define BS3_SEL_FREE_PART3_LAST 26f8h ;;< Free selector space - part \#3, last entry. 750 751 %define BS3_SEL_DATA16 2700h ;;< The BS3DATA16 selector. 752 753 %define BS3_SEL_GDT_LIMIT 2707h ;;< The GDT limit. 754 755 ;; @} 756 757 758 ; 759 ; Sanity checks. 760 ; 761 %if BS3_ADDR_BS3TEXT16 != BS3_ADDR_LOAD 762 %error "BS3_ADDR_BS3TEXT16 and BS3_ADDR_LOAD are out of sync" 763 %endif 764 %if (BS3_ADDR_BS3TEXT16 / 16) != BS3_SEL_TEXT16 765 %error "BS3_ADDR_BS3TEXT16 and BS3_SEL_TEXT16 are out of sync" 766 %endif 767 %if (BS3_ADDR_BS3DATA16 / 16) != BS3_SEL_DATA16 768 %error "BS3_ADDR_BS3DATA16 and BS3_SEL_DATA16 are out of sync" 769 %endif 770 %if (BS3_ADDR_BS3SYSTEM16 / 16) != BS3_SEL_SYSTEM16 771 %error "BS3_ADDR_BS3SYSTEM16 and BS3_SEL_SYSTEM16 are out of sync" 772 %endif 773 774 %endif 775
Note:
See TracChangeset
for help on using the changeset viewer.