Changeset 60422 in vbox for trunk/src/VBox/Devices/Graphics/BIOS
- Timestamp:
- Apr 11, 2016 12:39:13 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics/BIOS
- Files:
-
- 6 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/BIOS/Makefile.kmk
r56292 r60422 25 25 # VBoxVgaBios - The VGA BIOS. 26 26 # 27 MISCBINS += VBoxVgaBios 28 VBoxVgaBios_TEMPLATE = VBoxBios 29 VBoxVgaBios_ASFLAGS = -0 30 VBoxVgaBios_DEFS = VBE 31 VBoxVgaBios_SOURCES = \ 27 MISCBINS += VBoxVgaBios386 28 VBoxVgaBios386_TEMPLATE = VBoxBios 29 VBoxVgaBios386_ASFLAGS = -0 30 VBoxVgaBios386_CFLAGS = -3 31 VBoxVgaBios386_DEFS = VBE VBOX_BIOS_CPU=80386 32 VBoxVgaBios386_SOURCES = \ 32 33 vgarom.asm \ 33 34 vberom.asm \ 34 35 vgabios.c \ 35 36 vbe.c 36 VBoxVgaBios _LDFLAGS = \37 VBoxVgaBios386_LDFLAGS = \ 37 38 output raw offset=0xC0000 \ 38 39 order \ … … 44 45 segment _DATA segaddr=0xC000 offset=0x4600 \ 45 46 47 MISCBINS += VBoxVgaBios286 48 VBoxVgaBios286_EXTENDS = VBoxVgaBios386 49 VBoxVgaBios286_CFLAGS = -2 50 VBoxVgaBios286_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxVgaBios386_DEFS)) VBOX_BIOS_CPU=80286 51 52 MISCBINS += VBoxVgaBios8086 53 VBoxVgaBios8086_EXTENDS = VBoxVgaBios386 54 VBoxVgaBios8086_CFLAGS = -0 55 VBoxVgaBios8086_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxVgaBios386_DEFS)) VBOX_BIOS_CPU=8086 56 46 57 # 47 58 # Updates the alternative source file. 48 59 # 49 update-vgabios-source +| $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative.asm $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative.md5sum: \ 50 $$(VBoxVgaBios_1_TARGET) \ 51 $(VBOX_MAKE_ALTERNATIVE_SOURCE) \ 52 $(VBOX_VBOXCMP) 53 if1of ($(KBUILD_TYPE), release) 54 $(VBOX_MAKE_ALTERNATIVE_SOURCE) \ 55 --bios-image $< \ 56 --bios-map $(basename $<).map \ 57 --bios-sym $(basename $<).sym \ 60 define def_VBoxVgaBiosUpdateAltSource 61 $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).asm +| $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).md5sum: \ 62 $$$$(VBoxVgaBios$(1)_1_TARGET) \ 63 $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \ 64 $$(VBOX_VBOXCMP) 65 if1of ($$(KBUILD_TYPE), release) 66 $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \ 67 --bios-image $$< \ 68 --bios-map $$(basename $$<).map \ 69 --bios-sym $$(basename $$<).sym \ 58 70 --bios-type vga \ 59 --output $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.asm 60 $(QUIET)yasm -f bin -o $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.bin $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.asm 61 $(VBOX_VBOXCMP) $< $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.bin 62 $(CP) --changed -- $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.asm $(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm 63 $(REDIRECT) -C $(dir $(VBoxVgaBios_1_TARGET)) -- \ 64 $(MD5SUM_EXT) -bo $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.md5sum $(notdir $(VBoxVgaBios_1_TARGET)) 65 $(CP) --changed -- $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.md5sum $(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum 66 $(RM) -f -- $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.asm $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.bin $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.md5sum 67 else 68 $(QUIET)$(ECHO) "Fatal error: Can only update VBoxVgaBiosAlternative.asm/md5sum with a release build." 69 $(QUIET)exit 1 70 endif 71 --output $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm 72 $$(QUIET)yasm -f bin \ 73 -o $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).bin \ 74 -l $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).lst \ 75 $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm 76 $$(VBOX_VBOXCMP) $$< $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).bin 77 $$(CP) --changed -- $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm $$(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative$(1).asm 78 $$(REDIRECT) -C $$(dir $$(VBoxVgaBios$(1)_1_TARGET)) -- \ 79 $$(MD5SUM_EXT) -bo $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).md5sum $$(notdir $$(VBoxVgaBios$(1)_1_TARGET)) 80 $$(CP) --changed -- $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).md5sum $$(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative$(1).md5sum 81 $$(RM) -f -- $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm \ 82 $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).bin \ 83 $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).lst \ 84 $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).md5sum 85 else 86 $$(QUIET)$$(ECHO) "Fatal error: Can only update VBoxVgaBiosAlternative$(1).asm/md5sum with a release build." 87 $$(QUIET)exit 1 88 endif 89 endef 90 91 $(evalcall2 def_VBoxVgaBiosUpdateAltSource,386) 92 $(evalcall2 def_VBoxVgaBiosUpdateAltSource,286) 93 $(evalcall2 def_VBoxVgaBiosUpdateAltSource,8086) 94 95 update-vgabios-source: \ 96 $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative386.asm \ 97 $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative286.asm \ 98 $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative8086.asm 71 99 72 100 endif # VBOX_WITH_OPEN_WATCOM … … 79 107 VgaBiosBin_TEMPLATE = VBOXR3 80 108 VgaBiosBin_DEFS = IN_VBOXDD2 81 VgaBiosBin_SOURCES = \ 82 $(VgaBiosBin_0_OUTDIR)/VgaBiosBin.c 83 VgaBiosBin_DEPS = \ 84 $(VgaBiosBin_0_OUTDIR)/vbetables.h 85 VgaBiosBin_CLEAN = \ 86 $(VgaBiosBin_0_OUTDIR)/VgaBiosBin.c \ 87 $(VgaBiosBin_0_OUTDIR)/vbetables.h 109 VgaBiosBin_SOURCES = 110 VgaBiosBin_DEPS = $(VgaBiosBin_0_OUTDIR)/vbetables.h 111 VgaBiosBin_CLEAN = $(VgaBiosBin_0_OUTDIR)/vbetables.h 88 112 89 ifdef VBOX_WITH_OPEN_WATCOM 90 $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin.c: $$(VBoxVgaBios_1_TARGET) $(VBOX_BIN2C) | $$(dir $$@) 91 $(call MSG_TOOL,bin2c,VgaBiosBin,$<,$@) 92 $(QUIET)$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary $< $@ 93 else 94 VgaBiosBin_CLEAN += $(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom 113 define def_VBoxVgaBiosBin 114 VgaBiosBin_SOURCES += $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c 115 VgaBiosBin_CLEAN += $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c 116 ifdef VBOX_WITH_OPEN_WATCOM 117 $$$$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c: $$$$(VBoxVgaBios$(1)_1_TARGET) $$(VBOX_BIN2C) | $$$$(dir $$$$@) 118 $$(call MSG_TOOL,bin2c,VgaBiosBin,$$<,$$@) 119 $$(QUIET)$$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary$(1) $$< $$@ 120 else 121 VgaBiosBin_CLEAN += $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom 95 122 96 $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin.c + $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom: \ 97 $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative.asm \ 98 $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative.md5sum \ 99 $(VBOX_BIN2C) | $$(dir $$@) 100 $(call MSG_TOOL,bin2c,VgaBiosBin,$<,$@) 101 $(QUIET)yasm -f bin -o $(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom $< 102 $(QUIET)$(REDIRECT) -C $(VgaBiosBin_0_OUTDIR) -- \ 103 $(MD5SUM_EXT) -c $(basename $<).md5sum 104 $(QUIET)$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary $(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom $@ 105 $(QUIET)$(RM) -f -- $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom 106 endif 123 $$$$(VgaBiosBin_0_OUTDIR)/VgaBiosBin.c + $$$$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom: \ 124 $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).asm \ 125 $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).md5sum \ 126 $$(VBOX_BIN2C) | $$$$(dir $$$$@) 127 $$(call MSG_TOOL,bin2c,VgaBiosBin,$$<,$$@) 128 $$(QUIET)yasm -f bin -o $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom $$< 129 $$(QUIET)$$(REDIRECT) -C $$(VgaBiosBin_0_OUTDIR) -- \ 130 $$(MD5SUM_EXT) -c $$(basename $$<).md5sum 131 $$(QUIET)$$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary$(1) $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom $$@ 132 $$(QUIET)$$(RM) -f -- $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom 133 endif 134 endef 135 $(evalcall2 def_VBoxVgaBiosBin,386) 136 $(evalcall2 def_VBoxVgaBiosBin,286) 137 $(evalcall2 def_VBoxVgaBiosBin,8086) 107 138 108 139 … … 142 173 INSTALLS += VBoxVgaBiosSym 143 174 VBoxVgaBiosSym_TEMPLATE = VBoxDbgSyms 144 VBoxVgaBiosSym_SOURCES = $(basename $(VBoxVgaBios_1_TARGET)).sym 175 VBoxVgaBiosSym_SOURCES = \ 176 $(basename $(VBoxVgaBios386_1_TARGET)).sym \ 177 $(basename $(VBoxVgaBios286_1_TARGET)).sym \ 178 $(basename $(VBoxVgaBios8086_1_TARGET)).sym 145 179 endif 146 180 -
trunk/src/VBox/Devices/Graphics/BIOS/inlines.h
r56292 r60422 75 75 #pragma aux rep_insw = ".286" "rep insw" parm [es di] [cx] [dx] value [es di] modify exact [cx di]; 76 76 77 #if VBOX_BIOS_CPU >= 80386 77 78 char __far *rep_insd(char __far *buffer, unsigned ndwords, unsigned port); 78 #pragma aux rep_insd = ".386" "rep insd" parm [es di] [cx] [dx] value [es di] modify exact [cx di]; 79 # pragma aux rep_insd = ".386" "rep insd" parm [es di] [cx] [dx] value [es di] modify exact [cx di]; 80 #endif 79 81 80 82 char __far *rep_outsb(char __far *buffer, unsigned nbytes, unsigned port); … … 84 86 #pragma aux rep_outsw = ".286" "rep outs dx,word ptr es:[si]" parm [es si] [cx] [dx] value [es si] modify exact [cx si]; 85 87 88 #if VBOX_BIOS_CPU >= 80386 86 89 char __far *rep_outsd(char __far *buffer, unsigned ndwords, unsigned port); 87 #pragma aux rep_outsd = ".386" "rep outs dx,dword ptr es:[si]" parm [es si] [cx] [dx] value [es si] modify exact [cx si]; 90 # pragma aux rep_outsd = ".386" "rep outs dx,dword ptr es:[si]" parm [es si] [cx] [dx] value [es si] modify exact [cx si]; 91 #endif 88 92 89 93 uint16_t __far swap_16(uint16_t val); -
trunk/src/VBox/Devices/Graphics/BIOS/vberom.asm
r55666 r60422 38 38 39 39 include vgadefs.inc 40 include commondefs.inc 40 41 41 42 public _vga_compat_setup … … 56 57 VGAROM segment public 'CODE' 57 58 58 .386 59 SET_DEFAULT_CPU 59 60 60 61 VBE_BYTEWISE_IO EQU 1 … … 123 124 jbe get_bpp_noinc 124 125 mov ah, al 126 if VBOX_BIOS_CPU gt 8086 125 127 shr ah, 3 128 else 129 shr ah, 1 130 shr ah, 1 131 shr ah, 1 132 endif 126 133 test al, 07 127 134 jz get_bpp_noinc … … 283 290 shr bx, 1 284 291 set_width_svga: 292 if VBOX_BIOS_CPU gt 8086 285 293 shr bx, 3 294 else 295 shr bx, 1 296 shr bx, 1 297 shr bx, 1 298 endif 286 299 mov dx, VGAREG_VGA_CRTC_ADDRESS 287 300 mov ah, bl … … 342 355 pop ax 343 356 push ax 357 if VBOX_BIOS_CPU gt 8086 344 358 shr ax, 3 359 else 360 shr ax, 1 361 shr ax, 1 362 shr ax, 1 363 endif 345 364 dec ax 346 365 mov ah, al … … 588 607 or bl, bl 589 608 jnz no_4bpp_1 609 if VBOX_BIOS_CPU gt 8086 590 610 shl ax, 3 611 else 612 shl ax, 1 613 shl ax, 1 614 shl ax, 1 615 endif 591 616 mov bl, 1 592 617 no_4bpp_1: … … 604 629 or bl, bl 605 630 jnz no_4bpp_2 631 if VBOX_BIOS_CPU gt 8086 606 632 shr ax, 3 633 else 634 shr ax, 1 635 shr ax, 1 636 shr ax, 1 637 endif 607 638 mov bl, 1 608 639 no_4bpp_2: … … 770 801 endif 771 802 set_palette_data: 772 pushad803 DO_PUSHAD 773 804 push ds 774 805 push es … … 780 811 mov si, di 781 812 set_pal_loop: 813 if VBOX_BIOS_CPU ge 80386 782 814 lodsd 783 815 ror eax, 16 … … 787 819 rol eax, 8 788 820 out dx, al 821 else 822 lodsw 823 mov bx, ax 824 lodsw 825 out dx, al 826 mov al, bh 827 out dx, al 828 mov al, bl 829 out dx, al 830 endif 789 831 loop set_pal_loop 790 832 pop ds 791 popad833 DO_POPAD 792 834 vbe_09_ok: 793 835 mov ax, 004Fh … … 795 837 796 838 get_palette_data: 797 pushad839 DO_PUSHAD 798 840 mov al, dl 799 841 mov dx, VGAREG_DAC_READ_ADDRESS 800 842 out dx, al 801 843 add dl, 2 844 if VBOX_BIOS_CPU ge 80386 802 845 get_pal_loop: 803 846 xor eax, eax … … 808 851 in al, dx 809 852 stosd 853 else 854 xor bx, bx 855 get_pal_loop: 856 in al, dx 857 mov bl, al 858 in al, dx 859 mov ah, al 860 in al, dx 861 stosw 862 mov ax, bx 863 stosw 864 endif 810 865 loop get_pal_loop 811 popad866 DO_POPAD 812 867 jmp vbe_09_ok 813 868 -
trunk/src/VBox/Devices/Graphics/BIOS/vgarom.asm
r43527 r60422 34 34 35 35 include vgadefs.inc 36 include commondefs.inc 36 37 37 38 public vgabios_int10_handler … … 79 80 ;; 80 81 81 .28682 SET_DEFAULT_CPU_286 82 83 83 84 vgabios_int10_handler: … … 86 87 push es 87 88 push ds 88 pusha89 DO_PUSHA 89 90 mov bx, 0C000h 90 91 mov ds, bx 91 92 call _int10_debugmsg 92 popa93 DO_POPA 93 94 pop ds 94 95 pop es … … 199 200 push es 200 201 push ds 201 pusha202 DO_PUSHA 202 203 203 204 ;; We have to set ds to access the right data segment … … 206 207 call _int10_func 207 208 208 popa209 DO_POPA 209 210 pop ds 210 211 pop es … … 484 485 and al, 0F7h 485 486 and bl, 01 487 if VBOX_BIOS_CPU gt 8086 486 488 shl bl, 3 489 else 490 shl bl, 1 491 shl bl, 1 492 shl bl, 1 493 endif 487 494 or al, bl 488 495 mov dx, VGAREG_ACTL_ADDRESS … … 655 662 jnz set_dac_page 656 663 and al, 07Fh 664 if VBOX_BIOS_CPU gt 8086 657 665 shl bh, 7 666 else 667 shl bh, 1 668 shl bh, 1 669 shl bh, 1 670 shl bh, 1 671 shl bh, 1 672 shl bh, 1 673 shl bh, 1 674 endif 658 675 or al, bh 659 676 mov dx, VGAREG_ACTL_ADDRESS … … 670 687 and al, 80h 671 688 jnz set_dac_16_page 689 if VBOX_BIOS_CPU gt 8086 672 690 shl bh, 2 691 else 692 shl bh, 1 693 shl bh, 1 694 endif 673 695 set_dac_16_page: 674 696 and bh, 0Fh … … 778 800 in al, dx 779 801 mov bl, al 802 if VBOX_BIOS_CPU gt 8086 780 803 shr bl, 7 804 else 805 shr bl, 1 806 shr bl, 1 807 shr bl, 1 808 shr bl, 1 809 shr bl, 1 810 shr bl, 1 811 shr bl, 1 812 endif 781 813 mov dx, VGAREG_ACTL_RESET 782 814 in al, dx … … 790 822 test bl, 01 791 823 jnz get_dac_16_page 824 if VBOX_BIOS_CPU gt 8086 792 825 shr bh, 2 826 else 827 shr bh, 1 828 shr bh, 1 829 endif 793 830 get_dac_16_page: 794 831 mov dx, VGAREG_ACTL_RESET … … 923 960 mov dl, al 924 961 and dl, 01 962 if VBOX_BIOS_CPU gt 8086 925 963 shl dl, 3 964 else 965 shl dl, 1 966 shl dl, 1 967 shl dl, 1 968 endif 926 969 mov ax, BIOSMEM_SEG 927 970 mov ds, ax
Note:
See TracChangeset
for help on using the changeset viewer.