[41084] | 1 | # $Id: Makefile.kmk 100659 2023-07-20 07:50:29Z vboxsync $
|
---|
| 2 | ## @file
|
---|
| 3 | # Sub-Makefile for the New BIOS ROM.
|
---|
| 4 | #
|
---|
| 5 |
|
---|
| 6 | #
|
---|
[98103] | 7 | # Copyright (C) 2012-2023 Oracle and/or its affiliates.
|
---|
[41084] | 8 | #
|
---|
[96407] | 9 | # This file is part of VirtualBox base platform packages, as
|
---|
| 10 | # available from https://www.virtualbox.org.
|
---|
[41084] | 11 | #
|
---|
[96407] | 12 | # This program is free software; you can redistribute it and/or
|
---|
| 13 | # modify it under the terms of the GNU General Public License
|
---|
| 14 | # as published by the Free Software Foundation, in version 3 of the
|
---|
| 15 | # License.
|
---|
| 16 | #
|
---|
| 17 | # This program is distributed in the hope that it will be useful, but
|
---|
| 18 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 20 | # General Public License for more details.
|
---|
| 21 | #
|
---|
| 22 | # You should have received a copy of the GNU General Public License
|
---|
| 23 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 24 | #
|
---|
| 25 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
| 26 | #
|
---|
[41084] | 27 |
|
---|
| 28 | SUB_DEPTH = ../../../../..
|
---|
| 29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
| 30 |
|
---|
| 31 |
|
---|
[41499] | 32 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
[41084] | 33 |
|
---|
[41499] | 34 | #
|
---|
[42147] | 35 | # VBoxPcBios - The PC BIOS.
|
---|
[41499] | 36 | #
|
---|
[100658] | 37 |
|
---|
| 38 | # Generic flags/modules for 8088/286/386 variants
|
---|
| 39 | VBoxPcBiosAll_TEMPLATE = VBoxBios
|
---|
| 40 | VBoxPcBiosAll_BLD_TYPE = release
|
---|
| 41 | VBoxPcBiosAll_DEFS = \
|
---|
[41499] | 42 | VBOX_PC_BIOS \
|
---|
[100658] | 43 | VBOX_LANBOOT_SEG=0xE200
|
---|
| 44 | #VBoxPcBiosAll_DEFS.debug = DEBUG_ATA DEBUG_POST DEBUG_INT13
|
---|
| 45 | VBoxPcBiosAll_LDFLAGS = \
|
---|
[42147] | 46 | output raw offset=0xF0000 \
|
---|
| 47 | order \
|
---|
[98410] | 48 | clname DATA segaddr=0xF000 \
|
---|
| 49 | segment _DATA \
|
---|
| 50 | clname CODE \
|
---|
| 51 | segment _TEXT segaddr=0xF000 offset=0x1600 \
|
---|
| 52 | segment BIOS32 segaddr=0xF000 offset=0xDA00 \
|
---|
| 53 | segment BIOSSEG segaddr=0xF000 offset=0xE000
|
---|
[100658] | 54 | VBoxPcBiosAll_SOURCES = \
|
---|
[50160] | 55 | post.c \
|
---|
[41499] | 56 | bios.c \
|
---|
| 57 | print.c \
|
---|
| 58 | ata.c \
|
---|
| 59 | floppy.c \
|
---|
[48069] | 60 | floppyt.c \
|
---|
[41499] | 61 | eltorito.c \
|
---|
| 62 | boot.c \
|
---|
| 63 | keyboard.c \
|
---|
| 64 | disk.c \
|
---|
| 65 | serial.c \
|
---|
| 66 | system.c \
|
---|
[49286] | 67 | invop.c \
|
---|
[41499] | 68 | timepci.c \
|
---|
| 69 | ps2mouse.c \
|
---|
| 70 | parallel.c \
|
---|
| 71 | logo.c \
|
---|
[42770] | 72 | apm.c \
|
---|
[60484] | 73 | ../../BiosCommonCode/__U4M.asm \
|
---|
| 74 | ../../BiosCommonCode/__U4D.asm \
|
---|
| 75 | ../../BiosCommonCode/__U8RS.asm \
|
---|
| 76 | ../../BiosCommonCode/__U8LS.asm \
|
---|
| 77 | ../../BiosCommonCode/fmemset.asm \
|
---|
| 78 | ../../BiosCommonCode/fmemcpy.asm \
|
---|
[41499] | 79 | orgs.asm
|
---|
[81089] | 80 |
|
---|
[60422] | 81 | #$(VBoxPcBios32_1_TARGET) - reference is lost when extending the target. weird.
|
---|
[41499] | 82 |
|
---|
[42357] | 83 | # For 32-bit C code in PC BIOS.
|
---|
[42362] | 84 | LIBRARIES += VBoxPcBios32
|
---|
| 85 | VBoxPcBios32_TEMPLATE = VBoxBios32Lib
|
---|
[42357] | 86 | VBoxPcBios32_SOURCES = \
|
---|
[98410] | 87 | pci32.c
|
---|
[42357] | 88 |
|
---|
[60484] | 89 | ../../BiosCommonCode/DoUInt32Div.c_CFLAGS = -mc # asm.h and uint32.h both require far data pointers by default.
|
---|
| 90 |
|
---|
[100658] | 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 \
|
---|
[100659] | 96 | VBOX_WITH_AHCI \
|
---|
[100658] | 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 \
|
---|
[100659] | 110 | $(VBoxPcBios32_0_OUTDIR)/VBoxPcBios32.lib
|
---|
[100658] | 111 |
|
---|
[60422] | 112 | MISCBINS += VBoxPcBios286
|
---|
[100658] | 113 | VBoxPcBios286_EXTENDS = VBoxPcBiosAll
|
---|
[60422] | 114 | VBoxPcBios286_CFLAGS = -2
|
---|
[100658] | 115 | VBoxPcBios286_DEFS = $(VBoxPcBiosAll_DEFS) VBOX_BIOS_CPU=80286
|
---|
| 116 | VBoxPcBios286_SOURCES = $(VBoxPcBiosAll_SOURCES) \
|
---|
| 117 | apm_pm.asm \
|
---|
[60484] | 118 | ../../BiosCommonCode/DoUInt32Div.c \
|
---|
[98410] | 119 | ../../BiosCommonCode/ASMBitLastSetU16.asm
|
---|
[60422] | 120 |
|
---|
| 121 | MISCBINS += VBoxPcBios8086
|
---|
[100658] | 122 | VBoxPcBios8086_EXTENDS = VBoxPcBiosAll
|
---|
[60422] | 123 | VBoxPcBios8086_CFLAGS = -0
|
---|
[100658] | 124 | VBoxPcBios8086_DEFS = $(VBoxPcBiosAll_DEFS) VBOX_BIOS_CPU=8086
|
---|
| 125 | VBoxPcBios8086_BSFLAGS = -3 -p -s
|
---|
| 126 | VBoxPcBios8086_SOURCES = $(VBoxPcBiosAll_SOURCES) \
|
---|
[60484] | 127 | ../../BiosCommonCode/DoUInt32Div.c \
|
---|
[98410] | 128 | ../../BiosCommonCode/ASMBitLastSetU16.asm
|
---|
[60422] | 129 |
|
---|
| 130 |
|
---|
[41499] | 131 | #
|
---|
[60422] | 132 | # Updates the alternative source files.
|
---|
[41499] | 133 | #
|
---|
[60422] | 134 | define def_VBoxPcBiosUpdateAltSource
|
---|
[41499] | 135 |
|
---|
[60422] | 136 | $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm +| $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum: \
|
---|
| 137 | $$$$(VBoxPcBios$(1)_1_TARGET) \
|
---|
| 138 | $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
|
---|
| 139 | $$(VBOX_VBOXCMP)
|
---|
| 140 | if1of ($(KBUILD_TYPE), release)
|
---|
| 141 | $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
|
---|
| 142 | --bios-image $$< \
|
---|
| 143 | --bios-map $$(basename $$<).map \
|
---|
| 144 | --bios-sym $$(basename $$<).sym \
|
---|
| 145 | --bios-type system \
|
---|
| 146 | --output $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm
|
---|
[84957] | 147 | $$(QUIET)$$(TOOL_YASM_AS) -f bin -o $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm
|
---|
[60422] | 148 | $$(VBOX_VBOXCMP) $$< $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin
|
---|
| 149 | $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).asm
|
---|
| 150 | $$(REDIRECT) -C $$(dir $$(VBoxPcBios$(1)_1_TARGET)) -- \
|
---|
| 151 | $$(MD5SUM_EXT) -bo $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(notdir $$(VBoxPcBios$(1)_1_TARGET))
|
---|
| 152 | $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).md5sum
|
---|
| 153 | $$(RM) -f -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative.bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum
|
---|
| 154 | else
|
---|
| 155 | $$(QUIET)$$(ECHO) "Fatal error: Can only update VBoxBiosAlternative$(1).asm/md5sum with a release build."
|
---|
| 156 | $$(QUIET)exit 1
|
---|
| 157 | endif
|
---|
| 158 |
|
---|
| 159 | endef
|
---|
| 160 |
|
---|
| 161 | $(evalcall2 def_VBoxPcBiosUpdateAltSource,386)
|
---|
| 162 | $(evalcall2 def_VBoxPcBiosUpdateAltSource,286)
|
---|
| 163 | $(evalcall2 def_VBoxPcBiosUpdateAltSource,8086)
|
---|
| 164 |
|
---|
| 165 | update-pcbios-source: \
|
---|
[98410] | 166 | $(PATH_SUB_CURRENT)/VBoxBiosAlternative386.asm \
|
---|
| 167 | $(PATH_SUB_CURRENT)/VBoxBiosAlternative286.asm \
|
---|
| 168 | $(PATH_SUB_CURRENT)/VBoxBiosAlternative8086.asm
|
---|
[60422] | 169 |
|
---|
[41499] | 170 | endif # VBOX_WITH_OPEN_WATCOM
|
---|
| 171 |
|
---|
| 172 |
|
---|
[41084] | 173 | #
|
---|
| 174 | # The library containing the PC BIOS image.
|
---|
| 175 | #
|
---|
| 176 | LIBRARIES += PcBiosBin
|
---|
[98133] | 177 | PcBiosBin_TEMPLATE = VBoxR3Dll
|
---|
[41084] | 178 | PcBiosBin_DEFS = IN_VBOXDD2
|
---|
| 179 |
|
---|
[60422] | 180 | define def_VBoxPcBiosBin
|
---|
| 181 | PcBiosBin_CLEAN += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c
|
---|
| 182 | PcBiosBin_SOURCES += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c
|
---|
[41513] | 183 |
|
---|
[60422] | 184 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
| 185 | $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c: $$$$(VBoxPcBios$(1)_1_TARGET) $$(VBOX_BIN2C) | $$$$(dir $$$$@)
|
---|
| 186 | $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@)
|
---|
| 187 | $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$< $$@
|
---|
| 188 | else
|
---|
[60426] | 189 | PcBiosBin_CLEAN += $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom
|
---|
[41084] | 190 |
|
---|
[60422] | 191 | $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c + $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom: \
|
---|
[98410] | 192 | $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm \
|
---|
| 193 | $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum \
|
---|
| 194 | $$(VBOX_BIN2C) | $$$$(dir $$$$@)
|
---|
[60422] | 195 | $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@)
|
---|
[84958] | 196 | $$(QUIET)$$(TOOL_YASM_AS) -f bin -o $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom $$<
|
---|
[60422] | 197 | $$(QUIET)$$(REDIRECT) -C $$(PcBiosBin_0_OUTDIR) -- \
|
---|
| 198 | $$(MD5SUM_EXT) -c $$(basename $$<).md5sum
|
---|
[60426] | 199 | $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom $$@
|
---|
[60422] | 200 | $$(QUIET)$$(RM) -f -- $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom
|
---|
| 201 | endif
|
---|
| 202 | endef
|
---|
| 203 | $(evalcall2 def_VBoxPcBiosBin,386)
|
---|
| 204 | $(evalcall2 def_VBoxPcBiosBin,286)
|
---|
| 205 | $(evalcall2 def_VBoxPcBiosBin,8086)
|
---|
[46946] | 206 |
|
---|
[60422] | 207 |
|
---|
| 208 |
|
---|
[46952] | 209 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
| 210 | #
|
---|
| 211 | # Install the symbol file for the BIOS.
|
---|
| 212 | #
|
---|
| 213 | INSTALLS += VBoxPcBiosSym
|
---|
| 214 | VBoxPcBiosSym_TEMPLATE = VBoxDbgSyms
|
---|
[60422] | 215 | VBoxPcBiosSym_SOURCES = \
|
---|
| 216 | $(basename $(VBoxPcBios386_1_TARGET)).sym \
|
---|
| 217 | $(basename $(VBoxPcBios286_1_TARGET)).sym \
|
---|
| 218 | $(basename $(VBoxPcBios8086_1_TARGET)).sym
|
---|
[46952] | 219 | endif
|
---|
[46946] | 220 |
|
---|
| 221 |
|
---|
[41477] | 222 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|