VirtualBox

Changeset 100658 in vbox for trunk


Ignore:
Timestamp:
Jul 20, 2023 7:43:52 AM (19 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158496
Message:

BIOS: Reworked BIOS build to have a common core and add 286/386 specific modules (see bugref:6549).

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Config.kmk

    r98410 r100658  
    5858#
    5959# Disabled linker warnings:
    60 #   W1014: ?
    61 #   W1023: ?
    62 #   W2120: ?
     60#   W1014: stack segment not found
     61#   W1023: no starting address found, using xxx
     62#   W2120: application too large to run under DOS
    6363#   W1080: file F:\tinderbox\win-rel\out\win.amd64\release\obj\VBoxVgaBios386\vberom.obj is a 32-bit object file
    6464TEMPLATE_VBoxBios = ROM
     
    8585        $(QUIET)$(SED_EXT) -n -f $(VBOX_PATH_DEVICES_SRC)/BiosCommonCode/biosorg_check.sed $(outbase).map \
    8686        && $(MV_EXT) -f $(out) $(out).tmp \
    87         && $(VBOX_BIOSSUMS) $(out).tmp $(out) \
     87        && $(VBOX_BIOSSUMS) -s $(out).tmp $(out) \
    8888        && $(RM_EXT) -f $(out).tmp
    8989
  • trunk/src/VBox/Devices/PC/BIOS/Makefile.kmk

    r98410 r100658  
    3535 # VBoxPcBios - The PC BIOS.
    3636 #
    37  MISCBINS += VBoxPcBios386
    38  VBoxPcBios386_TEMPLATE = VBoxBios
    39  VBoxPcBios386_BLD_TYPE = release
    40  VBoxPcBios386_CFLAGS = -3
    41  VBoxPcBios386_DEFS = \
     37
     38 # Generic flags/modules for 8088/286/386 variants
     39 VBoxPcBiosAll_TEMPLATE = VBoxBios
     40 VBoxPcBiosAll_BLD_TYPE = release
     41 VBoxPcBiosAll_DEFS = \
    4242        VBOX_PC_BIOS \
    43         VBOX_LANBOOT_SEG=0xE200 \
    44         VBOX_WITH_SCSI \
    45         VBOX_WITH_AHCI \
    46         VBOX_WITH_VIRTIO_SCSI \
    47         VBOX_BIOS_CPU=80386
    48  #VBoxPcBios386_DEFS.debug = DEBUG_ATA DEBUG_POST DEBUG_INT13
    49  VBoxPcBios386_LDFLAGS = \
     43        VBOX_LANBOOT_SEG=0xE200
     44 #VBoxPcBiosAll_DEFS.debug = DEBUG_ATA DEBUG_POST DEBUG_INT13
     45 VBoxPcBiosAll_LDFLAGS = \
    5046        output raw offset=0xF0000 \
    5147        order \
     
    5652        segment BIOS32  segaddr=0xF000 offset=0xDA00 \
    5753        segment BIOSSEG segaddr=0xF000 offset=0xE000
    58  VBoxPcBios386_SOURCES = \
     54 VBoxPcBiosAll_SOURCES = \
    5955        post.c \
    6056        bios.c \
     
    7470        parallel.c \
    7571        logo.c \
    76         scsi.c \
    77         ahci.c \
    78         virtio.c \
    79         buslogic.c \
    80         lsilogic.c \
    8172        apm.c \
    82         pcibios.c \
    83         pciutil.c \
    84         vds.c \
    8573        ../../BiosCommonCode/__U4M.asm \
    8674        ../../BiosCommonCode/__U4D.asm \
     
    8977        ../../BiosCommonCode/fmemset.asm \
    9078        ../../BiosCommonCode/fmemcpy.asm \
    91         pcibio32.asm \
    92         apm_pm.asm \
    93         $(VBoxPcBios32_0_OUTDIR)/VBoxPcBios32.lib \
    9479        orgs.asm
    9580
     
    10489 ../../BiosCommonCode/DoUInt32Div.c_CFLAGS = -mc # asm.h and uint32.h both require far data pointers by default.
    10590
     91 MISCBINS += VBoxPcBios386
     92 VBoxPcBios386_EXTENDS = VBoxPcBiosAll
     93 VBoxPcBios386_CFLAGS  = -3
     94 VBoxPcBios386_BSFLAGS = -3 -p -s
     95 VBoxPcBios386_DEFS    = $(VBoxPcBiosAll_DEFS) VBOX_BIOS_CPU=80386 \
     96        VBOX_WITH_AHCI \
     97        VBOX_WITH_SCSI \
     98        VBOX_WITH_VIRTIO_SCSI
     99 VBoxPcBios386_SOURCES = $(VBoxPcBiosAll_SOURCES) \
     100        pcibios.c \
     101        pciutil.c \
     102        ahci.c \
     103        scsi.c \
     104        buslogic.c \
     105        lsilogic.c \
     106        virtio.c \
     107        vds.c \
     108        apm_pm.asm \
     109        pcibio32.asm \
     110        $(VBoxPcBios32_0_OUTDIR)/VBoxPcBios32.lib
     111
    106112 MISCBINS += VBoxPcBios286
    107  VBoxPcBios286_EXTENDS = VBoxPcBios386
     113 VBoxPcBios286_EXTENDS = VBoxPcBiosAll
    108114 VBoxPcBios286_CFLAGS  = -2
    109  VBoxPcBios286_DEFS    = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=80286
    110  VBoxPcBios286_SOURCES = $(VBoxPcBios386_SOURCES) \
     115 VBoxPcBios286_DEFS    = $(VBoxPcBiosAll_DEFS) VBOX_BIOS_CPU=80286
     116 VBoxPcBios286_SOURCES = $(VBoxPcBiosAll_SOURCES) \
     117        apm_pm.asm \
    111118        ../../BiosCommonCode/DoUInt32Div.c \
    112119        ../../BiosCommonCode/ASMBitLastSetU16.asm
    113120
    114121 MISCBINS += VBoxPcBios8086
    115  VBoxPcBios8086_EXTENDS = VBoxPcBios386
     122 VBoxPcBios8086_EXTENDS = VBoxPcBiosAll
    116123 VBoxPcBios8086_CFLAGS  = -0
    117  VBoxPcBios8086_DEFS    = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=8086
    118  VBoxPcBios8086_SOURCES = $(VBoxPcBios386_SOURCES) \
     124 VBoxPcBios8086_DEFS    = $(VBoxPcBiosAll_DEFS) VBOX_BIOS_CPU=8086
     125 VBoxPcBios8086_BSFLAGS = -3 -p -s
     126 VBoxPcBios8086_SOURCES = $(VBoxPcBiosAll_SOURCES) \
    119127        ../../BiosCommonCode/DoUInt32Div.c \
    120128        ../../BiosCommonCode/ASMBitLastSetU16.asm
  • trunk/src/VBox/Devices/PC/BIOS/apm_pm.asm

    r100458 r100658  
    9797                mov     si, offset hlt_string
    9898                mov     cx,8
    99 .286    ; build fix; @todo remove
    10099                rep outsb
    101100
  • trunk/src/VBox/Devices/PC/BIOS/ebda.h

    r98103 r100658  
    8686#else
    8787    #define BX_MAX_SCSI_DEVICES 0
     88    #define VBOX_IS_SCSI_DEVICE(device_id) (1 == 0)
    8889#endif
    8990
  • trunk/src/VBox/Devices/PC/BIOS/invop.c

    r98103 r100658  
    252252         /* LOCK prefix - skip over it and try again. */
    253253        ++ra.ip;
     254#if VBOX_BIOS_CPU >= 80386
    254255    } else if (*(uint16_t __far *)ins == 0x050F) {
    255256        /* 286 LOADALL. NB: Same opcode as SYSCALL. */
     
    351352        ldal3_finish();
    352353#endif
     354#endif
    353355    } else {
    354356        /* There isn't much point in executing the invalid opcode handler
  • trunk/src/VBox/Devices/PC/BIOS/orgs.asm

    r98103 r100658  
    138138extrn           _int19_function:near
    139139extrn           _int1a_function:near
    140 extrn           _pci16_function:near
    141140extrn           _int70_function:near
    142141extrn           _int74_function:near
    143142extrn           _apm_function:near
    144143extrn           _ata_init:near
     144ifdef VBOX_WITH_SCSI
    145145extrn           _scsi_init:near
     146endif
    146147extrn           _ata_detect:near
    147148extrn           _cdemu_init:near
    148149extrn           _keyboard_init:near
    149150extrn           _print_bios_banner:near
    150 extrn           _inv_op_handler:near
    151151extrn           rom_scan_:near
    152152ifdef VBOX_WITH_AHCI
     
    155155if VBOX_BIOS_CPU ge 80286
    156156extrn           _int15_blkmove:near
     157extrn           _inv_op_handler:near
    157158endif
    158159if VBOX_BIOS_CPU ge 80386
    159160extrn           _int15_function32:near
    160161extrn           _apic_setup:near
     162extrn           _pci16_function:near
    161163endif
    162164
     
    470472                ;; set up various service vectors
    471473                ;; TODO: This should use the table at FEF3h instead
     474if VBOX_BIOS_CPU ge 80286
    472475                SET_INT_VECTOR 06h, BIOSSEG, int06_handler
     476endif
    473477                SET_INT_VECTOR 11h, BIOSSEG, int11_handler
    474478                SET_INT_VECTOR 12h, BIOSSEG, int12_handler
     
    10731077
    10741078
     1079if VBOX_BIOS_CPU ge 80286
     1080
    10751081;; --------------------------------------------------------
    10761082;; INT 06h handler - Invalid Opcode Exception
     
    10871093                DO_popa
    10881094                iret
     1095
     1096endif
    10891097
    10901098;; --------------------------------------------------------
     
    12001208                jb      int13_notcdrom
    12011209
    1202                 ;; ebx may be modified, save here
    1203                 ;; TODO: check/review 32-bit register use
    1204                 ;; @todo figure if 80286/8086 variant is applicable.
    1205                 .386
    1206                 shr     ebx, 16
    1207                 push    bx
    12081210                call    _int13_cdrom
    1209                 pop     bx
    1210                 shl     ebx, 16
    1211                 SET_DEFAULT_CPU_286
    12121211                jmp     int13_out
    12131212
     
    17091708                iret                    ; beam me up scotty
    17101709
     1710if VBOX_BIOS_CPU ge 80386
     1711
    17111712;; PCI BIOS
    17121713
    17131714include pcibios.inc
    17141715include pirq.inc
     1716
     1717endif
    17151718
    17161719if 0    ; Sample VPD table
  • trunk/src/bldprogs/biossums.c

    r98103 r100658  
    127127    FILE    *pIn, *pOut;
    128128    size_t  cbIn, cbOut;
    129     int     fAdapterBios = 0;
     129    int     fAdapterBios    = 0;
     130    int     fPIRQRequired   = 0;
     131    int     fBIOS32Required = 0;
     132    int     fSMBIOSRequired = 0;
    130133
    131134    g_argv0 = argv[0];
     135
     136    while ((argc > 1) && (argv[1][0] == '-'))
     137    {
     138        if (!strcmp(argv[1], "-3"))
     139            fBIOS32Required = 1;
     140        else if (!strcmp(argv[1], "-p"))
     141            fPIRQRequired = 1;
     142        else if (!strcmp(argv[1], "-s"))
     143            fSMBIOSRequired = 1;
     144        else
     145            return fatal("Invalid parameter: %s\n", argv[1]);
     146
     147        argc--;
     148        argv++;
     149    }
    132150
    133151    if (argc != 3)
     
    179197        {
    180198            case 0:
    181                 return fatal("No BIOS32 header not found!\n");
     199                if (fBIOS32Required)
     200                    return fatal("No BIOS32 header found!\n");
     201                else
     202                    break;
    182203            case 2:
    183204                return fatal("More than one BIOS32 header found!\n");
     
    194215        {
    195216            case 0:
    196                 return fatal("No PCI IRQ routing table found!\n");
     217                if (fPIRQRequired)
     218                    return fatal("No PCI IRQ routing table found!\n");
     219                else
     220                    break;
    197221            case 2:
    198222                return fatal("More than one PCI IRQ routing table found!\n");
     
    209233        {
    210234            case 0:
    211                 return fatal("No SMBIOS header found!\n");
     235                if (fBIOS32Required)
     236                    return fatal("No SMBIOS header found!\n");
     237                else
     238                    break;
    212239            case 2:
    213240                return fatal("More than one SMBIOS header found!\n");
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette