mips32-npc loader scripts

This commit is contained in:
Yanyan Jiang 2017-05-31 05:16:45 -04:00
parent 067f633b42
commit 059e534d0a
4 changed files with 31 additions and 29 deletions

View File

@ -1,2 +1,4 @@
start.o: start.S
mips-linux-gnu-gcc -EL -march=mips32 -fno-pic -MMD -mno-abicalls -fno-delayed-branch -c start.S -o start.o
mips-linux-gnu-gcc -I$(AM_HOME)/am/arch/mips32-npc/include -EL -march=mips32 -fno-pic -MMD -mno-abicalls -fno-delayed-branch -c start.S -o start.o
-include start.d

View File

@ -1,13 +1,15 @@
.section loader, "x"
.globl _start
.type _start, @function
.globl _qemu
.type _qemu, @function
.extern _trm_init
.globl _ex_entry
.type _ex_entry, @function
_start:
li $sp, 0x17fffffc
jal _trm_init
la $k0, _trm_init
jr $k0
_qemu:
nop
jal _trm_init
.org 0x20
_ex_entry:
la $k0, _trap
jr $k0

View File

@ -6,13 +6,9 @@ shift
bash -c "cd $DIR/boot && make"
mips-linux-gnu-ld -EL -T $DIR/loader.ld -e _start -o ${DEST}.o $DIR/boot/start.o --start-group $@ --end-group
# generate COE
mips-linux-gnu-objdump -d ${DEST}.o > ${DEST}.code.txt
mips-linux-gnu-objcopy -O binary ${DEST}.o ${DEST}.bin
python $DIR/scripts/gen_bram_coe.py ${DEST}.bin ${DEST}.coe
# check instructions
mips-linux-gnu-ld -EL -T $DIR/loader.ld -e _start -o ${DEST}.o $DIR/boot/start.o --start-group $@ --end-group && \
mips-linux-gnu-objdump -d ${DEST}.o > ${DEST}.code.txt && \
mips-linux-gnu-objcopy -O binary ${DEST}.o ${DEST}.bin && \
python $DIR/scripts/gen_bram_coe.py ${DEST}.bin ${DEST}.coe && \
mips-linux-gnu-objdump -d ${DEST}.o | python $DIR/scripts/instr_check.py

View File

@ -1,13 +1,15 @@
SECTIONS
{
. = 0x10000000;
.text : { *(.text) }
.data : { *(.data) }
__bss_start = . ;
MEMORY {
bram : ORIGIN = 0x0, LENGTH = 8K
ddr : ORIGIN = 0x10000000, LENGTH = 128M
}
SECTIONS {
loader : { *(loader) } > bram
.text : { *(.text) } > ddr
.data : { *(.data) } > ddr
.bss : {
__bss_start = .;
*(.bss)
*(.scommon)
*(.sbss)
}
_end = . ;
} > ddr
}