Hola mundo, Beagleboard de metal desnudo
Estoy tratando de ejecutar un programa tipo 'hola mundo' en mi Beagleboard-xm rev. C, llamando a una Cputs
función del ensamblaje.
Hasta ahora he estado usando esto como referencia:http: //wiki.osdev.org/ARM_Beagleboar
Esto es lo que tengo hasta ahora, pero no hay salida.
Hola
volatile unsigned int * const UART3DR = (unsigned int *)0x49020000;
void puts(const char *s) {
while(*s != '\0') {
*UART3DR = (unsigned int)(*s);
s++;
}
}
void hello() {
puts("Hello, Beagleboard!\n");
}
boot.asm
.global start
start:
ldr sp, =stack_bottom
bl hello
b .
linker.ld
ENTRY(start)
MEMORY
{
ram : ORIGIN = 0x80200000, LENGTH = 0x10000
}
SECTIONS
{
.hello : { hello.o(.text) } > ram
.text : { *(.text) } > ram
.data : { *(.data) } > ram
.bss : { *(.bss) } > ram
. = . + 0x5000; /* 4kB of stack memory */
stack_bottom = .;
}
Makefile
ARMGNU = arm-linux-gnueabi
AOPS = --warn --fatal-warnings
COPS = -Wall -Werror -O2 -nostdlib -nostartfiles -ffreestanding
boot.bin: boot.asm
$(ARMGNU)-as boot.asm -o boot.o
$(ARMGNU)-gcc-4.6 -c $(COPS) hello.c -o hello.o
$(ARMGNU)-ld -T linker.ld hello.o boot.o -o boot.elf
$(ARMGNU)-objdump -D boot.elf > boot.list
$(ARMGNU)-objcopy boot.elf -O srec boot.srec
$(ARMGNU)-objcopy boot.elf -O binary boot.bin
Utilizar solo el archivo asm como este funciona.
.equ UART3.BASE, 0x49020000
start:
ldr r0,=UART3.BASE
mov r1,#'c'
Aquí hay información relacionada con Beagleboard / minicom:http: //paste.ubuntu.com/829072
¿Algún puntero? :)
También probé
void hello() {
*UART3DR = 'c';
}
Estoy usando minicom y envío el archivo a través de ymodem, luego trato de ejecutarlo con:
go 0x80200000
El flujo de control de hardware y software en minicom está desactivado.