f14f9aba41
This patch adds the initial support for Intel Galileo Platform. It contains the minimum set of code required to boot a dummy Contiki image. For Galileo initial support, we implemented a linker script, a minimal bootstrap code, a set of stubbed functions required by newlib, and a very simple main() function. Moreover, we also define some header files and macros required by Contiki. To build applications for this platform you should first build newlib (in case it wasn't already built). To build newlib you can run the following command: $ platform/galileo/bsp/libc/build_newlib.sh Once newlib is built, you can build applications. To build applications for Galileo platform you should set TARGET variable to 'galileo'. For instance, building the hello-world application should look like this: $ cd examples/hello-world/ && make TARGET=galileo This will generate the 'hello-world.galileo' file which is a multiboot- compliant [1] ELF image. This image can be booted by any multiboot- complaint bootloader such as Grub. Finally, this patch should be used as a guideline to add the initial support for others platforms based on x86 SoCs. [1] https://www.gnu.org/software/grub/manual/multiboot/multiboot.html
20 lines
970 B
Text
20 lines
970 B
Text
LIBC=$(CONTIKI)/platform/galileo/bsp/libc/i586-elf
|
|
LIBGCC_PATH = /usr/lib/gcc/$(shell gcc -dumpmachine)/$(shell gcc -dumpversion)
|
|
|
|
CONTIKI_TARGET_DIRS = .
|
|
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
|
|
CONTIKI_SOURCEFILES += contiki-main.c newlib-syscalls.c loader.S
|
|
|
|
LINKERSCRIPT = $(CONTIKI)/platform/galileo/galileo.ld
|
|
|
|
CONTIKI_CPU=$(CONTIKI)/cpu/x86
|
|
include $(CONTIKI)/cpu/x86/Makefile.x86
|
|
|
|
CFLAGS += -m32 -march=i586 -nostdinc -isystem $(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed
|
|
LDFLAGS += -m32 -nostdlib -T $(LINKERSCRIPT)
|
|
ASFLAGS += --32 -march=i586 -mtune=i586
|
|
|
|
# Ideally, this should be part of LDFLAGS (-lc -lm etc). However, we found out that archive
|
|
# static files (.a) must be linked after our own object files, otherwise the linker gets lost
|
|
# and we get undefined references only.
|
|
TARGET_LIBFILES = $(OBJECTDIR)/newlib-syscalls.o $(LIBC)/lib/libm.a $(LIBC)/lib/libc.a $(LIBGCC_PATH)/32/libgcc.a
|