gcc -ffreestanding -fwritable-strings -marm7tdmi -mthumb-interwork -c -O2 -Wall -g -o Main.o Main.c ld -nostdlib -o Kernel.cof -O2 -s -T Kernel-arm.ld Main.o
Kernel-arm.ld
OUTPUT_FORMAT("coff-go32") <<<--- Not sure whether this should coff-go32 or something arm-specific.. as long as its COFF; if COFF doesn''t work, binary is fine
ENTRY("entry")
SECTIONS {
.text 0x02000000 :
{ code = .;
*(.text)
. = ALIGN(256); }
.data :
{ data = .;
*(.data)
. = ALIGN(256); }
.bss :
{ bss = .;
*(.bss)
*(COMMON)
. = ALIGN(256); }
end = .; }
Main.c
int main(void)
{
int i;
while(1)
{
i++;
}
return i;
}
[Enter the Unspoken Realm]