Changeset 60422 in vbox for trunk/src/VBox/Devices/PC/BIOS
- Timestamp:
- Apr 11, 2016 12:39:13 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/PC/BIOS
- Files:
-
- 6 added
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/Makefile.kmk
r56292 r60422 25 25 # VBoxPcBios - The PC BIOS. 26 26 # 27 MISCBINS += VBoxPcBios 28 VBoxPcBios_TEMPLATE = VBoxBios 29 VBoxPcBios_DEFS = \ 27 MISCBINS += VBoxPcBios386 28 VBoxPcBios386_TEMPLATE = VBoxBios 29 VBoxPcBios386_BLD_TYPE = release 30 VBoxPcBios386_CFLAGS = -3 31 VBoxPcBios386_DEFS = \ 30 32 VBOX_PC_BIOS \ 31 33 VBOX_LANBOOT_SEG=0xE200 \ 32 34 VBOX_WITH_SCSI \ 33 VBOX_WITH_AHCI 34 VBoxPcBios_LDFLAGS = \ 35 VBOX_WITH_AHCI \ 36 VBOX_BIOS_CPU=80386 37 #VBoxPcBios386_DEFS.debug = DEBUG_ATA DEBUG_POST DEBUG_INT13 38 VBoxPcBios386_LDFLAGS = \ 35 39 output raw offset=0xF0000 \ 36 40 order \ … … 41 45 segment BIOS32 segaddr=0xF000 offset=0xDA00 \ 42 46 segment BIOSSEG segaddr=0xF000 offset=0xE000 43 VBoxPcBios _SOURCES = \47 VBoxPcBios386_SOURCES = \ 44 48 post.c \ 45 49 bios.c \ … … 68 72 pcibio32.asm \ 69 73 apm_pm.asm \ 70 $(VBoxPcBios32_ 1_TARGET)\74 $(VBoxPcBios32_0_OUTDIR)/VBoxPcBios32.lib \ 71 75 orgs.asm 76 #$(VBoxPcBios32_1_TARGET) - reference is lost when extending the target. weird. 72 77 73 78 # For 32-bit C code in PC BIOS. … … 77 82 pci32.c 78 83 84 MISCBINS += VBoxPcBios286 85 VBoxPcBios286_EXTENDS = VBoxPcBios386 86 VBoxPcBios286_CFLAGS = -2 87 VBoxPcBios286_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=80286 88 89 MISCBINS += VBoxPcBios8086 90 VBoxPcBios8086_EXTENDS = VBoxPcBios386 91 VBoxPcBios8086_CFLAGS = -0 92 VBoxPcBios8086_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=80186 ## @todo get it working as 8086! 93 94 79 95 # 80 # Updates the alternative source file .96 # Updates the alternative source files. 81 97 # 82 update-pcbios-source +| $(PATH_SUB_CURRENT)/VBoxBiosAlternative.asm $(PATH_SUB_CURRENT)/VBoxBiosAlternative.md5sum: \ 83 $$(VBoxPcBios_1_TARGET) \ 84 $(VBOX_MAKE_ALTERNATIVE_SOURCE) \ 85 $(VBOX_VBOXCMP) 86 if1of ($(KBUILD_TYPE), release) 87 $(VBOX_MAKE_ALTERNATIVE_SOURCE) \ 88 --bios-image $< \ 89 --bios-map $(basename $<).map \ 90 --bios-sym $(basename $<).sym \ 91 --bios-type system \ 92 --output $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm 93 $(QUIET)yasm -f bin -o $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.bin $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm 94 $(VBOX_VBOXCMP) $< $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.bin 95 $(CP) --changed -- $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm $(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm 96 $(REDIRECT) -C $(dir $(VBoxPcBios_1_TARGET)) -- \ 97 $(MD5SUM_EXT) -bo $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.md5sum $(notdir $(VBoxPcBios_1_TARGET)) 98 $(CP) --changed -- $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.md5sum $(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum 99 $(RM) -f -- $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.bin $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.md5sum 100 else 101 $(QUIET)$(ECHO) "Fatal error: Can only update VBoxBiosAlternative.asm/md5sum with a release build." 102 $(QUIET)exit 1 103 endif 98 define def_VBoxPcBiosUpdateAltSource 99 100 $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm +| $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum: \ 101 $$$$(VBoxPcBios$(1)_1_TARGET) \ 102 $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \ 103 $$(VBOX_VBOXCMP) 104 if1of ($(KBUILD_TYPE), release) 105 $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \ 106 --bios-image $$< \ 107 --bios-map $$(basename $$<).map \ 108 --bios-sym $$(basename $$<).sym \ 109 --bios-type system \ 110 --output $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm 111 $$(QUIET)yasm -f bin -o $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm 112 $$(VBOX_VBOXCMP) $$< $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin 113 $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).asm 114 $$(REDIRECT) -C $$(dir $$(VBoxPcBios$(1)_1_TARGET)) -- \ 115 $$(MD5SUM_EXT) -bo $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(notdir $$(VBoxPcBios$(1)_1_TARGET)) 116 $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).md5sum 117 $$(RM) -f -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative.bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum 118 else 119 $$(QUIET)$$(ECHO) "Fatal error: Can only update VBoxBiosAlternative$(1).asm/md5sum with a release build." 120 $$(QUIET)exit 1 121 endif 122 123 endef 124 125 $(evalcall2 def_VBoxPcBiosUpdateAltSource,386) 126 $(evalcall2 def_VBoxPcBiosUpdateAltSource,286) 127 $(evalcall2 def_VBoxPcBiosUpdateAltSource,8086) 128 129 update-pcbios-source: \ 130 $(PATH_SUB_CURRENT)/VBoxBiosAlternative386.asm \ 131 $(PATH_SUB_CURRENT)/VBoxBiosAlternative286.asm \ 132 $(PATH_SUB_CURRENT)/VBoxBiosAlternative8086.asm 104 133 105 134 endif # VBOX_WITH_OPEN_WATCOM … … 112 141 PcBiosBin_TEMPLATE = VBOXR3 113 142 PcBiosBin_DEFS = IN_VBOXDD2 114 PcBiosBin_SOURCES = $(PcBiosBin_0_OUTDIR)/PcBiosBin.c115 PcBiosBin_CLEAN = $(PcBiosBin_0_OUTDIR)/PcBiosBin.c116 143 117 ifdef VBOX_WITH_OPEN_WATCOM 118 $$(PcBiosBin_0_OUTDIR)/PcBiosBin.c: $$(VBoxPcBios_1_TARGET) $(VBOX_BIN2C) | $$(dir $$@) 119 $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@) 120 $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $< $@ 121 else 122 PcBiosBin_CLEAN += $(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom 144 define def_VBoxPcBiosBin 145 PcBiosBin_CLEAN += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c 146 PcBiosBin_SOURCES += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c 123 147 124 $$(PcBiosBin_0_OUTDIR)/PcBiosBin.c + $$(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom: \ 125 $(PATH_SUB_CURRENT)/VBoxBiosAlternative.asm \ 126 $(PATH_SUB_CURRENT)/VBoxBiosAlternative.md5sum \ 127 $(VBOX_BIN2C) | $$(dir $$@) 128 $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@) 129 $(QUIET)yasm -f bin -o $(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom $< 130 $(QUIET)$(REDIRECT) -C $(PcBiosBin_0_OUTDIR) -- \ 131 $(MD5SUM_EXT) -c $(basename $<).md5sum 132 $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom $@ 133 $(QUIET)$(RM) -f -- $$(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom 134 endif 148 ifdef VBOX_WITH_OPEN_WATCOM 149 $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c: $$$$(VBoxPcBios$(1)_1_TARGET) $$(VBOX_BIN2C) | $$$$(dir $$$$@) 150 $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@) 151 $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$< $$@ 152 else 153 PcBiosBin_CLEAN += $(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom 154 155 $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c + $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom: \ 156 $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm \ 157 $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum \ 158 $$(VBOX_BIN2C) | $$$$(dir $$$$@) 159 $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@) 160 $$(QUIET)yasm -f bin -o $$(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom $$< 161 $$(QUIET)$$(REDIRECT) -C $$(PcBiosBin_0_OUTDIR) -- \ 162 $$(MD5SUM_EXT) -c $$(basename $$<).md5sum 163 $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom $@ 164 $$(QUIET)$$(RM) -f -- $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom 165 endif 166 endef 167 $(evalcall2 def_VBoxPcBiosBin,386) 168 $(evalcall2 def_VBoxPcBiosBin,286) 169 $(evalcall2 def_VBoxPcBiosBin,8086) 170 135 171 136 172 … … 141 177 INSTALLS += VBoxPcBiosSym 142 178 VBoxPcBiosSym_TEMPLATE = VBoxDbgSyms 143 VBoxPcBiosSym_SOURCES = $(basename $(VBoxPcBios_1_TARGET)).sym 179 VBoxPcBiosSym_SOURCES = \ 180 $(basename $(VBoxPcBios386_1_TARGET)).sym \ 181 $(basename $(VBoxPcBios286_1_TARGET)).sym \ 182 $(basename $(VBoxPcBios8086_1_TARGET)).sym 144 183 endif 145 184 -
trunk/src/VBox/Devices/PC/BIOS/apm_pm.asm
r56292 r60422 16 16 17 17 18 include commondefs.inc 19 18 20 ;; 16-bit protected mode APM entry point 19 21 … … 25 27 public apm_pm16_entry 26 28 27 .28629 SET_DEFAULT_CPU_286 28 30 29 31 -
trunk/src/VBox/Devices/PC/BIOS/ata.c
r58818 r60422 67 67 68 68 void insd_discard(unsigned ndwords, unsigned port); 69 #pragma aux insd_discard = \ 69 #if VBOX_BIOS_CPU >= 80386 70 # pragma aux insd_discard = \ 70 71 ".386" \ 71 72 "push eax" \ … … 75 76 "pop eax" \ 76 77 parm [cx] [dx] modify exact [cx] nomemory; 78 #endif 77 79 78 80 // --------------------------------------------------------------------------- … … 222 224 blksize = bios_dsk->devices[device].blksize; 223 225 if (blksize == 0) { /* If transfer size is exactly 64K */ 226 #if VBOX_BIOS_CPU >= 80386 224 227 if (mode == ATA_MODE_PIO32) 225 228 blksize = 0x4000; 226 229 else 230 #endif 227 231 blksize = 0x8000; 228 232 } else { 233 #if VBOX_BIOS_CPU >= 80386 229 234 if (mode == ATA_MODE_PIO32) 230 235 blksize >>= 2; 231 236 else 237 #endif 232 238 blksize >>= 1; 233 239 } … … 309 315 buffer = MK_FP(FP_SEG(buffer) + 0x80, FP_OFF(buffer) - 0x800); 310 316 311 if (mode == ATA_MODE_PIO32) { 317 #if VBOX_BIOS_CPU >= 80386 318 if (mode == ATA_MODE_PIO32) 312 319 buffer = rep_insd(buffer, blksize, iobase1); 313 } else { 320 else 321 #endif 314 322 buffer = rep_insw(buffer, blksize, iobase1); 315 }316 323 bios_dsk->drqp.trsfsectors += mult_blk_cnt; 317 324 count--; … … 691 698 mode = bios_dsk->devices[device].mode; 692 699 blksize = 0x200; // was = bios_dsk->devices[device].blksize; 700 #if VBOX_BIOS_CPU >= 80386 693 701 if (mode == ATA_MODE_PIO32) 694 702 blksize >>= 2; 695 703 else 704 #endif 696 705 blksize >>= 1; 697 706 … … 768 777 buffer = MK_FP(FP_SEG(buffer) + 0x80, FP_OFF(buffer) - 0x800); 769 778 770 if (mode == ATA_MODE_PIO32) { 779 #if VBOX_BIOS_CPU >= 80386 780 if (mode == ATA_MODE_PIO32) 771 781 buffer = rep_outsd(buffer, blksize, iobase1); 772 } else { 782 else 783 #endif 773 784 buffer = rep_outsw(buffer, blksize, iobase1); 774 }775 785 776 786 bios_dsk->drqp.trsfsectors++; … … 1051 1061 } 1052 1062 1063 #if VBOX_BIOS_CPU >= 80386 1053 1064 if (lmode == ATA_MODE_PIO32) { 1054 1065 lcount >>= 2; 1055 1066 lbefore >>= 2; 1056 1067 lafter >>= 2; 1057 } 1058 else { 1068 } else 1069 #endif 1070 { 1059 1071 lcount >>= 1; 1060 1072 lbefore >>= 1; … … 1062 1074 } 1063 1075 1076 #if VBOX_BIOS_CPU >= 80386 1064 1077 if (lmode == ATA_MODE_PIO32) { 1065 1078 if (lbefore) … … 1068 1081 if (lafter) 1069 1082 insd_discard(lafter, iobase1); 1070 } else { 1083 } else 1084 #endif 1085 { 1071 1086 if (lbefore) 1072 1087 insw_discard(lbefore, iobase1); -
trunk/src/VBox/Devices/PC/BIOS/biosint.h
r56292 r60422 51 51 #define BX_APM 1 52 52 53 #define DEBUG_ATA 0 54 #define DEBUG_AHCI 0 55 #define DEBUG_SCSI 0 56 #define DEBUG_CD_BOOT 0 57 #define DEBUG_ELTORITO 0 58 #define DEBUG_INT13_HD 0 59 #define DEBUG_INT13_FL 0 60 #define DEBUG_INT13_CD 0 61 #define DEBUG_INT15 0 62 #define DEBUG_INT15_MS 0 63 #define DEBUG_INT16 0 64 #define DEBUG_INT1A 0 65 #define DEBUG_INT74 0 66 #define DEBUG_PCI 0 67 #define DEBUG_APM 0 68 #define DEBUG_POST 0 53 #ifndef DEBUG_ATA 54 # define DEBUG_ATA 0 55 #endif 56 #ifdef DEBUG_AHCI 57 # define DEBUG_AHCI 0 58 #endif 59 #ifndef DEBUG_SCSI 60 # define DEBUG_SCSI 0 61 #endif 62 #ifndef DEBUG_CD_BOOT 63 # define DEBUG_CD_BOOT 0 64 #endif 65 #ifndef DEBUG_ELTORITO 66 # define DEBUG_ELTORITO 0 67 #endif 68 #ifndef DEBUG_INT13_HD 69 # define DEBUG_INT13_HD 0 70 #endif 71 #ifndef DEBUG_INT13_FL 72 # define DEBUG_INT13_FL 0 73 #endif 74 #ifndef DEBUG_INT13_CD 75 # define DEBUG_INT13_CD 0 76 #endif 77 #ifndef DEBUG_INT15 78 # define DEBUG_INT15 0 79 #endif 80 #ifndef DEBUG_INT15_MS 81 # define DEBUG_INT15_MS 0 82 #endif 83 #ifndef DEBUG_INT16 84 # define DEBUG_INT16 0 85 #endif 86 #ifndef DEBUG_INT1A 87 # define DEBUG_INT1A 0 88 #endif 89 #ifndef DEBUG_INT74 90 # define DEBUG_INT74 0 91 #endif 92 #ifndef DEBUG_PCI 93 # define DEBUG_PCI 0 94 #endif 95 #ifndef DEBUG_APM 96 # define DEBUG_APM 0 97 #endif 98 #ifndef DEBUG_POST 99 # define DEBUG_POST 0 100 #endif 69 101 70 102 #define FP_OFF(p) ((unsigned)(p)) -
trunk/src/VBox/Devices/PC/BIOS/inlines.h
r58819 r60422 106 106 #pragma aux rep_insw = ".286" "rep insw" parm [es di] [cx] [dx] value [es di] modify exact [cx di]; 107 107 108 # if VBOX_BIOS_CPU >= 80386 108 109 char __far *rep_insd(char __far *buffer, unsigned ndwords, unsigned port); 109 #pragma aux rep_insd = ".386" "rep insd" parm [es di] [cx] [dx] value [es di] modify exact [cx di]; 110 # pragma aux rep_insd = ".386" "rep insd" parm [es di] [cx] [dx] value [es di] modify exact [cx di]; 111 # endif 110 112 111 113 char __far *rep_outsb(char __far *buffer, unsigned nbytes, unsigned port); … … 115 117 #pragma aux rep_outsw = ".286" "rep outs dx,word ptr es:[si]" parm [es si] [cx] [dx] value [es si] modify exact [cx si]; 116 118 119 # if VBOX_BIOS_CPU >= 80386 117 120 char __far *rep_outsd(char __far *buffer, unsigned ndwords, unsigned port); 118 #pragma aux rep_outsd = ".386" "rep outs dx,dword ptr es:[si]" parm [es si] [cx] [dx] value [es si] modify exact [cx si]; 121 # pragma aux rep_outsd = ".386" "rep outs dx,dword ptr es:[si]" parm [es si] [cx] [dx] value [es si] modify exact [cx si]; 122 # endif 119 123 120 124 uint16_t swap_16(uint16_t val); -
trunk/src/VBox/Devices/PC/BIOS/orgs.asm
r60402 r60422 39 39 ;; 40 40 41 42 41 ; Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice 43 42 ; other than GPL or LGPL is available it will apply instead, Oracle elects to use only … … 47 46 ; of the LGPL is applied is otherwise unspecified. 48 47 48 49 include commondefs.inc 50 49 51 EBDA_SEG equ 09FC0h ; starts at 639K 50 52 EBDA_SIZE equ 1 ; 1K … … 75 77 org addr - BIOS_FIX_BASE - 2 76 78 db 'XM' 79 BIOSORG_CHECK addr 77 80 endm 78 81 … … 93 96 cld 94 97 endm 98 95 99 96 100 ;; External function in separate modules … … 192 196 ;; and data when possible. 193 197 194 .286p 198 SET_DEFAULT_CPU_286 195 199 196 200 BIOSSEG segment 'CODE' … … 236 240 cli 237 241 242 if VBOX_BIOS_CPU ge 80286 238 243 ;; Check if in protected (V86) mode. If so, the CPU needs 239 244 ;; to be reset. 245 .286p 240 246 smsw ax 241 247 test ax, 1 242 248 jz in_real_mode 249 SET_DEFAULT_CPU_286 250 endif 243 251 244 252 ;; Reset processor to get out of protected mode. Use system … … 324 332 ;; 0ah = jump through 40:67 (no EOI) ;ba x 1 %fe05b ; ba x 1 %18b81 325 333 cmp al, 0ah 326 je eoi_jmp_post334 je no_eoi_jmp_post 327 335 328 336 ;; any other shutdown status values are ignored … … 378 386 call _log_bios_start 379 387 388 if VBOX_BIOS_CPU ge 80386 380 389 call pmode_setup 390 endif 381 391 382 392 ;; set all interrupts in 00h-5Fh range to default handler … … 416 426 417 427 ;; Initialize PCI devices. This can and should be done early. 428 if VBOX_BIOS_CPU ge 80386 418 429 call pcibios_init_iomem_bases 419 430 call pcibios_init_irqs 431 endif 420 432 SET_INT_VECTOR 1Ah, BIOSSEG, int1a_handler 421 433 … … 616 628 ;; 617 629 return_blkmove: 630 .286p 618 631 mov ax, 40h 619 632 mov ds, ax … … 641 654 sti 642 655 retf 2 643 656 SET_DEFAULT_CPU_286 657 644 658 645 659 ;; -------------------------------------------------------- … … 655 669 ;; Fixed Disk Parameter Table 656 670 ;; -------------------------------------------------------- 657 ;; BIOSORG 0E401h -fixed wrt preceding671 BIOSORG_CHECK 0E401h ; fixed wrt preceding 658 672 659 673 rom_fdpt: … … 672 686 ;; System BIOS Configuration Table 673 687 ;; -------------------------------------------------------- 674 ;; BIOSORG 0E6F5h -fixed wrt preceding688 BIOSORG_CHECK 0E6F5h ; fixed wrt preceding 675 689 ; must match BIOS_CONFIG_TABLE 676 690 bios_cfg_table: … … 740 754 push ds 741 755 push es 742 pusha756 DO_PUSHA 743 757 C_SETUP 744 758 call _int14_function 745 popa759 DO_POPA 746 760 pop es 747 761 pop ds … … 756 770 push ds 757 771 push es 758 pusha772 DO_PUSHA 759 773 C_SETUP 760 774 call _dummy_isr_function 761 popa775 DO_POPA 762 776 pop es 763 777 pop ds … … 817 831 push es 818 832 push ds 819 pusha833 DO_PUSHA 820 834 821 835 cmp ah, 0 … … 827 841 C_SETUP 828 842 call _int16_function 829 popa843 DO_POPA 830 844 pop ds 831 845 pop es … … 854 868 C_SETUP 855 869 call _int16_function 856 popa870 DO_POPA 857 871 pop ds 858 872 pop es … … 867 881 868 882 883 if VBOX_BIOS_CPU ge 80386 869 884 ;; Quick and dirty protected mode entry/exit routines 870 885 include pmode.inc … … 872 887 ;; Initialization code which needs to run in protected mode (LAPIC etc.) 873 888 include pmsetup.inc 889 endif 874 890 875 891 … … 897 913 in al, KBC_DATA 898 914 push ds 899 pusha915 DO_PUSHA 900 916 cld ; Before INT 15h (and any C code) 901 917 ifdef BX_CALL_INT15_4F … … 930 946 931 947 int09_done: 932 popa948 DO_POPA 933 949 pop ds 934 950 cli … … 947 963 948 964 int06_handler: 949 pusha965 DO_PUSHA 950 966 push es 951 967 push ds … … 954 970 pop ds 955 971 pop es 956 popa972 DO_POPA 957 973 iret 958 974 … … 977 993 ja int13_not_eltorito 978 994 979 pusha995 DO_PUSHA 980 996 push es 981 997 push ds … … 1009 1025 pop es 1010 1026 1011 pusha1027 DO_PUSHA 1012 1028 push es 1013 1029 push ds … … 1058 1074 1059 1075 ;; now the registers can be restored with 1060 ;; pop ds; pop es; popa; iret1076 ;; pop ds; pop es; DO_POPA; iret 1061 1077 test dl, 80h ; non-removable? 1062 1078 jnz int13_notfloppy … … 1071 1087 ;; ebx may be modified, save here 1072 1088 ;; TODO: check/review 32-bit register use 1089 ;; @todo figure if 80286/8086 variant is applicable. 1073 1090 .386 1074 1091 shr ebx, 16 … … 1077 1094 pop bx 1078 1095 shl ebx, 16 1079 .286 1080 1096 SET_DEFAULT_CPU_286 1081 1097 jmp int13_out 1082 1098 … … 1094 1110 pop ds 1095 1111 pop es 1096 popa1112 DO_POPA 1097 1113 iret 1098 1114 … … 1242 1258 rtc_post proc near 1243 1259 1260 if VBOX_BIOS_CPU lt 80386 ;; @todo fix loopy code below 1261 ;; get RTC seconds 1262 mov al, 0 1263 out CMOS_ADDR, al 1264 in al, CMOS_DATA ; RTC seconds, in BCD 1265 call bcd_to_bin ; ax now has seconds in binary 1266 test al, al 1267 xor ah, ah 1268 mov dx, 0x1234 ; 18206507*0x100/1000000 = 0x1234 (4660.865792) 1269 mul dx 1270 mov cx, ax ; tick count in dx:cx 1271 1272 ;; get RTC minutes 1273 mov al, 2 1274 out CMOS_ADDR, al 1275 in al, CMOS_DATA ; RTC minutes, in BCD 1276 call bcd_to_bin ; eax now has minutes in binary 1277 test al, al 1278 jz rtc_post_hours 1279 rtc_pos_min_loop: ; 18206507*60*0x100/1000000 = 0x44463 (279651.94752) 1280 add cx, 0x4463 1281 adc dx, 0x0004 1282 dec al 1283 jnz rtc_pos_min_loop 1284 1285 ;; get RTC hours 1286 rtc_post_hours: 1287 mov al, 4 1288 out CMOS_ADDR, al 1289 in al, CMOS_DATA ; RTC hours, in BCD 1290 call bcd_to_bin ; eax now has hours in binary 1291 test al, al 1292 jz rtc_pos_shift 1293 rtc_pos_hour_loop: ; 18206507*3600*0x100/1000000 = 0x100076C (16779116.8512) 1294 add cx, 0x076C 1295 adc dx, 0x0100 1296 dec al 1297 jnz rtc_pos_hour_loop 1298 1299 1300 mov ax, [46Ch] 1301 mov dx, [46Ch+2] 1302 1303 rtc_pos_shift: 1304 mov cl, ch 1305 mov ch, dl 1306 mov dl, dh 1307 xor dh, dh 1308 mov ds:[46Ch], cx ; timer tick count 1309 mov ds:[46Ch+2], dx ; timer tick count 1310 mov ds:[470h], dh ; rollover flag 1311 1312 else 1244 1313 .386 1245 1314 ;; get RTC seconds … … 1286 1355 mov ds:[470h], al ; rollover flag 1287 1356 .286 1357 endif 1288 1358 ret 1289 1359 … … 1358 1428 ;; INT 17h handler - Printer service 1359 1429 ;; -------------------------------------------------------- 1360 ;; BIOSORG 0EFD2h -fixed WRT preceding code1430 BIOSORG_CHECK 0EFD2h ; fixed WRT preceding code 1361 1431 1362 1432 jmp int17_handler ; NT floppy boot workaround … … 1365 1435 push ds 1366 1436 push es 1367 pusha1437 DO_PUSHA 1368 1438 C_SETUP 1369 1439 call _int17_function 1370 popa1440 DO_POPA 1371 1441 pop es 1372 1442 pop ds … … 1511 1581 ; TODO: the drive should be in dl already?? 1512 1582 ;; mov dl, bl ; tell guest OS what boot drive is 1583 if VBOX_BIOS_CPU lt 80386 1584 mov [bp], ax 1585 shl ax, 4 1586 mov [bp+2], ax ; set ip 1587 mov ax, [bp] 1588 else 1513 1589 .386 ; NB: We're getting garbage into high eax bits 1514 1590 shl eax, 4 ; convert seg to ip … … 1517 1593 shr eax, 4 ; get cs back 1518 1594 .286 1595 endif 1519 1596 and ax, BIOSSEG ; remove what went in ip 1520 1597 mov [bp+4], ax ; set cs … … 1552 1629 ;; INT 11h handler - Equipment list service 1553 1630 ;; -------------------------------------------------------- 1554 ;; BIOSORG 0F84Dh -fixed wrt preceding code1631 BIOSORG_CHECK 0F84Dh ; fixed wrt preceding code 1555 1632 int11_handler: 1556 1633 ;; Don't touch - fixed size! … … 1567 1644 ;; INT 15h handler - System services 1568 1645 ;; -------------------------------------------------------- 1569 ;; BIOSORG 0F859h -fixed wrt preceding code1646 BIOSORG_CHECK 0F859h ; fixed wrt preceding code 1570 1647 int15_handler: 1571 1648 pushf … … 1579 1656 cmp ah, 0d0h 1580 1657 je int15_handler32 1581 pusha1658 DO_PUSHA 1582 1659 cmp ah, 53h ; APM function? 1583 1660 je apm_call … … 1587 1664 call _int15_function 1588 1665 int15_handler_popa_ret: 1589 popa1666 DO_POPA 1590 1667 int15_handler32_ret: 1591 1668 pop es … … 1603 1680 1604 1681 int15_handler32: 1682 if VBOX_BIOS_CPU ge 80386 1605 1683 ;; need to save/restore 32-bit registers 1606 1684 .386 … … 1609 1687 popad 1610 1688 .286 1689 else 1690 DO_PUSHA 1691 call _int15_function32 1692 DO_POPA 1693 endif 1611 1694 jmp int15_handler32_ret 1612 1695 … … 1634 1717 1635 1718 sti 1636 pusha1719 DO_PUSHA 1637 1720 push es 1638 1721 push ds … … 1659 1742 pop ds 1660 1743 pop es 1661 popa1744 DO_POPA 1662 1745 iret 1663 1746 … … 1689 1772 ;; INT 1Ah handler - Time of the day + PCI BIOS 1690 1773 ;; -------------------------------------------------------- 1691 ;; BIOSORG 0FE6Eh -fixed wrt preceding table1774 BIOSORG_CHECK 0FE6Eh ; fixed wrt preceding table 1692 1775 int1a_handler: 1776 if VBOX_BIOS_CPU ge 80386 1693 1777 cmp ah, 0B1h 1694 1778 jne int1a_normal … … 1705 1789 pop es 1706 1790 iret 1791 endif 1707 1792 1708 1793 int1a_normal: 1709 1794 push es 1710 1795 push ds 1711 pusha1796 DO_PUSHA 1712 1797 C_SETUP 1713 1798 int1a_callfunction: 1714 1799 call _int1a_function 1715 popa1800 DO_POPA 1716 1801 pop ds 1717 1802 pop es … … 1725 1810 push es 1726 1811 push ds 1727 pusha1812 DO_PUSHA 1728 1813 C_SETUP 1729 1814 call _int70_function 1730 popa1815 DO_POPA 1731 1816 pop ds 1732 1817 pop es … … 1739 1824 BIOSORG 0FEA5h 1740 1825 int08_handler: 1826 if VBOX_BIOS_CPU ge 80386 1741 1827 .386 1742 1828 sti 1743 1829 push eax 1830 else 1831 sti 1832 push ax 1833 push bx 1834 endif 1744 1835 push ds 1745 1836 push dx … … 1747 1838 mov ds, ax 1748 1839 1840 if VBOX_BIOS_CPU ge 80386 1749 1841 mov eax, ds:[6Ch] ; get ticks dword 1750 1842 inc eax 1843 else 1844 mov ax, ds:[6Ch] ; get ticks dword 1845 mov bx, ds:[6Ch+2] 1846 add ax, 1 1847 adc bx, 0 1848 endif 1751 1849 1752 1850 ;; compare eax to one day's worth of ticks (at 18.2 Hz) 1851 if VBOX_BIOS_CPU ge 80386 1753 1852 cmp eax, 1800B0h 1853 else 1854 cmp bx, 18h 1855 jb int08_store_ticks 1856 ja int08_rollover 1857 cmp ax, 00B0h 1858 endif 1754 1859 jb int08_store_ticks 1755 1860 ;; there has been a midnight rollover 1861 int08_rollover: 1862 if VBOX_BIOS_CPU ge 80386 1756 1863 xor eax, eax 1864 else 1865 xor ax, ax 1866 xor bx, bx 1867 endif 1757 1868 inc byte ptr ds:[70h] ; increment rollover flag 1758 1869 1759 1870 int08_store_ticks: 1871 if VBOX_BIOS_CPU ge 80386 1760 1872 mov ds:[6Ch], eax 1873 else 1874 mov ds:[6Ch], ax 1875 mov ds:[6Ch+2], bx 1876 endif 1761 1877 1762 1878 ;; time to turn off floppy drive motor(s)? … … 1780 1896 pop dx 1781 1897 pop ds 1898 if VBOX_BIOS_CPU ge 80386 1782 1899 pop eax 1783 1900 .286 1901 else 1902 pop bx 1903 pop ax 1904 endif 1784 1905 iret 1785 1906 … … 1813 1934 ;; INT 05h - Print Screen service 1814 1935 ;; -------------------------------------------------------- 1815 ;; BIOSORG 0FF54h -fixed wrt preceding1936 BIOSORG_CHECK 0FF54h ; fixed wrt preceding 1816 1937 int05_handler: 1817 1938 ;; Not implemented -
trunk/src/VBox/Devices/PC/BIOS/pcibios.inc
r56292 r60422 336 336 ret 337 337 338 .286339 340 338 endif ; !BX_ROMBIOS32 341 339 342 340 endif ; BX_PCIBIOS 343 341 342 SET_DEFAULT_CPU_286 343 -
trunk/src/VBox/Devices/PC/BIOS/pmode.inc
r56292 r60422 54 54 and al, 0FEh 55 55 mov cr0, eax 56 .28656 SET_DEFAULT_CPU_286 57 57 jmp far ptr really_exit_pm 58 58 really_exit_pm: -
trunk/src/VBox/Devices/PC/BIOS/pmsetup.inc
r56292 r60422 58 58 pop esi 59 59 pop eax 60 .28660 SET_DEFAULT_CPU_286 61 61 ret 62 62
Note:
See TracChangeset
for help on using the changeset viewer.