1 |
27 |
unneback |
# ====================================================================
|
2 |
|
|
#
|
3 |
|
|
# hal_i386_pc.cdl
|
4 |
|
|
#
|
5 |
|
|
# PC/i386 target HAL package configuration data
|
6 |
|
|
#
|
7 |
|
|
# ====================================================================
|
8 |
|
|
#####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
## -------------------------------------------
|
10 |
|
|
## This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
|
12 |
|
|
##
|
13 |
|
|
## eCos is free software; you can redistribute it and/or modify it under
|
14 |
|
|
## the terms of the GNU General Public License as published by the Free
|
15 |
|
|
## Software Foundation; either version 2 or (at your option) any later version.
|
16 |
|
|
##
|
17 |
|
|
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
|
18 |
|
|
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
19 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
20 |
|
|
## for more details.
|
21 |
|
|
##
|
22 |
|
|
## You should have received a copy of the GNU General Public License along
|
23 |
|
|
## with eCos; if not, write to the Free Software Foundation, Inc.,
|
24 |
|
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
25 |
|
|
##
|
26 |
|
|
## As a special exception, if other files instantiate templates or use macros
|
27 |
|
|
## or inline functions from this file, or you compile this file and link it
|
28 |
|
|
## with other works to produce a work based on this file, this file does not
|
29 |
|
|
## by itself cause the resulting work to be covered by the GNU General Public
|
30 |
|
|
## License. However the source code for this file must still be made available
|
31 |
|
|
## in accordance with section (3) of the GNU General Public License.
|
32 |
|
|
##
|
33 |
|
|
## This exception does not invalidate any other reasons why a work based on
|
34 |
|
|
## this file might be covered by the GNU General Public License.
|
35 |
|
|
##
|
36 |
|
|
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
37 |
|
|
## at http://sources.redhat.com/ecos/ecos-license/
|
38 |
|
|
## -------------------------------------------
|
39 |
|
|
#####ECOSGPLCOPYRIGHTEND####
|
40 |
|
|
# ====================================================================
|
41 |
|
|
######DESCRIPTIONBEGIN####
|
42 |
|
|
#
|
43 |
|
|
# Author(s): jskov
|
44 |
|
|
# Original data: jskov
|
45 |
|
|
# Contributors:
|
46 |
|
|
# Date: 1999-11-01
|
47 |
|
|
#
|
48 |
|
|
#####DESCRIPTIONEND####
|
49 |
|
|
#
|
50 |
|
|
# ====================================================================
|
51 |
|
|
|
52 |
|
|
cdl_package CYGPKG_HAL_I386_PC {
|
53 |
|
|
display "i386 PC Target"
|
54 |
|
|
parent CYGPKG_HAL_I386
|
55 |
|
|
define_header hal_i386_pc.h
|
56 |
|
|
include_dir cyg/hal
|
57 |
|
|
description "
|
58 |
|
|
The i386 PC Target HAL package provides the
|
59 |
|
|
support needed to run eCos binaries on an i386 PC."
|
60 |
|
|
|
61 |
|
|
compile hal_diag.c plf_misc.c plf_stub.c
|
62 |
|
|
|
63 |
|
|
implements CYGINT_HAL_DEBUG_GDB_STUBS
|
64 |
|
|
implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
|
65 |
|
|
implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
|
66 |
|
|
implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT_GUARANTEED
|
67 |
|
|
|
68 |
|
|
define_proc {
|
69 |
|
|
puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H "
|
70 |
|
|
puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H "
|
71 |
|
|
puts $::cdl_header ""
|
72 |
|
|
puts $::cdl_header "#define HAL_PLATFORM_CPU \"I386\""
|
73 |
|
|
puts $::cdl_header "#define HAL_PLATFORM_BOARD \"PC\""
|
74 |
|
|
puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\""
|
75 |
|
|
puts $::cdl_header "#include "
|
76 |
|
|
puts $::cdl_header ""
|
77 |
|
|
}
|
78 |
|
|
|
79 |
|
|
cdl_component CYG_HAL_STARTUP {
|
80 |
|
|
display "Startup type"
|
81 |
|
|
flavor data
|
82 |
|
|
legal_values {"RAM" "FLOPPY" "ROM" "GRUB"}
|
83 |
|
|
default_value {"RAM"}
|
84 |
|
|
no_define
|
85 |
|
|
define -file system.h CYG_HAL_STARTUP
|
86 |
|
|
description "
|
87 |
|
|
It is possible to configure eCos for the PC target to build for:
|
88 |
|
|
RAM startup (generally when being run under an existing
|
89 |
|
|
Monitor program like RedBoot); FLOPPY startup (for writing
|
90 |
|
|
to a floppy disk, which can then be used for booting
|
91 |
|
|
on PCs with a standard BIOS), GRUB startup (for being booted
|
92 |
|
|
by the GRUB bootloader) ROM startup (for writing
|
93 |
|
|
straight to a boot ROM/Flash). ROM startup is experimental
|
94 |
|
|
at this time."
|
95 |
|
|
}
|
96 |
|
|
|
97 |
|
|
cdl_option CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK {
|
98 |
|
|
display "Enable initial breakpoint"
|
99 |
|
|
parent CYGPKG_HAL_DEBUG
|
100 |
|
|
active_if CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
|
101 |
|
|
default_value { !CYGPKG_REDBOOT }
|
102 |
|
|
description "
|
103 |
|
|
This option causes an application that has GDB stubs built in
|
104 |
|
|
to take a breakpoint immediately before calling cyg_start().
|
105 |
|
|
This gives the developer a chance to set any breakpoints or
|
106 |
|
|
inspect the system state before it proceeds."
|
107 |
|
|
}
|
108 |
|
|
|
109 |
|
|
cdl_option CYGBLD_BUILD_I386_ROMBOOT {
|
110 |
|
|
display "Build ROM bootstrap code"
|
111 |
|
|
calculated { CYG_HAL_STARTUP == "ROM" }
|
112 |
|
|
|
113 |
|
|
make {
|
114 |
|
|
/lib/romboot.ld: /src/romboot.ld
|
115 |
|
|
cp $< $@
|
116 |
|
|
}
|
117 |
|
|
|
118 |
|
|
make {
|
119 |
|
|
/bin/romboot.elf : /src/romboot.S
|
120 |
|
|
@sh -c "mkdir -p $(dir $@)"
|
121 |
|
|
$(CC) -Wp,-MD,romboot.tmp $(INCLUDE_PATH) -nostdlib -Wl,-static -T$(PREFIX)/lib/romboot.ld -o $@ $<
|
122 |
|
|
@echo $@ ": \\" > $(notdir $@).deps
|
123 |
|
|
@tail +2 romboot.tmp >> $(notdir $@).deps
|
124 |
|
|
@echo >> $(notdir $@).deps
|
125 |
|
|
@rm romboot.tmp
|
126 |
|
|
}
|
127 |
|
|
}
|
128 |
|
|
|
129 |
|
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
|
130 |
|
|
display "Diagnostic serial port baud rate"
|
131 |
|
|
flavor data
|
132 |
|
|
legal_values 9600 19200 38400 57600 115200
|
133 |
|
|
default_value 38400
|
134 |
|
|
description "
|
135 |
|
|
This option selects the baud rate used for the diagnostic port.
|
136 |
|
|
Note: this should match the value chosen for the GDB port if the
|
137 |
|
|
diagnostic and GDB port are the same."
|
138 |
|
|
}
|
139 |
|
|
|
140 |
|
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
|
141 |
|
|
display "GDB serial port baud rate"
|
142 |
|
|
flavor data
|
143 |
|
|
legal_values 9600 19200 38400 57600 115200
|
144 |
|
|
default_value 38400
|
145 |
|
|
description "
|
146 |
|
|
This option controls the baud rate used for the GDB connection."
|
147 |
|
|
}
|
148 |
|
|
|
149 |
|
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
|
150 |
|
|
display "Number of communication channels on the board"
|
151 |
|
|
flavor data
|
152 |
|
|
legal_values 1 to 3
|
153 |
|
|
default_value { CYGSEM_HAL_I386_PC_DIAG_SCREEN ? 3 : 2 }
|
154 |
|
|
description "
|
155 |
|
|
This define the number of serial ports that will be used by the HAL.
|
156 |
|
|
Ports 0 and 1 equate to COM1 and COM2 and port 2 is the PC screen and
|
157 |
|
|
keyboard."
|
158 |
|
|
}
|
159 |
|
|
|
160 |
|
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
|
161 |
|
|
display "Debug serial port"
|
162 |
|
|
flavor data
|
163 |
|
|
legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
|
164 |
|
|
default_value 0
|
165 |
|
|
description "
|
166 |
|
|
On PCs with two serial ports, this option
|
167 |
|
|
chooses which port will be used to connect to a host
|
168 |
|
|
running GDB."
|
169 |
|
|
}
|
170 |
|
|
|
171 |
|
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
|
172 |
|
|
display "Default console channel."
|
173 |
|
|
flavor data
|
174 |
|
|
legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
|
175 |
|
|
default_value 0
|
176 |
|
|
}
|
177 |
|
|
|
178 |
|
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
|
179 |
|
|
display "Diagnostic serial port"
|
180 |
|
|
flavor data
|
181 |
|
|
legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
|
182 |
|
|
default_value CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
|
183 |
|
|
description "
|
184 |
|
|
On PCs with two serial ports, this option
|
185 |
|
|
chooses which port will be used for diagnostic output.
|
186 |
|
|
Selecting port 2 will cause the PC screen to be used."
|
187 |
|
|
}
|
188 |
|
|
|
189 |
|
|
cdl_option CYGSEM_HAL_I386_PC_DIAG_SCREEN {
|
190 |
|
|
display "Output to PC screen"
|
191 |
|
|
flavor bool
|
192 |
|
|
default_value 1
|
193 |
|
|
implements CYGINT_HAL_I386_PCMB_SCREEN_SUPPORT
|
194 |
|
|
description "This option enables use of the PC screen and keyboard as a
|
195 |
|
|
third virtual serial device."
|
196 |
|
|
}
|
197 |
|
|
|
198 |
|
|
cdl_component CYGBLD_GLOBAL_OPTIONS {
|
199 |
|
|
display "Global build options"
|
200 |
|
|
flavor none
|
201 |
|
|
parent CYGPKG_NONE
|
202 |
|
|
description "
|
203 |
|
|
Global build options including control over
|
204 |
|
|
compiler flags, linker flags and choice of toolchain."
|
205 |
|
|
|
206 |
|
|
|
207 |
|
|
cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
|
208 |
|
|
display "Global command prefix"
|
209 |
|
|
flavor data
|
210 |
|
|
no_define
|
211 |
|
|
default_value { "i386-elf" }
|
212 |
|
|
description "
|
213 |
|
|
This option specifies the command prefix used when
|
214 |
|
|
invoking the build tools. If your host operating system
|
215 |
|
|
is Linux you can set this to empty to use your native tools.
|
216 |
|
|
If so, your native gcc must be gcc-2.95.2 or later, and
|
217 |
|
|
\"ld -v\" must report a version more recent than 2.9.1."
|
218 |
|
|
}
|
219 |
|
|
|
220 |
|
|
cdl_option CYGBLD_GLOBAL_CFLAGS {
|
221 |
|
|
display "Global compiler flags"
|
222 |
|
|
flavor data
|
223 |
|
|
no_define
|
224 |
|
|
default_value { "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
|
225 |
|
|
description "
|
226 |
|
|
This option controls the global compiler flags which
|
227 |
|
|
are used to compile all packages by
|
228 |
|
|
default. Individual packages may define
|
229 |
|
|
options which override these global flags."
|
230 |
|
|
}
|
231 |
|
|
|
232 |
|
|
cdl_option CYGBLD_GLOBAL_LDFLAGS {
|
233 |
|
|
display "Global linker flags"
|
234 |
|
|
flavor data
|
235 |
|
|
no_define
|
236 |
|
|
default_value { "-g -nostdlib -Wl,--gc-sections -Wl,-static" }
|
237 |
|
|
description "
|
238 |
|
|
This option controls the global linker flags. Individual
|
239 |
|
|
packages may define options which override these global flags."
|
240 |
|
|
}
|
241 |
|
|
|
242 |
|
|
cdl_option CYGBLD_BUILD_GDB_STUBS {
|
243 |
|
|
display "Build GDB stub loader image"
|
244 |
|
|
default_value 0
|
245 |
|
|
requires { CYG_HAL_STARTUP == "FLOPPY" }
|
246 |
|
|
requires CYGSEM_HAL_ROM_MONITOR
|
247 |
|
|
requires CYGBLD_BUILD_COMMON_GDB_STUBS
|
248 |
|
|
requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
|
249 |
|
|
requires ! CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
|
250 |
|
|
requires ! CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT
|
251 |
|
|
requires ! CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
|
252 |
|
|
requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
|
253 |
|
|
requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
|
254 |
|
|
no_define
|
255 |
|
|
description "
|
256 |
|
|
This option enables the building of the GDB stubs for the
|
257 |
|
|
board. The common HAL controls takes care of most of the
|
258 |
|
|
build process, but the final conversion from ELF image to
|
259 |
|
|
binary data is handled by the platform CDL, allowing
|
260 |
|
|
relocation of the data if necessary."
|
261 |
|
|
|
262 |
|
|
make -priority 320 {
|
263 |
|
|
/bin/gdb_module.bin : /bin/gdb_module.img
|
264 |
|
|
$(OBJCOPY) -O binary $< $@
|
265 |
|
|
}
|
266 |
|
|
}
|
267 |
|
|
}
|
268 |
|
|
|
269 |
|
|
cdl_component CYGHWR_MEMORY_LAYOUT {
|
270 |
|
|
display "Memory layout"
|
271 |
|
|
flavor data
|
272 |
|
|
no_define
|
273 |
|
|
calculated { CYG_HAL_STARTUP == "RAM" ? "i386_pc_ram" : \
|
274 |
|
|
CYG_HAL_STARTUP == "ROM" ? "i386_pc_rom" : \
|
275 |
|
|
CYG_HAL_STARTUP == "GRUB" ? "i386_pc_grub" : \
|
276 |
|
|
"i386_pc_floppy" }
|
277 |
|
|
|
278 |
|
|
cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
|
279 |
|
|
display "Memory layout linker script fragment"
|
280 |
|
|
flavor data
|
281 |
|
|
no_define
|
282 |
|
|
define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
|
283 |
|
|
calculated { CYG_HAL_STARTUP == "RAM" ? "" : \
|
284 |
|
|
CYG_HAL_STARTUP == "ROM" ? "" : \
|
285 |
|
|
CYG_HAL_STARTUP == "GRUB" ? "" : \
|
286 |
|
|
"" }
|
287 |
|
|
}
|
288 |
|
|
|
289 |
|
|
cdl_option CYGHWR_MEMORY_LAYOUT_H {
|
290 |
|
|
display "Memory layout header file"
|
291 |
|
|
flavor data
|
292 |
|
|
no_define
|
293 |
|
|
define -file system.h CYGHWR_MEMORY_LAYOUT_H
|
294 |
|
|
calculated { CYG_HAL_STARTUP == "RAM" ? "" : \
|
295 |
|
|
CYG_HAL_STARTUP == "ROM" ? "" : \
|
296 |
|
|
CYG_HAL_STARTUP == "GRUB" ? "" : \
|
297 |
|
|
"" }
|
298 |
|
|
}
|
299 |
|
|
}
|
300 |
|
|
|
301 |
|
|
cdl_option CYGSEM_HAL_ROM_MONITOR {
|
302 |
|
|
display "Behave as a ROM monitor"
|
303 |
|
|
flavor bool
|
304 |
|
|
default_value 0
|
305 |
|
|
|
306 |
|
|
parent CYGPKG_HAL_ROM_MONITOR
|
307 |
|
|
requires { CYG_HAL_STARTUP == "FLOPPY" || CYG_HAL_STARTUP == "ROM" }
|
308 |
|
|
requires { !CYGHWR_HAL_I386_FPU_SWITCH_LAZY }
|
309 |
|
|
description "
|
310 |
|
|
Enable this option if this program is to be used as a ROM monitor,
|
311 |
|
|
i.e. applications will be loaded into RAM on the board, and this
|
312 |
|
|
ROM monitor may process exceptions or interrupts generated from the
|
313 |
|
|
application. This enables features such as utilizing a separate
|
314 |
|
|
interrupt stack when exceptions are generated."
|
315 |
|
|
}
|
316 |
|
|
|
317 |
|
|
cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
|
318 |
|
|
display "Work with a ROM monitor"
|
319 |
|
|
flavor booldata
|
320 |
|
|
legal_values { "Generic" "GDB_stubs" }
|
321 |
|
|
default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
|
322 |
|
|
parent CYGPKG_HAL_ROM_MONITOR
|
323 |
|
|
requires { CYG_HAL_STARTUP == "RAM" }
|
324 |
|
|
description "
|
325 |
|
|
Support can be enabled for different varieties of ROM monitor.
|
326 |
|
|
This support changes various eCos semantics such as the encoding
|
327 |
|
|
of diagnostic output, or the overriding of hardware interrupt
|
328 |
|
|
vectors.
|
329 |
|
|
Firstly there is \"Generic\" support which prevents the HAL
|
330 |
|
|
from overriding the hardware vectors that it does not use, to
|
331 |
|
|
instead allow an installed ROM monitor to handle them. This is
|
332 |
|
|
the most basic support which is likely to be common to most
|
333 |
|
|
implementations of ROM monitor.
|
334 |
|
|
\"GDB_stubs\" provides support when GDB stubs are included in
|
335 |
|
|
the ROM monitor or boot ROM."
|
336 |
|
|
}
|
337 |
|
|
|
338 |
|
|
cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
|
339 |
|
|
display "Redboot HAL options"
|
340 |
|
|
flavor none
|
341 |
|
|
no_define
|
342 |
|
|
parent CYGPKG_REDBOOT
|
343 |
|
|
active_if CYGPKG_REDBOOT
|
344 |
|
|
description "
|
345 |
|
|
This option lists the target's requirements for a valid Redboot
|
346 |
|
|
configuration."
|
347 |
|
|
|
348 |
|
|
cdl_component CYGBLD_BUILD_REDBOOT_BIN {
|
349 |
|
|
display "Build RedBoot binary image"
|
350 |
|
|
no_define
|
351 |
|
|
default_value 1
|
352 |
|
|
|
353 |
|
|
cdl_option CYGBLD_BUILD_REDBOOT_BIN_FLOPPY {
|
354 |
|
|
display "Build Redboot FLOPPY binary image"
|
355 |
|
|
active_if CYGBLD_BUILD_REDBOOT
|
356 |
|
|
active_if { CYG_HAL_STARTUP == "FLOPPY" }
|
357 |
|
|
calculated 1
|
358 |
|
|
no_define
|
359 |
|
|
description "This option enables the conversion of the Redboot
|
360 |
|
|
ELF image to a binary image suitable for
|
361 |
|
|
copying to a floppy disk."
|
362 |
|
|
|
363 |
|
|
make -priority 325 {
|
364 |
|
|
/bin/redboot.bin : /bin/redboot.elf
|
365 |
|
|
$(OBJCOPY) -O binary $< $@
|
366 |
|
|
}
|
367 |
|
|
}
|
368 |
|
|
|
369 |
|
|
cdl_option CYGBLD_BUILD_REDBOOT_BIN_ROM {
|
370 |
|
|
display "Build Redboot ROM binary image"
|
371 |
|
|
active_if CYGBLD_BUILD_REDBOOT
|
372 |
|
|
active_if { CYG_HAL_STARTUP == "ROM" }
|
373 |
|
|
calculated 1
|
374 |
|
|
no_define
|
375 |
|
|
description "This option enables the conversion of the Redboot
|
376 |
|
|
ELF image to a binary image suitable for ROM
|
377 |
|
|
programming."
|
378 |
|
|
|
379 |
|
|
make -priority 325 {
|
380 |
|
|
/bin/redboot.bin : /bin/redboot.elf
|
381 |
|
|
$(OBJCOPY) -O binary $< $(@:.bin=.img)
|
382 |
|
|
$(OBJCOPY) -O binary $(PREFIX)/bin/romboot.elf $(PREFIX)/bin/romboot.img
|
383 |
|
|
dd if=/dev/zero of=$@ bs=1024 count=64 conv=sync
|
384 |
|
|
dd if=$(@:.bin=.img) of=$@ bs=512 conv=notrunc,sync
|
385 |
|
|
dd if=$(PREFIX)/bin/romboot.img of=$@ bs=256 count=1 seek=255 conv=notrunc
|
386 |
|
|
}
|
387 |
|
|
}
|
388 |
|
|
}
|
389 |
|
|
}
|
390 |
|
|
}
|
391 |
|
|
|