Changeset 58812 in vbox for trunk/src/VBox/ValidationKit/bootsectors
- Timestamp:
- Nov 22, 2015 2:56:17 AM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 14 added
- 8 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r58809 r58812 367 367 $(PATH_OBJ)/bs3kit-common-32/bs3kit-common-32.lib \ 368 368 $(PATH_OBJ)/bs3kit-common-64-asm/bs3kit-common-64-asm.lib \ 369 $(PATH_OBJ)/bs3kit-common-64-c/bs3kit-common-64-c.lib 369 $(PATH_OBJ)/bs3kit-common-64-c/bs3kit-common-64-c.lib \ 370 \ 371 $(PATH_OBJ)/bs3kit-rm/bs3kit-rm.lib \ 372 $(PATH_OBJ)/bs3kit-pe16/bs3kit-pe16.lib \ 373 $(PATH_OBJ)/bs3kit-pe32/bs3kit-pe32.lib \ 374 $(PATH_OBJ)/bs3kit-pev86/bs3kit-pev86.lib \ 375 $(PATH_OBJ)/bs3kit-pp16/bs3kit-pp16.lib \ 376 $(PATH_OBJ)/bs3kit-pp32/bs3kit-pp32.lib \ 377 $(PATH_OBJ)/bs3kit-ppv86/bs3kit-ppv86.lib \ 378 $(PATH_OBJ)/bs3kit-pae16/bs3kit-pae16.lib \ 379 $(PATH_OBJ)/bs3kit-pae32/bs3kit-pae32.lib \ 380 $(PATH_OBJ)/bs3kit-paev86/bs3kit-paev86.lib \ 381 $(PATH_OBJ)/bs3kit-lm16/bs3kit-lm16.lib \ 382 $(PATH_OBJ)/bs3kit-lm32/bs3kit-lm32.lib \ 383 $(PATH_OBJ)/bs3kit-lm64-asm/bs3kit-lm64-asm.lib \ 384 $(PATH_OBJ)/bs3kit-lm64-c/bs3kit-lm64-c.lib 370 385 371 386 # BS3Kit template for 32-bit code. … … 441 456 bs3-bootsector_SOURCES = bs3-bootsector.asm 442 457 458 # 443 459 # Common sources to be compiled into _p16, _p32 and _p64 versions. 460 # 444 461 VBOX_BS3KIT_COMMON_SOURCES = \ 445 462 bs3-cmn-Shutdown.asm \ … … 473 490 bs3-cmn-SlabListAllocEx.c \ 474 491 bs3-cmn-SlabListFree.c \ 492 bs3-cmn-SwitchToRing0.asm \ 493 bs3-cmn-SwitchToRing1.asm \ 494 bs3-cmn-SwitchToRing2.asm \ 495 bs3-cmn-SwitchToRing3.asm \ 496 bs3-cmn-SwitchTo16Bit.asm \ 497 bs3-cmn-SwitchTo32Bit.asm \ 498 bs3-cmn-SwitchTo64Bit.asm \ 475 499 bs3-cmn-TestData.c \ 476 500 bs3-cmn-TestInit.c \ … … 482 506 ../../../Runtime/common/asm/ASMBitNextSet.asm 483 507 484 # The BS3Kit library.508 # The 16-bit BS3Kit library. 485 509 LIBRARIES += bs3kit-common-16 486 510 bs3kit-common-16_TEMPLATE = VBoxBS3KitImg … … 526 550 bs3kit-common-64-c_SOURCES = $(filter-out %.asm,$(VBOX_BS3KIT_COMMON_SOURCES)) 527 551 552 553 # 554 # Common sources to be compiled for each CPU mode. 555 # 556 VBOX_BS3KIT_MODE_SOURCES = \ 557 bs3-mode-SwitchToRM.asm \ 558 bs3-mode-SwitchToPE16.asm \ 559 bs3-mode-SwitchToPE32.asm \ 560 bs3-mode-SwitchToPP16.asm \ 561 bs3-mode-SwitchToPP32.asm \ 562 bs3-mode-EnteredMode.asm \ 563 564 # The 16-bit real mode BS3Kit library. 565 LIBRARIES += bs3kit-rm 566 bs3kit-rm_TEMPLATE = VBoxBS3KitImg 567 bs3kit-rm_DEFS = TMPL_RM 568 bs3kit-rm_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 569 bs3-first-rm.asm 570 571 572 # The 16-bit protected mode BS3Kit library. 573 LIBRARIES += bs3kit-pe16 574 bs3kit-pe16_TEMPLATE = VBoxBS3KitImg 575 bs3kit-pe16_DEFS = TMPL_PE16 576 bs3kit-pe16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 577 bs3-first-pe16.asm 578 579 # The virtual 8086 under protected mode BS3Kit library. 580 LIBRARIES += bs3kit-pev86 581 bs3kit-pev86_TEMPLATE = VBoxBS3KitImg 582 bs3kit-pev86_DEFS = TMPL_PEV86 583 bs3kit-pev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 584 585 # The 32-bit protected mode BS3Kit library. 586 LIBRARIES += bs3kit-pe32 587 bs3kit-pe32_TEMPLATE = VBoxBS3KitImg 588 bs3kit-pe32_DEFS = TMPL_PE32 589 bs3kit-pe32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 590 591 592 # The 16-bit paged protected mode BS3Kit library. 593 LIBRARIES += bs3kit-pp16 594 bs3kit-pp16_TEMPLATE = VBoxBS3KitImg 595 bs3kit-pp16_DEFS = TMPL_PP16 596 bs3kit-pp16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 597 598 # The 32-bit paged protected mode BS3Kit library. 599 LIBRARIES += bs3kit-pp32 600 bs3kit-pp32_TEMPLATE = VBoxBS3KitImg 601 bs3kit-pp32_DEFS = TMPL_PP32 602 bs3kit-pp32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 603 604 # The virtual 8086 under protected mode BS3Kit library. 605 LIBRARIES += bs3kit-ppv86 606 bs3kit-ppv86_TEMPLATE = VBoxBS3KitImg 607 bs3kit-ppv86_DEFS = TMPL_PPV86 608 bs3kit-ppv86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 609 610 611 # The 16-bit paged protected mode BS3Kit library. 612 LIBRARIES += bs3kit-pae16 613 bs3kit-pae16_TEMPLATE = VBoxBS3KitImg 614 bs3kit-pae16_DEFS = TMPL_PAE16 615 bs3kit-pae16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 616 617 # The 32-bit paged protected mode BS3Kit library. 618 LIBRARIES += bs3kit-pae32 619 bs3kit-pae32_TEMPLATE = VBoxBS3KitImg 620 bs3kit-pae32_DEFS = TMPL_PAE32 621 bs3kit-pae32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 622 623 # The virtual 8086 under protected mode BS3Kit library. 624 LIBRARIES += bs3kit-paev86 625 bs3kit-paev86_TEMPLATE = VBoxBS3KitImg 626 bs3kit-paev86_DEFS = TMPL_PAEV86 627 bs3kit-paev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 628 629 630 # The 16-bit long mode BS3Kit library. 631 LIBRARIES += bs3kit-lm16 632 bs3kit-lm16_TEMPLATE = VBoxBS3KitImg 633 bs3kit-lm16_DEFS = TMPL_LM16 634 bs3kit-lm16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 635 636 # The 32-bit long mode BS3Kit library. 637 LIBRARIES += bs3kit-lm32 638 bs3kit-lm32_TEMPLATE = VBoxBS3KitImg 639 bs3kit-lm32_DEFS = TMPL_LM32 640 bs3kit-lm32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 641 642 # The 64-bit long mode BS3Kit library. 643 LIBRARIES += bs3kit-lm64-asm 644 bs3kit-lm64-asm_TEMPLATE = VBoxBS3KitImg 645 bs3kit-lm64-asm_DEFS = TMPL_LM64 646 bs3kit-lm64-asm_SOURCES = $(filter %.asm,$(VBOX_BS3KIT_MODE_SOURCES)) \ 647 648 # The 64-bit long mode BS3Kit library. 649 LIBRARIES += bs3kit-lm64-c 650 bs3kit-lm64-c_TEMPLATE = VBoxBS3KitImg 651 bs3kit-lm64-c_DEFS = TMPL_LM64 652 bs3kit-lm64-c_SOURCES = $(filter-out %.asm, $(VBOX_BS3KIT_MODE_SOURCES)) \ 653 654 528 655 # 529 656 # shutdown example. … … 531 658 MISCBINS += bs3-shutdown 532 659 bs3-shutdown_TEMPLATE = VBoxBS3KitImg 533 bs3-shutdown_SOURCES = bs3-first-rm.asm bs3-shutdown.c 660 bs3-shutdown_SOURCES = \ 661 bs3-first-pe16.asm \ 662 bs3-shutdown.c 534 663 535 664 536 665 include $(FILE_KBUILD_SUB_FOOTER) 537 666 667 .PRECIOUS: E:/vbox/svn/trunk/out/win.amd64/debug/obj/bs3-shutdown/bs3-shutdown.map -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Printf.c
r58811 r58812 29 29 30 30 31 BS3_DECL(size_t) bs3PrintFmtOutput(char ch, void BS3_FAR *pvUser)31 static BS3_DECL_CALLBACK(size_t) bs3PrintFmtOutput(char ch, void BS3_FAR *pvUser) 32 32 { 33 33 if (ch != '\0') -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-StrPrintf.c
r58810 r58812 47 47 48 48 49 BS3_DECL(size_t) bs3StrPrintfFmtOutput(char ch, void BS3_FAR *pvUser)49 static BS3_DECL_CALLBACK(size_t) bs3StrPrintfFmtOutput(char ch, void BS3_FAR *pvUser) 50 50 { 51 51 PBS3STRPRINTFSTATE pState = (PBS3STRPRINTFSTATE)pvUser; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-common.mac
r58809 r58812 1 1 ; $Id$ 2 2 ;; @file 3 ; BS3Kit - First Object, c alling real-mode main().3 ; BS3Kit - First Object, common stuff. 4 4 ; 5 5 … … 26 26 27 27 28 29 28 %include "bs3kit.mac" 30 29 31 30 32 31 ; 32 ; 33 33 ; Define all the segments and their grouping, just to get that right once at 34 34 ; the start of everything. 35 35 ; 36 ; 36 37 38 ; 37 39 ; 16-bit text 40 ; 38 41 BS3_BEGIN_TEXT16 39 42 BS3_GLOBAL_DATA Bs3Text16_StartOfSegment, 0 43 44 ; Entry point with eye-catcher. 45 GLOBALNAME start 46 jmp .after_eye_catcher 47 db 10,13,'eye-catcher: BS3TEXT16',10,13 48 .after_eye_catcher: 40 49 41 50 %ifdef ASM_FORMAT_ELF … … 51 60 %endif 52 61 62 63 ; 53 64 ; 16-bit data 65 ; 54 66 BS3_BEGIN_DATA16 55 67 BS3_GLOBAL_DATA Bs3Data16_StartOfSegment, 0 … … 84 96 %endif 85 97 98 99 ; 86 100 ; 32-bit text 101 ; 87 102 BS3_BEGIN_TEXT32 88 103 BS3_GLOBAL_DATA Bs3Text32_StartOfSegment, 0 … … 97 112 BS3_GLOBAL_DATA Bs3Text32_EndOfSegment, 0 98 113 114 115 ; 99 116 ; 64-bit text 117 ; 100 118 BS3_BEGIN_TEXT64 101 119 BS3_GLOBAL_DATA Bs3Text64_StartOfSegment, 0 … … 109 127 BS3_GLOBAL_DATA Bs3Text64_EndOfSegment, 0 110 128 129 130 ; 111 131 ; 32-bit data 132 ; 112 133 BS3_BEGIN_DATA32 113 134 BS3_GLOBAL_DATA Bs3Data32_StartOfSegment, 0 … … 120 141 BS3_GLOBAL_DATA Bs3Data32_EndOfSegment, 0 121 142 143 ; 122 144 ; 64-bit data 145 ; 123 146 BS3_BEGIN_DATA64 124 147 BS3_GLOBAL_DATA Bs3Data64_StartOfSegment, 0 … … 131 154 BS3_GLOBAL_DATA Bs3Data64_EndOfSegment, 0 132 155 156 157 ; 158 ; 16-bit accessible system data. 159 ; No need to do anything here. 160 ; 133 161 BS3_BEGIN_SYSTEM16 134 162 135 163 136 137 ;*********************************************************************************************************************************138 ;* External Symbols *139 ;*********************************************************************************************************************************140 BS3_BEGIN_TEXT16141 extern BS3_CMN_NM(Bs3Shutdown)142 extern NAME(Main_rm)143 144 BS3_BEGIN_SYSTEM16145 extern BS3_DATA_NM(Bs3Gdt)146 extern BS3_DATA_NM(Bs3Lgdt_Gdt)147 148 164 ; 149 ; Nothing to init here, just call main and shutdown if it returns.165 ; Switch back to the 16-bit code segment. 150 166 ; 151 167 BS3_BEGIN_TEXT16 152 GLOBALNAME start153 jmp .after_eye_catcher154 db 10,13,'eye-catcher: BS3TEXT16',10,13155 .after_eye_catcher:156 mov ax, BS3DATA16157 mov es, ax158 mov ds, ax159 call NAME(Main_rm)160 call BS3_CMN_NM(Bs3Shutdown)161 168 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-rm.asm
r58809 r58812 29 29 %include "bs3kit.mac" 30 30 31 32 31 ; 33 ; Define all the segments and their grouping, just to get that right once at34 ; the start of everything.32 ; Segment defs, grouping and related variables. 33 ; Defines the entry point 'start' as well, leaving us in BS3TEXT16. 35 34 ; 36 37 ; 16-bit text 38 BS3_BEGIN_TEXT16 39 BS3_GLOBAL_DATA Bs3Text16_StartOfSegment, 0 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 47 BS3_GLOBAL_DATA Bs3Text16_EndOfSegment, 0 48 49 %ifndef ASM_FORMAT_ELF 50 GROUP CGROUP16 BS3TEXT16 BS3TEXT16_END 51 %endif 52 53 ; 16-bit data 54 BS3_BEGIN_DATA16 55 BS3_GLOBAL_DATA Bs3Data16_StartOfSegment, 0 56 db 10,13,'eye-catcher: BS3DATA16',10,13 57 58 ALIGNDATA(16) 59 BS3_GLOBAL_DATA Bs3Data16_Size, 4 60 dd BS3_DATA_NM(Bs3Data16_EndOfSegment) wrt BS3DATA16_GROUP 61 BS3_GLOBAL_DATA Bs3Data16Thru64Text32And64_TotalSize, 4 62 dd BS3_DATA_NM(Bs3Data64_EndOfSegment) wrt BS3DATA16_GROUP 63 BS3_GLOBAL_DATA Bs3TotalImageSize, 4 64 dd BS3_DATA_NM(Bs3Data64_EndOfSegment) wrt CGROUP16 65 BS3_GLOBAL_DATA Bs3Text16_Size, 2 66 dd BS3_DATA_NM(Bs3Text16_EndOfSegment) wrt CGROUP16 67 68 %ifdef ASM_FORMAT_ELF 69 section BS3DATA16CONST align=2 progbits alloc noexec write 70 section BS3DATA16CONST2 align=2 progbits alloc noexec write 71 section BS3DATA16_DATA align=2 progbits alloc noexec write 72 section BS3DATA16_END align=2 progbits alloc noexec write 73 %else 74 section BS3DATA16CONST align=2 CLASS=FAR_DATA PUBLIC USE16 75 section BS3DATA16CONST2 align=2 CLASS=FAR_DATA PUBLIC USE16 76 section BS3DATA16_DATA align=2 CLASS=FAR_DATA PUBLIC USE16 77 section BS3DATA16_END align=2 CLASS=FAR_DATA PUBLIC USE16 78 %endif 79 80 BS3_GLOBAL_DATA Bs3Data16_EndOfSegment, 0 81 82 %ifndef ASM_FORMAT_ELF 83 GROUP BS3DATA16_GROUP BS3DATA16 BS3DATA16CONST BS3DATA16CONST2 BS3DATA16_END 84 %endif 85 86 ; 32-bit text 87 BS3_BEGIN_TEXT32 88 BS3_GLOBAL_DATA Bs3Text32_StartOfSegment, 0 89 db 10,13,'eye-catcher: BS3TEXT32',10,13 90 91 %ifdef ASM_FORMAT_ELF 92 section BS3TEXT32_END align=1 progbits alloc exec nowrite 93 %else 94 section BS3TEXT32_END align=1 CLASS=BS3CODE32 PUBLIC USE32 FLAT 95 %endif 96 97 BS3_GLOBAL_DATA Bs3Text32_EndOfSegment, 0 98 99 ; 64-bit text 100 BS3_BEGIN_TEXT64 101 BS3_GLOBAL_DATA Bs3Text64_StartOfSegment, 0 102 db 10,13,'eye-catcher: BS3TEXT64',10,13 103 104 %ifdef ASM_FORMAT_ELF 105 section BS3TEXT64_END align=1 progbits alloc exec nowrite 106 %else 107 section BS3TEXT64_END align=1 CLASS=CODE PUBLIC USE32 FLAT 108 %endif 109 BS3_GLOBAL_DATA Bs3Text64_EndOfSegment, 0 110 111 ; 32-bit data 112 BS3_BEGIN_DATA32 113 BS3_GLOBAL_DATA Bs3Data32_StartOfSegment, 0 114 db 10,13,'eye-catcher: BS3DATA32',10,13 115 %ifdef ASM_FORMAT_ELF 116 section BS3DATA32_END align=16 progbits alloc noexec write 117 %else 118 section BS3DATA32_END align=16 CLASS=FAR_DATA PUBLIC USE32 FLAT 119 %endif 120 BS3_GLOBAL_DATA Bs3Data32_EndOfSegment, 0 121 122 ; 64-bit data 123 BS3_BEGIN_DATA64 124 BS3_GLOBAL_DATA Bs3Data64_StartOfSegment, 0 125 db 10,13,'eye-catcher: BS3DATA64',10,13 126 %ifdef ASM_FORMAT_ELF 127 section BS3DATA64_END align=16 progbits alloc noexec write 128 %else 129 section BS3DATA64_END align=16 CLASS=DATA PUBLIC USE32 FLAT 130 %endif 131 BS3_GLOBAL_DATA Bs3Data64_EndOfSegment, 0 132 133 BS3_BEGIN_SYSTEM16 35 %include "bs3-first-common.mac" 134 36 135 37 38 EXTERN Main_rm 39 BS3_EXTERN_CMN Bs3Shutdown 136 40 137 ;********************************************************************************************************************************* 138 ;* External Symbols * 139 ;********************************************************************************************************************************* 140 BS3_BEGIN_TEXT16 141 extern BS3_CMN_NM(Bs3Shutdown) 142 extern NAME(Main_rm) 143 144 BS3_BEGIN_SYSTEM16 145 extern BS3_DATA_NM(Bs3Gdt) 146 extern BS3_DATA_NM(Bs3Lgdt_Gdt) 147 148 ; 149 ; Nothing to init here, just call main and shutdown if it returns. 150 ; 151 BS3_BEGIN_TEXT16 152 GLOBALNAME start 153 jmp .after_eye_catcher 154 db 10,13,'eye-catcher: BS3TEXT16',10,13 155 .after_eye_catcher: 41 ; 42 ; Nothing to init here, just call main and shutdown if it returns. 43 ; 156 44 mov ax, BS3DATA16 157 45 mov es, ax 158 46 mov ds, ax 159 47 call NAME(Main_rm) 160 call B S3_CMN_NM(Bs3Shutdown)48 call Bs3Shutdown 161 49 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-shutdown.c
r58809 r58812 9 9 10 10 /* Just a sample. */ 11 BS3_DECL(void) Main_ rm(void)11 BS3_DECL(void) Main_pe16(void) 12 12 { 13 13 void BS3_FAR *pvTmp1; … … 15 15 void BS3_FAR *pvTmp3; 16 16 void BS3_FAR *pvTmp4; 17 Bs3InitMemory_rm();18 17 19 18 Bs3TestInit("bs3-shutdown"); … … 23 22 Bs3PrintStr("\r\n"); 24 23 25 Bs3Printf("Bs3Printf: RX32=%#'RX32 string='%s' d=%d p=%p\n", UINT32_C(0xfdb97531), "my string", 42, Main_ rm);24 Bs3Printf("Bs3Printf: RX32=%#'RX32 string='%s' d=%d p=%p\n", UINT32_C(0xfdb97531), "my string", 42, Main_pe16); 26 25 27 26 pvTmp2 = Bs3MemAlloc(BS3MEMKIND_REAL, _4K); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-header.mac
r58628 r58812 502 502 %error "Both 'TMPL_PAEV86' and 'TMPL_PAE16' are defined." 503 503 %endif 504 %ifdef TMPL_PAE V86505 %error "Both 'TMPL_PAEV86' and 'TMPL_PAE V86' are defined."504 %ifdef TMPL_PAE32 505 %error "Both 'TMPL_PAEV86' and 'TMPL_PAE32' are defined." 506 506 %endif 507 507 %ifdef TMPL_LM16 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r58811 r58812 131 131 132 132 #define BS3_SEL_VMMDEV_MMIO16 0x00f8 /**< Selector for accessing the VMMDev MMIO segment at 0100000h from 16-bit code. */ 133 134 #define BS3_SEL_RING_SHIFT 8 /**< For the formula: BS3_SEL_R0_XXX + ((cs & 3) << BS3_SEL_RING_SHIFT) */ 133 135 134 136 #define BS3_SEL_R0_FIRST 0x0100 /**< The first selector in the ring-0 block. */ … … 336 338 #else 337 339 # define BS3_DECL(a_Type) DECLIMPORT(a_Type) BS3_NEAR_CODE BS3_CALL 340 #endif 341 342 /** @def BS3_DECL_CALLBACK 343 * Declares a BS3Kit callback function (typically static). 344 * 345 * Until we outgrow BS3TEXT16, we use all near functions in 16-bit. 346 * 347 * @param a_Type The return type. */ 348 #ifdef IN_BS3KIT 349 # define BS3_DECL_CALLBACK(a_Type) a_Type BS3_NEAR_CODE BS3_CALL 350 #else 351 # define BS3_DECL_CALLBACK(a_Type) a_Type BS3_NEAR_CODE BS3_CALL 338 352 #endif 339 353 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r58750 r58812 160 160 section BS3TEXT32 align=1 progbits alloc exec nowrite 161 161 %else 162 section BS3TEXT32 align=1 CLASS=BS3CODE32 PUBLIC USE32 162 section BS3TEXT32 align=1 CLASS=BS3CODE32 PUBLIC USE32 FLAT 163 163 %endif 164 164 %else … … 174 174 section BS3DATA32 align=16 progbits alloc noexec write 175 175 %else 176 section BS3DATA32 align=16 CLASS=FAR_DATA PUBLIC USE32 176 section BS3DATA32 align=16 CLASS=FAR_DATA PUBLIC USE32 FLAT 177 177 %endif 178 178 %else … … 188 188 section BS3TEXT64 align=1 progbits alloc exec nowrite 189 189 %else 190 section BS3TEXT64 align=1 CLASS=CODE PUBLIC USE32 190 section BS3TEXT64 align=1 CLASS=CODE PUBLIC USE32 FLAT ; class=CODE here because of 64-bit cl and/or wlink.exe 191 191 %endif 192 192 %else … … 202 202 section BS3DATA64 align=16 progbits alloc noexec write 203 203 %else 204 section BS3DATA64 align=16 CLASS=DATA PUBLIC USE32 204 section BS3DATA64 align=16 CLASS=DATA PUBLIC USE32 FLAT ; class=DATA here because of 64-bit cl and/or wlink.exe 205 205 %endif 206 206 %else … … 312 312 313 313 ;; 314 ; Extern macro which mangles a BS3SYSTEM16 symbol correctly, redefining the 315 ; unmangled name to the mangled one for ease of use. 316 ; 317 ; @param %1 The unmangled common name. 318 ; 319 ; @remarks Will change to the SYSTEM16 segment, use must switch back afterwards! 320 ; 321 %macro BS3_EXTERN_SYSTEM16 1 322 BS3_BEGIN_SYSTEM16 323 extern _ %+ %1 324 %undef %1 325 %define %1 _ %+ %1 326 %endmacro 327 328 329 ;; 314 330 ; Global name with ELF attributes and size. 315 331 ; … … 373 389 %endmacro 374 390 391 375 392 ;; Convenience macro for defining common procedures. 376 393 %macro BS3_PROC_BEGIN_CMN 1 … … 382 399 BS3_PROC_END BS3_CMN_NM(%1) 383 400 %endmacro 401 402 403 ;; Convenience macro for defining mode specific procedures. 404 %macro BS3_PROC_BEGIN_MODE 1 405 BS3_PROC_BEGIN TMPL_NM(%1) 406 %endmacro 407 408 ;; Convenience macro for defining mode specific procedures. 409 %macro BS3_PROC_END_MODE 1 410 BS3_PROC_END TMPL_NM(%1) 411 %endmacro 412 384 413 385 414 ;; … … 595 624 ;; Print char (cl). 596 625 %define BS3_SYSCALL_PRINT_CHR 0ca110001h 626 ;; Switch to ring-0. 627 %define BS3_SYSCALL_TO_RING0 0ca110002h 628 ;; Switch to ring-1. 629 %define BS3_SYSCALL_TO_RING1 0ca110003h 630 ;; Switch to ring-2. 631 %define BS3_SYSCALL_TO_RING2 0ca110004h 632 ;; Switch to ring-3. 633 %define BS3_SYSCALL_TO_RING3 0ca110005h 597 634 ;; @} 598 635 … … 624 661 %define BS3_SEL_TSS64 0040h ;;< The 64-bit TSS selector. 625 662 %define BS3_SEL_VMMDEV_MMIO16 00f8h ;;< Selector for accessing the VMMDev MMIO segment at 0100000h from 16-bit code. 663 664 %define BS3_SEL_RING_SHIFT 8 ;;< For the formula: BS3_SEL_R0_XXX + ((cs & 3) << BS3_SEL_RING_SHIFT) 626 665 627 666 %define BS3_SEL_R0_FIRST 0100h ;;< The first selector in the ring-0 block.
Note:
See TracChangeset
for help on using the changeset viewer.