Ada Bare Bones: Difference between revisions

no edit summary
[unchecked revision][unchecked revision]
No edit summary
Line 778:
</source>
 
==Targetting GNAT to bare metal==
==Raspberry Pi==
 
Then GNAT is built, it automatically builds:
===Boot process===
 
# The compiler
As stated in [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=6685], the RPi boot proces is as follows:
# The runtime
# The tools (gnatmake, gnatlink, gnatls, etc.).
 
Unfortunately, the toolchain cannot be built for bare machine targets (i.e. <arch>-elf|coff|pe) straight out of the box like a C compiler can be. A number of files need to be modified:
# Power on starts the stage 1 boot loader which is on the SoC, which loads the stage 2 boot loader (bootcode.bin) into L2 cache (thus turning it on).
# bootcode.bin enables SDRAM and loads the stage 3 boot loader (loader.bin).
# loader.bin loads and executes the VideoCore firmware (start.elf).
# start.elf loads config.txt, cmdline.txt and kernel.img.
 
To enable this, a number of files need to be modified. I will show what needs to be done to support arm-elf, ready for the next section on the Raspberry Pi. This work is based on work done previously [http://www.zsk.p.lodz.pl/~morawski/Dyplomy/Praca%20dyplomowa%20p.%20Horna.pdf].
The config.txt file can contain aline "kernel=<name>" where you can name the kernel image anything you like.
 
====gcc/ada/adaint.c====
Ideally for development we would use an emulator or some kind of netbooting facility so we don't have to keep switching the SD Card from the Pi to the PC and vice versa, this would get tedious really fast.
 
===Toolchaingcc/ada/adaint.h===
 
===gcc/ada/gcc-interface/Makefile.in===
Then GNAT is built, it automatically builds:
 
====gcc/ada/s-oscons-tmpltgsocket.c=h===
# The compiler
# The runtime
# The tools (gnatmake, gnatlink, gnatls, etc.).
 
====gcc/ada/mlib-tgt-specific-bare.adb====
Unfortunately, the toolchain cannot be built for bare machine targets straight out of the box like a C compiler can be. A number of files need to be modified:
 
Can we get rid of this?
====gcc/ada/adaint.c====
 
====gcc/ada/adaints-oscons-tmplt.h=c===
 
====gcc/ada/gccsystem-interface/Makefilebare-armel.in=ads===
 
====gccgnattools/ada/gsocketconfigure[.h=ac]===
 
==Raspberry Pi==
====gcc/ada/mlib-tgt-specific-bare.adb====
 
===Boot process===
Can we get rid of this?
 
As stated in [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=6685], the RPi boot proces is as follows:
====gcc/ada/s-oscons-tmplt.c====
 
# Power on starts the stage 1 boot loader which is on the SoC, which loads the stage 2 boot loader (bootcode.bin) into L2 cache (thus turning it on).
====gcc/ada/system-bare-armel.ads====
# bootcode.bin enables SDRAM and loads the stage 3 boot loader (loader.bin).
# loader.bin loads and executes the VideoCore firmware (start.elf).
# start.elf loads config.txt, cmdline.txt and kernel.img.
 
The config.txt file can contain aline "kernel=<name>" where you can name the kernel image anything you like.
====gnattools/configure[.ac]====
 
Ideally for development we would use an emulator or some kind of netbooting facility so we don't have to keep switching the SD Card from the Pi to the PC and vice versa, this would get tedious really fast.
 
===U-Boot===
Anonymous user