VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/BIOS/Makefile.kmk@ 98103

Last change on this file since 98103 was 98103, checked in by vboxsync, 22 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.8 KB
Line 
1# $Id: Makefile.kmk 98103 2023-01-17 14:15:46Z vboxsync $
2## @file
3# Sub-Makefile for the New BIOS ROM.
4#
5
6#
7# Copyright (C) 2012-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
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#
27
28SUB_DEPTH = ../../../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31
32ifdef VBOX_WITH_OPEN_WATCOM
33
34 #
35 # VBoxPcBios - The PC BIOS.
36 #
37 MISCBINS += VBoxPcBios386
38 VBoxPcBios386_TEMPLATE = VBoxBios
39 VBoxPcBios386_BLD_TYPE = release
40 VBoxPcBios386_CFLAGS = -3
41 VBoxPcBios386_DEFS = \
42 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 = \
50 output raw offset=0xF0000 \
51 order \
52 clname DATA segaddr=0xF000 \
53 segment _DATA \
54 clname CODE \
55 segment _TEXT segaddr=0xF000 offset=0x1600 \
56 segment BIOS32 segaddr=0xF000 offset=0xDA00 \
57 segment BIOSSEG segaddr=0xF000 offset=0xE000
58 VBoxPcBios386_SOURCES = \
59 post.c \
60 bios.c \
61 print.c \
62 ata.c \
63 floppy.c \
64 floppyt.c \
65 eltorito.c \
66 boot.c \
67 keyboard.c \
68 disk.c \
69 serial.c \
70 system.c \
71 invop.c \
72 timepci.c \
73 ps2mouse.c \
74 parallel.c \
75 logo.c \
76 scsi.c \
77 ahci.c \
78 virtio.c \
79 buslogic.c \
80 lsilogic.c \
81 apm.c \
82 pcibios.c \
83 pciutil.c \
84 vds.c \
85 ../../BiosCommonCode/__U4M.asm \
86 ../../BiosCommonCode/__U4D.asm \
87 ../../BiosCommonCode/__U8RS.asm \
88 ../../BiosCommonCode/__U8LS.asm \
89 ../../BiosCommonCode/fmemset.asm \
90 ../../BiosCommonCode/fmemcpy.asm \
91 pcibio32.asm \
92 apm_pm.asm \
93 $(VBoxPcBios32_0_OUTDIR)/VBoxPcBios32.lib \
94 orgs.asm
95
96 #$(VBoxPcBios32_1_TARGET) - reference is lost when extending the target. weird.
97
98 # For 32-bit C code in PC BIOS.
99 LIBRARIES += VBoxPcBios32
100 VBoxPcBios32_TEMPLATE = VBoxBios32Lib
101 VBoxPcBios32_SOURCES = \
102 pci32.c
103
104 ../../BiosCommonCode/DoUInt32Div.c_CFLAGS = -mc # asm.h and uint32.h both require far data pointers by default.
105
106 MISCBINS += VBoxPcBios286
107 VBoxPcBios286_EXTENDS = VBoxPcBios386
108 VBoxPcBios286_CFLAGS = -2
109 VBoxPcBios286_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=80286
110 VBoxPcBios286_SOURCES = $(VBoxPcBios386_SOURCES) \
111 ../../BiosCommonCode/DoUInt32Div.c \
112 ../../BiosCommonCode/ASMBitLastSetU16.asm
113
114 MISCBINS += VBoxPcBios8086
115 VBoxPcBios8086_EXTENDS = VBoxPcBios386
116 VBoxPcBios8086_CFLAGS = -0
117 VBoxPcBios8086_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=8086
118 VBoxPcBios8086_SOURCES = $(VBoxPcBios386_SOURCES) \
119 ../../BiosCommonCode/DoUInt32Div.c \
120 ../../BiosCommonCode/ASMBitLastSetU16.asm
121
122
123 #
124 # Updates the alternative source files.
125 #
126 define def_VBoxPcBiosUpdateAltSource
127
128 $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm +| $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum: \
129 $$$$(VBoxPcBios$(1)_1_TARGET) \
130 $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
131 $$(VBOX_VBOXCMP)
132 if1of ($(KBUILD_TYPE), release)
133 $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
134 --bios-image $$< \
135 --bios-map $$(basename $$<).map \
136 --bios-sym $$(basename $$<).sym \
137 --bios-type system \
138 --output $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm
139 $$(QUIET)$$(TOOL_YASM_AS) -f bin -o $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm
140 $$(VBOX_VBOXCMP) $$< $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin
141 $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).asm
142 $$(REDIRECT) -C $$(dir $$(VBoxPcBios$(1)_1_TARGET)) -- \
143 $$(MD5SUM_EXT) -bo $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(notdir $$(VBoxPcBios$(1)_1_TARGET))
144 $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).md5sum
145 $$(RM) -f -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative.bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum
146 else
147 $$(QUIET)$$(ECHO) "Fatal error: Can only update VBoxBiosAlternative$(1).asm/md5sum with a release build."
148 $$(QUIET)exit 1
149 endif
150
151 endef
152
153 $(evalcall2 def_VBoxPcBiosUpdateAltSource,386)
154 $(evalcall2 def_VBoxPcBiosUpdateAltSource,286)
155 $(evalcall2 def_VBoxPcBiosUpdateAltSource,8086)
156
157 update-pcbios-source: \
158 $(PATH_SUB_CURRENT)/VBoxBiosAlternative386.asm \
159 $(PATH_SUB_CURRENT)/VBoxBiosAlternative286.asm \
160 $(PATH_SUB_CURRENT)/VBoxBiosAlternative8086.asm
161
162endif # VBOX_WITH_OPEN_WATCOM
163
164
165#
166# The library containing the PC BIOS image.
167#
168LIBRARIES += PcBiosBin
169PcBiosBin_TEMPLATE = VBOXR3
170PcBiosBin_DEFS = IN_VBOXDD2
171
172define def_VBoxPcBiosBin
173 PcBiosBin_CLEAN += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c
174 PcBiosBin_SOURCES += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c
175
176 ifdef VBOX_WITH_OPEN_WATCOM
177 $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c: $$$$(VBoxPcBios$(1)_1_TARGET) $$(VBOX_BIN2C) | $$$$(dir $$$$@)
178 $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@)
179 $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$< $$@
180 else
181 PcBiosBin_CLEAN += $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom
182
183 $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c + $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom: \
184 $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm \
185 $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum \
186 $$(VBOX_BIN2C) | $$$$(dir $$$$@)
187 $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@)
188 $$(QUIET)$$(TOOL_YASM_AS) -f bin -o $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom $$<
189 $$(QUIET)$$(REDIRECT) -C $$(PcBiosBin_0_OUTDIR) -- \
190 $$(MD5SUM_EXT) -c $$(basename $$<).md5sum
191 $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom $$@
192 $$(QUIET)$$(RM) -f -- $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom
193 endif
194endef
195$(evalcall2 def_VBoxPcBiosBin,386)
196$(evalcall2 def_VBoxPcBiosBin,286)
197$(evalcall2 def_VBoxPcBiosBin,8086)
198
199
200
201ifdef VBOX_WITH_OPEN_WATCOM
202 #
203 # Install the symbol file for the BIOS.
204 #
205 INSTALLS += VBoxPcBiosSym
206 VBoxPcBiosSym_TEMPLATE = VBoxDbgSyms
207 VBoxPcBiosSym_SOURCES = \
208 $(basename $(VBoxPcBios386_1_TARGET)).sym \
209 $(basename $(VBoxPcBios286_1_TARGET)).sym \
210 $(basename $(VBoxPcBios8086_1_TARGET)).sym
211endif
212
213
214include $(FILE_KBUILD_SUB_FOOTER)
Note: See TracBrowser for help on using the repository browser.

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