1 # ====================================================================
5 # PC/i386 target HAL package configuration data
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.
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.
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
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.
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.
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.
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####
44 # Original data: jskov
48 #####DESCRIPTIONEND####
50 # ====================================================================
52 cdl_package CYGPKG_HAL_I386_PC {
53 display "i386 PC Target"
54 parent CYGPKG_HAL_I386
55 define_header hal_i386_pc.h
58 The i386 PC Target HAL package provides the
59 support needed to run eCos binaries on an i386 PC."
61 compile hal_diag.c plf_misc.c plf_stub.c
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
69 puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_i386.h>"
70 puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_i386_pc.h>"
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 <pkgconf/hal_i386_pcmb.h>"
79 cdl_component CYGPKG_HAL_I386_PC_MEMSIZE {
80 display "How to discover the size of available RAM."
82 legal_values {"BIOS" "HARDCODE"}
83 default_value {"BIOS"}
84 description "It is possible for the HAL to discover the
85 size of RAM In several ways. Currently this
86 can be done by querying the BIOS or by
87 hardcoding the values into the executable."
89 cdl_option CYGNUM_HAL_I386_PC_MEMSIZE_BASE {
90 display "Amount of Base RAM available."
92 default_value 0x000F0000
93 active_if { CYGPKG_HAL_I386_PC_MEMSIZE == "HARDCODE" }
96 cdl_option CYGNUM_HAL_I386_PC_MEMSIZE_EXTENDED {
97 display "Amount of Extended RAM available."
99 default_value 0x00100000
100 active_if { CYGPKG_HAL_I386_PC_MEMSIZE == "HARDCODE" }
104 cdl_component CYG_HAL_STARTUP {
105 display "Startup type"
107 legal_values {"RAM" "FLOPPY" "ROM" "GRUB"}
108 default_value {"RAM"}
110 define -file system.h CYG_HAL_STARTUP
112 It is possible to configure eCos for the PC target to build for:
113 RAM startup (generally when being run under an existing
114 Monitor program like RedBoot); FLOPPY startup (for writing
115 to a floppy disk, which can then be used for booting
116 on PCs with a standard BIOS), GRUB startup (for being booted
117 by the GRUB bootloader) ROM startup (for writing
118 straight to a boot ROM/Flash). ROM startup is experimental
122 cdl_option CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK {
123 display "Enable initial breakpoint"
124 parent CYGPKG_HAL_DEBUG
125 active_if CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
126 default_value { !CYGPKG_REDBOOT }
128 This option causes an application that has GDB stubs built in
129 to take a breakpoint immediately before calling cyg_start().
130 This gives the developer a chance to set any breakpoints or
131 inspect the system state before it proceeds."
134 cdl_option CYGBLD_BUILD_I386_ROMBOOT {
135 display "Build ROM bootstrap code"
136 calculated { CYG_HAL_STARTUP == "ROM" }
139 <PREFIX>/lib/romboot.ld: <PACKAGE>/src/romboot.ld
144 <PREFIX>/bin/romboot.elf : <PACKAGE>/src/romboot.S
145 @sh -c "mkdir -p $(dir $@)"
146 $(CC) -Wp,-MD,romboot.tmp $(INCLUDE_PATH) -nostdlib -Wl,-static -T$(PREFIX)/lib/romboot.ld -o $@ $<
147 @echo $@ ": \\" > $(notdir $@).deps
148 @tail -n +2 romboot.tmp >> $(notdir $@).deps
149 @echo >> $(notdir $@).deps
154 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
155 display "Diagnostic serial port baud rate"
157 legal_values 9600 19200 38400 57600 115200
160 This option selects the baud rate used for the diagnostic port.
161 Note: this should match the value chosen for the GDB port if the
162 diagnostic and GDB port are the same."
165 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
166 display "GDB serial port baud rate"
168 legal_values 9600 19200 38400 57600 115200
171 This option controls the baud rate used for the GDB connection."
174 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
175 display "Number of communication channels on the board"
178 default_value { CYGSEM_HAL_I386_PC_DIAG_SCREEN ? 3 : 2 }
180 This define the number of serial ports that will be used by the HAL.
181 Ports 0 and 1 equate to COM1 and COM2 and port 2 is the PC screen and
185 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
186 display "Debug serial port"
188 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
191 On PCs with two serial ports, this option
192 chooses which port will be used to connect to a host
196 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
197 display "Default console channel."
199 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
203 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
204 display "Diagnostic serial port"
206 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
207 default_value CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
209 On PCs with two serial ports, this option
210 chooses which port will be used for diagnostic output.
211 Selecting port 2 will cause the PC screen to be used."
214 cdl_option CYGSEM_HAL_I386_PC_DIAG_SCREEN {
215 display "Output to PC screen"
218 implements CYGINT_HAL_I386_PCMB_SCREEN_SUPPORT
219 description "This option enables use of the PC screen and keyboard as a
220 third virtual serial device."
223 cdl_component CYGBLD_GLOBAL_OPTIONS {
224 display "Global build options"
228 Global build options including control over
229 compiler flags, linker flags and choice of toolchain."
232 cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
233 display "Global command prefix"
236 default_value { "i386-elf" }
238 This option specifies the command prefix used when
239 invoking the build tools. If your host operating system
240 is Linux you can set this to empty to use your native tools.
241 If so, your native gcc must be gcc-2.95.2 or later, and
242 \"ld -v\" must report a version more recent than 2.9.1."
245 cdl_option CYGBLD_GLOBAL_CFLAGS {
246 display "Global compiler flags"
249 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" }
251 This option controls the global compiler flags which
252 are used to compile all packages by
253 default. Individual packages may define
254 options which override these global flags."
257 cdl_option CYGBLD_GLOBAL_LDFLAGS {
258 display "Global linker flags"
261 default_value { "-g -nostdlib -Wl,--gc-sections -Wl,-static" }
263 This option controls the global linker flags. Individual
264 packages may define options which override these global flags."
267 cdl_option CYGBLD_BUILD_GDB_STUBS {
268 display "Build GDB stub loader image"
270 requires { CYG_HAL_STARTUP == "FLOPPY" || CYG_HAL_STARTUP == "GRUB" }
271 requires CYGSEM_HAL_ROM_MONITOR
272 requires CYGBLD_BUILD_COMMON_GDB_STUBS
273 requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
274 requires ! CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
275 requires ! CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT
276 requires ! CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
277 requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
278 requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
281 This option enables the building of the GDB stubs for the
282 board. The common HAL controls takes care of most of the
283 build process, but the final conversion from ELF image to
284 binary data is handled by the platform CDL, allowing
285 relocation of the data if necessary."
288 <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
289 $(OBJCOPY) -O binary $< $@
294 cdl_option CYGHWR_HAL_I386_PC_LOAD_HIGH {
295 display "Load into higher memory (2MB)"
298 requires { CYG_HAL_STARTUP == "RAM" || CYG_HAL_STARTUP == "GRUB" }
301 description "This option enables building RAM applications
302 which have a start address outside of the area
303 used by redboot_GRUB."
306 cdl_component CYGHWR_MEMORY_LAYOUT {
307 display "Memory layout"
310 calculated { CYG_HAL_STARTUP == "RAM" ? \
311 (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
314 CYG_HAL_STARTUP == "ROM" ? "i386_pc_rom" : \
315 CYG_HAL_STARTUP == "GRUB" ? \
316 (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
317 "i386_pc_grub_hi" : \
321 cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
322 display "Memory layout linker script fragment"
325 define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
326 calculated { CYG_HAL_STARTUP == "RAM" ? \
327 (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
328 "<pkgconf/mlt_i386_pc_ram_hi.ldi>" : \
329 "<pkgconf/mlt_i386_pc_ram.ldi>") : \
330 CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_i386_pc_rom.ldi>" : \
331 CYG_HAL_STARTUP == "GRUB" ? \
332 (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
333 "<pkgconf/mlt_i386_pc_grub_hi.ldi>" : \
334 "<pkgconf/mlt_i386_pc_grub.ldi>") : \
335 "<pkgconf/mlt_i386_pc_floppy.ldi>" }
338 cdl_option CYGHWR_MEMORY_LAYOUT_H {
339 display "Memory layout header file"
342 define -file system.h CYGHWR_MEMORY_LAYOUT_H
343 calculated { CYG_HAL_STARTUP == "RAM" ? \
344 (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
345 "<pkgconf/mlt_i386_pc_ram_hi.h>" : \
346 "<pkgconf/mlt_i386_pc_ram.h>") : \
347 CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_i386_pc_rom.h>" : \
348 CYG_HAL_STARTUP == "GRUB" ? \
349 (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
350 "<pkgconf/mlt_i386_pc_grub_hi.h>" : \
351 "<pkgconf/mlt_i386_pc_grub.h>") : \
352 "<pkgconf/mlt_i386_pc_floppy.h>" }
356 cdl_option CYGSEM_HAL_ROM_MONITOR {
357 display "Behave as a ROM monitor"
361 parent CYGPKG_HAL_ROM_MONITOR
362 requires { CYG_HAL_STARTUP == "FLOPPY" || CYG_HAL_STARTUP == "ROM" || CYG_HAL_STARTUP == "GRUB" }
363 requires { !CYGHWR_HAL_I386_FPU_SWITCH_LAZY }
365 Enable this option if this program is to be used as a ROM monitor,
366 i.e. applications will be loaded into RAM on the board, and this
367 ROM monitor may process exceptions or interrupts generated from the
368 application. This enables features such as utilizing a separate
369 interrupt stack when exceptions are generated."
372 cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
373 display "Work with a ROM monitor"
375 legal_values { "Generic" "GDB_stubs" }
376 default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
377 parent CYGPKG_HAL_ROM_MONITOR
378 requires { CYG_HAL_STARTUP == "RAM" }
380 Support can be enabled for different varieties of ROM monitor.
381 This support changes various eCos semantics such as the encoding
382 of diagnostic output, or the overriding of hardware interrupt
384 Firstly there is \"Generic\" support which prevents the HAL
385 from overriding the hardware vectors that it does not use, to
386 instead allow an installed ROM monitor to handle them. This is
387 the most basic support which is likely to be common to most
388 implementations of ROM monitor.
389 \"GDB_stubs\" provides support when GDB stubs are included in
390 the ROM monitor or boot ROM."
393 cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
394 display "Redboot HAL options"
397 parent CYGPKG_REDBOOT
398 active_if CYGPKG_REDBOOT
400 This option lists the target's requirements for a valid Redboot
403 cdl_component CYGBLD_BUILD_REDBOOT_BIN {
404 display "Build RedBoot binary image"
408 cdl_option CYGBLD_BUILD_REDBOOT_BIN_FLOPPY {
409 display "Build Redboot FLOPPY binary image"
410 active_if CYGBLD_BUILD_REDBOOT
411 active_if { CYG_HAL_STARTUP == "FLOPPY" }
414 description "This option enables the conversion of the Redboot
415 ELF image to a binary image suitable for
416 copying to a floppy disk."
419 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
420 $(OBJCOPY) -O binary $< $@
424 cdl_option CYGBLD_BUILD_REDBOOT_BIN_ROM {
425 display "Build Redboot ROM binary image"
426 active_if CYGBLD_BUILD_REDBOOT
427 active_if { CYG_HAL_STARTUP == "ROM" }
430 description "This option enables the conversion of the Redboot
431 ELF image to a binary image suitable for ROM
435 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
436 $(OBJCOPY) -O binary $< $(@:.bin=.img)
437 $(OBJCOPY) -O binary $(PREFIX)/bin/romboot.elf $(PREFIX)/bin/romboot.img
438 dd if=/dev/zero of=$@ bs=1024 count=64 conv=sync
439 dd if=$(@:.bin=.img) of=$@ bs=512 conv=notrunc,sync
440 dd if=$(PREFIX)/bin/romboot.img of=$@ bs=256 count=1 seek=255 conv=notrunc