Commit graph

4 commits

Author SHA1 Message Date
Andre Guedes b8feaea30d x86: Add helpers.h
This patch adds the helpers.h. This file should contain only x86-related
helper functions and macros. For now, we define the BIT macro and halt()
helpers which will be used in upcoming patches.

Additionally, this patch also changes loader.S to call the halt().
2015-12-21 08:06:14 -02:00
Jesus Sanchez-Palencia 595088be09 galileo: Add a bootstrap stack for C runtime
All we need to provide to C at this point is a region in memory dedicated to
its stack. This is done by allocating a region in .bss and pushing its start
address to esp. Since the multiboot spec says it is not safe to rely on the
initial stack provided by the bootloader, this patch provides our own stack.

Galileo boards have 512Kb of SRAM and 256Mb of DDR3 RAM, so providing 8kb as
a start seems safe. Moreover, stack sizes are very application-oriented
so it may be too early to provide a bigger (or smaller) stack.
2015-12-21 08:06:14 -02:00
Andre Guedes 7a1898f73e galileo: Halt if main() returns
This patch adds extra intrunctions to loader.S so we halt if main()
returns.
2015-12-21 08:06:14 -02:00
Jesus Sanchez-Palencia f14f9aba41 galileo: Initial support for Intel Galileo Platform
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
2015-12-21 08:06:14 -02:00