VirtualBox

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

Last change on this file since 82064 was 81089, checked in by vboxsync, 5 years ago

Devices/BIOS: Skeleton of a VirtIO driver, just detects any device for now, bugref:9440

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.6 KB
Line 
1# $Id: Makefile.kmk 81089 2019-09-30 22:21:06Z 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
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
82 ifdef VBOX_WITH_VIRTIO_SCSI_BIOS
83 VBoxPcBios386_DEFS += \
84 VBOX_WITH_VIRTIO_SCSI
85 VBoxPcBios386_SOURCES += \
86 virtio.c
87 endif
88
89 #$(VBoxPcBios32_1_TARGET) - reference is lost when extending the target. weird.
90
91 # For 32-bit C code in PC BIOS.
92 LIBRARIES += VBoxPcBios32
93 VBoxPcBios32_TEMPLATE = VBoxBios32Lib
94 VBoxPcBios32_SOURCES = \
95 pci32.c
96
97 ../../BiosCommonCode/DoUInt32Div.c_CFLAGS = -mc # asm.h and uint32.h both require far data pointers by default.
98
99 MISCBINS += VBoxPcBios286
100 VBoxPcBios286_EXTENDS = VBoxPcBios386
101 VBoxPcBios286_CFLAGS = -2
102 VBoxPcBios286_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=80286
103 VBoxPcBios286_SOURCES = $(VBoxPcBios386_SOURCES) \
104 ../../BiosCommonCode/DoUInt32Div.c \
105 ../../BiosCommonCode/ASMBitLastSetU16.asm
106
107 MISCBINS += VBoxPcBios8086
108 VBoxPcBios8086_EXTENDS = VBoxPcBios386
109 VBoxPcBios8086_CFLAGS = -0
110 VBoxPcBios8086_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=8086
111 VBoxPcBios8086_SOURCES = $(VBoxPcBios386_SOURCES) \
112 ../../BiosCommonCode/DoUInt32Div.c \
113 ../../BiosCommonCode/ASMBitLastSetU16.asm
114
115
116 #
117 # Updates the alternative source files.
118 #
119 define def_VBoxPcBiosUpdateAltSource
120
121 $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm +| $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum: \
122 $$$$(VBoxPcBios$(1)_1_TARGET) \
123 $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
124 $$(VBOX_VBOXCMP)
125 if1of ($(KBUILD_TYPE), release)
126 $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
127 --bios-image $$< \
128 --bios-map $$(basename $$<).map \
129 --bios-sym $$(basename $$<).sym \
130 --bios-type system \
131 --output $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm
132 $$(QUIET)yasm -f bin -o $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm
133 $$(VBOX_VBOXCMP) $$< $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).bin
134 $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).asm
135 $$(REDIRECT) -C $$(dir $$(VBoxPcBios$(1)_1_TARGET)) -- \
136 $$(MD5SUM_EXT) -bo $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(notdir $$(VBoxPcBios$(1)_1_TARGET))
137 $$(CP) --changed -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum $$(PATH_ROOT)/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative$(1).md5sum
138 $$(RM) -f -- $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).asm $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative.bin $$(VBoxPcBios$(1)_0_OUTDIR)/VBoxBiosAlternative$(1).md5sum
139 else
140 $$(QUIET)$$(ECHO) "Fatal error: Can only update VBoxBiosAlternative$(1).asm/md5sum with a release build."
141 $$(QUIET)exit 1
142 endif
143
144 endef
145
146 $(evalcall2 def_VBoxPcBiosUpdateAltSource,386)
147 $(evalcall2 def_VBoxPcBiosUpdateAltSource,286)
148 $(evalcall2 def_VBoxPcBiosUpdateAltSource,8086)
149
150 update-pcbios-source: \
151 $(PATH_SUB_CURRENT)/VBoxBiosAlternative386.asm \
152 $(PATH_SUB_CURRENT)/VBoxBiosAlternative286.asm \
153 $(PATH_SUB_CURRENT)/VBoxBiosAlternative8086.asm
154
155endif # VBOX_WITH_OPEN_WATCOM
156
157
158#
159# The library containing the PC BIOS image.
160#
161LIBRARIES += PcBiosBin
162PcBiosBin_TEMPLATE = VBOXR3
163PcBiosBin_DEFS = IN_VBOXDD2
164
165define def_VBoxPcBiosBin
166 PcBiosBin_CLEAN += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c
167 PcBiosBin_SOURCES += $$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c
168
169 ifdef VBOX_WITH_OPEN_WATCOM
170 $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c: $$$$(VBoxPcBios$(1)_1_TARGET) $$(VBOX_BIN2C) | $$$$(dir $$$$@)
171 $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@)
172 $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$< $$@
173 else
174 PcBiosBin_CLEAN += $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom
175
176 $$$$(PcBiosBin_0_OUTDIR)/PcBiosBin$(1).c + $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom: \
177 $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).asm \
178 $$(PATH_SUB_CURRENT)/VBoxBiosAlternative$(1).md5sum \
179 $$(VBOX_BIN2C) | $$$$(dir $$$$@)
180 $$(call MSG_TOOL,bin2c,PcBiosBin,$$<,$$@)
181 $$(QUIET)yasm -f bin -o $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom $$<
182 $$(QUIET)$$(REDIRECT) -C $$(PcBiosBin_0_OUTDIR) -- \
183 $$(MD5SUM_EXT) -c $$(basename $$<).md5sum
184 $$(QUIET)$$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary$(1) $$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom $$@
185 $$(QUIET)$$(RM) -f -- $$$$(PcBiosBin_0_OUTDIR)/VBoxPcBios$(1).rom
186 endif
187endef
188$(evalcall2 def_VBoxPcBiosBin,386)
189$(evalcall2 def_VBoxPcBiosBin,286)
190$(evalcall2 def_VBoxPcBiosBin,8086)
191
192
193
194ifdef VBOX_WITH_OPEN_WATCOM
195 #
196 # Install the symbol file for the BIOS.
197 #
198 INSTALLS += VBoxPcBiosSym
199 VBoxPcBiosSym_TEMPLATE = VBoxDbgSyms
200 VBoxPcBiosSym_SOURCES = \
201 $(basename $(VBoxPcBios386_1_TARGET)).sym \
202 $(basename $(VBoxPcBios286_1_TARGET)).sym \
203 $(basename $(VBoxPcBios8086_1_TARGET)).sym
204endif
205
206
207include $(FILE_KBUILD_SUB_FOOTER)
208
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