# HG changeset patch # User Windel Bouwman # Date 1391168717 -3600 # Node ID ed6d0adaa626dbe241d159f04dad1e0507c7503d # Parent e9fe6988497c79c110993b8adbc680e87e3692fd Added qemu arm emulated image diff -r e9fe6988497c -r ed6d0adaa626 test/bare/make.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bare/make.sh Fri Jan 31 12:45:17 2014 +0100 @@ -0,0 +1,7 @@ + + +arm-none-eabi-as -mcpu=arm926ej-s -g startup.s -o startup.o +arm-none-eabi-gcc -c -mcpu=arm926ej-s -g test.c -o test.o +arm-none-eabi-ld -T test.ld test.o startup.o -o test.elf +arm-none-eabi-objcopy -O binary test.elf bare.bin + diff -r e9fe6988497c -r ed6d0adaa626 test/bare/qemutst.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bare/qemutst.sh Fri Jan 31 12:45:17 2014 +0100 @@ -0,0 +1,6 @@ +#!/usr/bin/bash + +echo "Trying to run versatilePB board" + +qemu-system-arm -M versatilepb -m 128M -nographic -kernel bare.bin + diff -r e9fe6988497c -r ed6d0adaa626 test/bare/startup.s --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bare/startup.s Fri Jan 31 12:45:17 2014 +0100 @@ -0,0 +1,6 @@ + +.global _Reset +_Reset: + LDR sp,=stack_top + BL c_entry + B . diff -r e9fe6988497c -r ed6d0adaa626 test/bare/test.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bare/test.c Fri Jan 31 12:45:17 2014 +0100 @@ -0,0 +1,16 @@ + +volatile unsigned int * const UART0DR = (unsigned int*)0x101f1000; + +void print_uart0(const char*s) +{ + while (*s != '\0') + { + *UART0DR = (unsigned int)(*s); + s++; + } +} + +void c_entry() +{ + print_uart0("Hello world"); +} diff -r e9fe6988497c -r ed6d0adaa626 test/bare/test.ld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bare/test.ld Fri Jan 31 12:45:17 2014 +0100 @@ -0,0 +1,13 @@ + +ENTRY(_Reset) +SECTIONS +{ + . = 0x10000; + .startup . : {startup.o(.text) } + .text : { *(.text) } + .data : { *(.data) } + .bss : { *(.bss COMMON) } + . = ALIGN(8); + . = . + 0x1000; + stack_top = .; +}