- bootloader multi target
git-svn-id: http://moon:8086/svn/mips@98 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
.file "startup.S"
|
||||
|
||||
.text
|
||||
.section .init,"ax"
|
||||
.align 2
|
||||
|
||||
_start:
|
||||
.set noreorder
|
||||
|
||||
# set stack pointer
|
||||
la $sp, stack_ptr
|
||||
|
||||
# Set status register
|
||||
# Kernel mode (SR[1]=0), Int disabled(SR[0]=0), after RFE into main
|
||||
li $26, 0x1040000C
|
||||
mtc0 $26, $12
|
||||
li $26, 0x00000000
|
||||
mtc0 $26, $13
|
||||
|
||||
mfc0 $26, $15
|
||||
nop
|
||||
mtc0 $26, $31
|
||||
|
||||
# Invalidate I-Cache
|
||||
cop0 32
|
||||
|
||||
# Invalidate D-Cache
|
||||
cop0 34
|
||||
|
||||
# zero bss
|
||||
la $8, __bss_start
|
||||
la $9, _end
|
||||
$zeroise:
|
||||
sw $0, 0($8)
|
||||
bne $8, $9, $zeroise
|
||||
addiu $8, 4
|
||||
|
||||
_init:
|
||||
# Call libsys_init
|
||||
la $k0, libsys_init
|
||||
jalr $k0
|
||||
nop
|
||||
|
||||
la $26, main
|
||||
|
||||
jalr $26
|
||||
nop
|
||||
_terminate:
|
||||
nop
|
||||
j _terminate
|
||||
nop
|
||||
|
||||
.set reorder
|
||||
Reference in New Issue
Block a user