URL
https://opencores.org/ocsvn/mips32r1/mips32r1/trunk
Subversion Repositories mips32r1
[/] [mips32r1/] [trunk/] [Software/] [demos/] [XD5_Threads/] [src/] [os/] [boot.asm] - Rev 2
Compare with Previous | Blame | View Log
################################################################################ TITLE: Boot Up Code# AUTHOR: Grant Ayers (ayers@cs.utah.edu)# DATE: 19 July 2011# FILENAME: boot.asm# PROJECT: University of Utah XUM Single Core# DESCRIPTION:# Initializes the global pointer and stack pointer.# Zeros BSS memory region and jumps to main().################################################################################.text.balign 4.global boot.ent boot.set noreorderboot:la $t0, _bss_start # Defined in linker scriptla $t1, _bss_endla $sp, _spla $gp, _gp$bss_clear:beq $t0, $t1, $cp0_setup # Loop until BSS is clearednopsb $0, 0($t0)j $bss_clearaddiu $t0, $t0, 1$cp0_setup:la $26, $run # Load the address of $run intomtc0 $26, $30, 0 # the ErrorEPCmfc0 $26, $13, 0 # Load Cause registerlui $27, 0x0080 # Use "special" interrupt vectoror $26, $26, $27mtc0 $26, $13, 0 # Commit new Cause registermfc0 $26, $12, 0 # Load Status registerlui $27, 0x0fff # Disable access to Coprocessorsori $27, $27, 0xffffand $26, $26, $27lui $27, 0xffff # Enable, but mask all interruptsori $27, $27, 0x00ffand $26, $26, $27ori $27, $0, 0x0001 # Base operating mode is Kernelor $26, $26, $27mtc0 $26, $12, 0 # Commit new Status register#lui $26, 0x0000 # 1ms timer (50 MHz)#ori $26, $26, 0xc350lui $26, 0x0007 # 10ms timer (50 MHz)ori $26, $26, 0xa120#lui $26, 0x004c # 100ms timer (50 MHz)#ori $26, $26, 0x4b40#lui $26, 0x00be # 250ms timer (50 MHz)#ori $26, 0xbc20#lui $26, 0x017d # 500ms timer (50 MHz)#ori $26, 0x7840#lui $26, 0x02fa # 1 sec timer (50 MHz)#ori $26, $26, 0xf080mtc0 $26, $11, 0 # Set Compare register to timer valueeret # Return from Reset Exception$run:jal kernelnop$done:j $donenop.end boot
