VirtualBox

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

Last change on this file since 66146 was 62509, checked in by vboxsync, 8 years ago

(C) 2016

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