1 | # $Id: Makefile.kmk 82175 2019-11-25 13:16:50Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the New BIOS ROM.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2012-2019 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 |
|
---|
22 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
23 |
|
---|
24 | #
|
---|
25 | # VBoxPcBios - The PC BIOS.
|
---|
26 | #
|
---|
27 | MISCBINS += VBoxPcBios386
|
---|
28 | VBoxPcBios386_TEMPLATE = VBoxBios
|
---|
29 | VBoxPcBios386_BLD_TYPE = release
|
---|
30 | VBoxPcBios386_CFLAGS = -3
|
---|
31 | VBoxPcBios386_DEFS = \
|
---|
32 | VBOX_PC_BIOS \
|
---|
33 | VBOX_LANBOOT_SEG=0xE200 \
|
---|
34 | VBOX_WITH_SCSI \
|
---|
35 | VBOX_WITH_AHCI \
|
---|
36 | VBOX_WITH_VIRTIO_SCSI \
|
---|
37 | VBOX_BIOS_CPU=80386
|
---|
38 | #VBoxPcBios386_DEFS.debug = DEBUG_ATA DEBUG_POST DEBUG_INT13
|
---|
39 | VBoxPcBios386_LDFLAGS = \
|
---|
40 | output raw offset=0xF0000 \
|
---|
41 | order \
|
---|
42 | clname DATA segaddr=0xF000 \
|
---|
43 | segment _DATA \
|
---|
44 | clname CODE \
|
---|
45 | segment _TEXT segaddr=0xF000 offset=0x1600 \
|
---|
46 | segment BIOS32 segaddr=0xF000 offset=0xDA00 \
|
---|
47 | segment BIOSSEG segaddr=0xF000 offset=0xE000
|
---|
48 | VBoxPcBios386_SOURCES = \
|
---|
49 | post.c \
|
---|
50 | bios.c \
|
---|
51 | print.c \
|
---|
52 | ata.c \
|
---|
53 | floppy.c \
|
---|
54 | floppyt.c \
|
---|
55 | eltorito.c \
|
---|
56 | boot.c \
|
---|
57 | keyboard.c \
|
---|
58 | disk.c \
|
---|
59 | serial.c \
|
---|
60 | system.c \
|
---|
61 | invop.c \
|
---|
62 | timepci.c \
|
---|
63 | ps2mouse.c \
|
---|
64 | parallel.c \
|
---|
65 | logo.c \
|
---|
66 | scsi.c \
|
---|
67 | ahci.c \
|
---|
68 | virtio.c \
|
---|
69 | apm.c \
|
---|
70 | pcibios.c \
|
---|
71 | pciutil.c \
|
---|
72 | vds.c \
|
---|
73 | ../../BiosCommonCode/__U4M.asm \
|
---|
74 | ../../BiosCommonCode/__U4D.asm \
|
---|
75 | ../../BiosCommonCode/__U8RS.asm \
|
---|
76 | ../../BiosCommonCode/__U8LS.asm \
|
---|
77 | ../../BiosCommonCode/fmemset.asm \
|
---|
78 | ../../BiosCommonCode/fmemcpy.asm \
|
---|
79 | pcibio32.asm \
|
---|
80 | apm_pm.asm \
|
---|
81 | $(VBoxPcBios32_0_OUTDIR)/VBoxPcBios32.lib \
|
---|
82 | orgs.asm
|
---|
83 |
|
---|
84 | #$(VBoxPcBios32_1_TARGET) - reference is lost when extending the target. weird.
|
---|
85 |
|
---|
86 | # For 32-bit C code in PC BIOS.
|
---|
87 | LIBRARIES += VBoxPcBios32
|
---|
88 | VBoxPcBios32_TEMPLATE = VBoxBios32Lib
|
---|
89 | VBoxPcBios32_SOURCES = \
|
---|
90 | pci32.c
|
---|
91 |
|
---|
92 | ../../BiosCommonCode/DoUInt32Div.c_CFLAGS = -mc # asm.h and uint32.h both require far data pointers by default.
|
---|
93 |
|
---|
94 | MISCBINS += VBoxPcBios286
|
---|
95 | VBoxPcBios286_EXTENDS = VBoxPcBios386
|
---|
96 | VBoxPcBios286_CFLAGS = -2
|
---|
97 | VBoxPcBios286_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=80286
|
---|
98 | VBoxPcBios286_SOURCES = $(VBoxPcBios386_SOURCES) \
|
---|
99 | ../../BiosCommonCode/DoUInt32Div.c \
|
---|
100 | ../../BiosCommonCode/ASMBitLastSetU16.asm
|
---|
101 |
|
---|
102 | MISCBINS += VBoxPcBios8086
|
---|
103 | VBoxPcBios8086_EXTENDS = VBoxPcBios386
|
---|
104 | VBoxPcBios8086_CFLAGS = -0
|
---|
105 | VBoxPcBios8086_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=8086
|
---|
106 | VBoxPcBios8086_SOURCES = $(VBoxPcBios386_SOURCES) \
|
---|
107 | ../../BiosCommonCode/DoUInt32Div.c \
|
---|
108 | ../../BiosCommonCode/ASMBitLastSetU16.asm
|
---|
109 |
|
---|
110 |
|
---|
111 | #
|
---|
112 | # Updates the alternative source files.
|
---|
113 | #
|
---|
114 | define def_VBoxPcBiosUpdateAltSource
|
---|
115 |
|
---|
116 | $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm +| $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum: \
|
---|
117 | $$$$(VBoxPcBios$(1)_1_TARGET) \
|
---|
118 | $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
|
---|
119 | $$(VBOX_VBOXCMP)
|
---|
120 | if1of ($(KBUILD_TYPE), release)
|
---|
121 | $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
|
---|
122 | --bios-image $$< \
|
---|
123 | --bios-map $$(basename $$<).map \
|
---|
124 | --bios-sym $$(basename $$<).sym \
|
---|
125 | --bios-type system \
|
---|
126 | --output $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm
|
---|
127 | $$(QUIET)yasm -f bin -o $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm
|
---|
128 | $$(VBOX_VBOXCMP) $$< $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin
|
---|
129 | $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).asm
|
---|
130 | $$(REDIRECT) -C $$(dir $$(VBoxPcBios$(1)_1_TARGET)) -- \
|
---|
131 | $$(MD5SUM_EXT) -bo $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(notdir $$(VBoxPcBios$(1)_1_TARGET))
|
---|
132 | $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).md5sum
|
---|
133 | $$(RM) -f -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative.bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum
|
---|
134 | else
|
---|
135 | $$(QUIET)$$(ECHO) "Fatal error: Can only update VBoxBiosAlternative$(1).asm/md5sum with a release build."
|
---|
136 | $$(QUIET)exit 1
|
---|
137 | endif
|
---|
138 |
|
---|
139 | endef
|
---|
140 |
|
---|
141 | $(evalcall2 def_VBoxPcBiosUpdateAltSource,386)
|
---|
142 | $(evalcall2 def_VBoxPcBiosUpdateAltSource,286)
|
---|
143 | $(evalcall2 def_VBoxPcBiosUpdateAltSource,8086)
|
---|
144 |
|
---|
145 | update-pcbios-source: \
|
---|
146 | $(PATH_SUB_CURRENT)/VBoxBiosAlternative386.asm \
|
---|
147 | $(PATH_SUB_CURRENT)/VBoxBiosAlternative286.asm \
|
---|
148 | $(PATH_SUB_CURRENT)/VBoxBiosAlternative8086.asm
|
---|
149 |
|
---|
150 | endif # VBOX_WITH_OPEN_WATCOM
|
---|
151 |
|
---|
152 |
|
---|
153 | #
|
---|
154 | # The library containing the PC BIOS image.
|
---|
155 | #
|
---|
156 | LIBRARIES += PcBiosBin
|
---|
157 | PcBiosBin_TEMPLATE = VBOXR3
|
---|
158 | PcBiosBin_DEFS = IN_VBOXDD2
|
---|
159 |
|
---|
160 | define def_VBoxPcBiosBin
|
---|
161 | PcBiosBin_CLEAN += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c
|
---|
162 | PcBiosBin_SOURCES += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c
|
---|
163 |
|
---|
164 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
165 | $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c: $$$$(VBoxPcBios$(1)_1_TARGET) $$(VBOX_BIN2C) | $$$$(dir $$$$@)
|
---|
166 | $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@)
|
---|
167 | $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$< $$@
|
---|
168 | else
|
---|
169 | PcBiosBin_CLEAN += $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom
|
---|
170 |
|
---|
171 | $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c + $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom: \
|
---|
172 | $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm \
|
---|
173 | $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum \
|
---|
174 | $$(VBOX_BIN2C) | $$$$(dir $$$$@)
|
---|
175 | $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@)
|
---|
176 | $$(QUIET)yasm -f bin -o $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom $$<
|
---|
177 | $$(QUIET)$$(REDIRECT) -C $$(PcBiosBin_0_OUTDIR) -- \
|
---|
178 | $$(MD5SUM_EXT) -c $$(basename $$<).md5sum
|
---|
179 | $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom $$@
|
---|
180 | $$(QUIET)$$(RM) -f -- $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom
|
---|
181 | endif
|
---|
182 | endef
|
---|
183 | $(evalcall2 def_VBoxPcBiosBin,386)
|
---|
184 | $(evalcall2 def_VBoxPcBiosBin,286)
|
---|
185 | $(evalcall2 def_VBoxPcBiosBin,8086)
|
---|
186 |
|
---|
187 |
|
---|
188 |
|
---|
189 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
190 | #
|
---|
191 | # Install the symbol file for the BIOS.
|
---|
192 | #
|
---|
193 | INSTALLS += VBoxPcBiosSym
|
---|
194 | VBoxPcBiosSym_TEMPLATE = VBoxDbgSyms
|
---|
195 | VBoxPcBiosSym_SOURCES = \
|
---|
196 | $(basename $(VBoxPcBios386_1_TARGET)).sym \
|
---|
197 | $(basename $(VBoxPcBios286_1_TARGET)).sym \
|
---|
198 | $(basename $(VBoxPcBios8086_1_TARGET)).sym
|
---|
199 | endif
|
---|
200 |
|
---|
201 |
|
---|
202 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
203 |
|
---|