asm volatile compile problem
Posted: Mon Feb 01, 2016 4:06 pm
Hi,
According to http://wiki.osdev.org/Raspberry_Pi_Bare_Bones tutorial, I did the steps until linking the kernel. I get this error:
I invested the .c code mentioned in the tutorial and tried to compile it with gcc with this command:
but it was not compiled:
line 22 is :
Would you please tell me how I can solve the problem?
According to http://wiki.osdev.org/Raspberry_Pi_Bare_Bones tutorial, I did the steps until linking the kernel. I get this error:
Code: Select all
alireza@alireza-VirtualBox:~/Downloads$ arm-none-eabi-gcc -T linker.ld -o myos.elf -ffreestanding -O2 -nostdlib boot.o kernel.o
/home/alireza/opt/cross/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld:linker.ld:1: ignoring invalid character `#' in expression
/home/alireza/opt/cross/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld:linker.ld:1: syntax error
collect2: error: ld returned 1 exit status
Code: Select all
gcc kernel.c
Code: Select all
kernel.c: Assembler messages:
kernel.c:22: Error: expecting operand after ','; got nothing
Code: Select all
asm volatile("__delay_%=: subs %[count], %[count], #1; bne __delay_%=\n": : [count]"r"(count) :"cc");