ARMv7-A Bare Bones: Difference between revisions

Jump to navigation Jump to search
no edit summary
[unchecked revision][unchecked revision]
mNo edit summary
No edit summary
Line 1:
{{Rating|1}}{{Kernel designs}}
 
In this tutorial, weyou will write a basic ARM kernel and boot it. WeYou will target the ARM
Versatile Express development board for the Cortex-A15.
 
Line 9:
== Rationale ==
 
*=== <b>Why ARMv7-A?</b> ===
ARMv7 is likely the last purely 32-bit iteration of the ARM architecture, so
processors based on it are likely to be supported the longest. The 'A' profile is
Line 15:
most interest to OS developers.
 
*=== <b>Why the Cortex-A15?</b> ===
Largely because it's the most powerful ARMv7-A processor supported by QEMU, and it
also has its own development board.
 
*=== <b>Why the Versatile Express?</b> ===
This board was designed by ARM Holdings as a prototyping board, so it makes sense
to target a relatively neutral platform built with the Cortex-A15 in mind.
Line 25:
== Toolchain ==
 
We'llYou will be using the [[GNU toolchain]] for this, so go read [[GCC Cross-Compiler]] if you
haven't already. The target platform is <code>arm-none-eabi</code>. You will need at
least [[GAS]], [[GCC]], and [[LD]], but it is also suggested to have [[GDB]], [[Objcopy]], and [[Objdump]].
least <code>as</code>, <code>gcc</code>, and <code>ld</code>, but I suggest also
having <code>gdb</code>, <code>objcopy</code>, and <code>objdump</code>.
 
== Code ==
Line 34 ⟶ 33:
_start.arm:
 
<source lang="asm">
<pre>
.global _start
_start:
Line 42 ⟶ 41:
b 1b
.size _start, . - _start
</presource>
 
start.c:
 
<syntaxhighlightsource lang="c">
#include <stdint.h>
 
#define UART0_BASE 0x1c090000
 
void start() {
{
*(volatile uint32_t *)(UART0_BASE) = 'A';
}
</source>
</syntaxhighlight>
 
linker.ld:
 
<source lang="c">
<pre>
ENTRY(_start)
 
Line 78 ⟶ 76:
STACK_TOP = .;
}
</presource>
 
== Building and Running ==
 
<source lang="bash">
<pre>
$ arm-none-eabi-as -march=armv7-a -mcpu=cortex-a15 _start.arm -o _start.o
$ arm-none-eabi-gcc -ffreestanding -Wall -Wextra -Werror -c start.c -o start.o
$ arm-none-eabi-ld -T linker.ld _start.o start.o -o kernel.elf
$ qemu-system-arm -M vexpress-a15 -cpu cortex-a15 -kernel kernel.elf -nographic
</presource>
 
== Resources ==
 
It's a lot of material, but these are invaluable references for developing on ARM platforms.
 
== See Also ==
=== External Links ===
* [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.boards.express/index.html ARMv7 Cortex-A Series Programmer's Guide]
* [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0406c/index.html ARMv7-A Architecture Reference Manual]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu