The serial_transfer loader, as long as the target program voluntarily terminates itself at some point, is able to load multiple programs consecutively without requiring a physical power cycle to reload the transfer program from CD. The current example.mk juggles between two different "memory layouts", one for "burn to a physical CD" and another for "load via serial cable". Because the serial_transfer program now relocates itself to the end of system memory, this means the 0x8c010000 area is now usable by programs that are loaded by serial_transfer.
38 lines
631 B
ArmAsm
38 lines
631 B
ArmAsm
.section .text.start
|
|
.global _start
|
|
_start:
|
|
/* set stack pointer */
|
|
mov.l p1ram_end_ptr,r15
|
|
|
|
/* mask all interrupts */
|
|
mov.l imask_all,r0
|
|
stc sr,r1
|
|
or r1,r0
|
|
ldc r0,sr
|
|
|
|
/* save pr */
|
|
sts.l pr,@-r15
|
|
|
|
/* jump to runtime_init */
|
|
mov.l runtime_init_ptr,r0
|
|
jsr @r0
|
|
nop
|
|
|
|
/* restore pr */
|
|
lds.l @r15+,pr
|
|
|
|
/* jump to main */
|
|
mov.l main_ptr,r0
|
|
jmp @r0
|
|
nop
|
|
|
|
.align 4
|
|
p1ram_end_ptr:
|
|
.long __p1ram_end
|
|
imask_all:
|
|
.long 0xf0
|
|
runtime_init_ptr:
|
|
.long _runtime_init
|
|
main_ptr:
|
|
.long _main
|