start.S
…
mov r0,#0x00000010
bl led_on
bl clksetup
bl led_off
mov r0,#0x00000020
bl led_on
bl memsetup
bl led_off
mov r0,#0x00000040
bl led_on
osload:
ldr r0,_OS_ROM_BASE
ldr r1,_OS_RAM_BASE
ldr r2,_OS_END
copy_loop:
ldr r3,[r0],#4
str r3,[r1],#4
cmp r0,r2
blt copy_loop
ldr pc,_OS_RAM_BASE
.balign 4
_OS_ROM_BASE:
.word _os_start
_OS_RAM_BASE:
.word OS_RAM_BASE
_OS_END:
.word _os_end
…
mov r0,#0x00000010
bl led_on
bl clksetup
bl led_off
mov r0,#0x00000020
bl led_on
bl memsetup
bl led_off
mov r0,#0x00000040
bl led_on
.balign 4
_OS_ROM_BASE:
.word _os_start
_OS_RAM_BASE:
.word OS_RAM_BASE
_OS_END:
.word _os_end
osload:
ldr r0,_OS_ROM_BASE
ldr r1,_OS_RAM_BASE
ldr r2,_OS_END
copy_loop:
ldr r3,[r0],#4
str r3,[r1],#4
cmp r0,r2
blt copy_loop
ldr pc,_OS_RAM_BASE
cute-boot.lds
OUTPUT_FORMAT("elf32-littlearm","elf32-bigarm","elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text : {start.o(.text) *(.text)}
. = ALIGN(4);
.rodata : {*(.rodata)}
. = ALIGN(4);
.data : {*(EXCLUDE_FILE(cuteOS.bin.o).data)}
. = ALIGN(4);
__bss_start = .;
.bss : {*(.bss)}
_end = .;
. = ALIGN(4);
_os_start = .;
.cuteOS : {cuteOS.bin.o}
. = ALIGN(4);
_os_end = .;
}
OUTPUT_FORMAT("elf32-littlearm","elf32-bigarm","elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
…
}
.text : {start.o(.text) *(.text)}
. = 0x00000000;
. = ALIGN(4);
.rodata : {*(.rodata)}
.data : {*(EXCLUDE_FILE(cuteOS.bin.o).data)}
__bss_start = .;
.bss : {*(.bss)}
_os_start = .;
.cuteOS : {cuteOS.bin.o}
. = ALIGN(4);
_os_end = .;
최신 콘텐츠