Fix asm, can use pseudo ops.

master
WangRunji 6 years ago
parent 1611bcb91f
commit de7d9a1b71

@ -79,6 +79,7 @@ endif
ld := $(prefix)ld
objdump := $(prefix)objdump
cc := $(prefix)gcc
as := $(prefix)as
.PHONY: all clean run iso build asm doc justrun kernel
@ -137,6 +138,10 @@ build/arch/x86_64/boot/%.o: $(boot_src)/%.asm
@mkdir -p $(shell dirname $@)
@nasm -felf64 $< -o $@
build/arch/riscv32/boot/%.o: $(boot_src)/%.asm
@mkdir -p $(shell dirname $@)
@$(as) -march=rv32i $< -o $@
# make .o from .img file
build/user/%.o: user/%.img
@mkdir -p $(shell dirname $@)

@ -1,13 +1,8 @@
.section .text,"ax",%progbits
.globl kern_entry
kern_entry:
# la sp, bootstacktop
auipc sp, %hi(bootstacktop)
addi sp, sp, %lo(bootstacktop)
# tail rust_main
auipc t1, %hi(rust_main)
jalr zero, t1, %lo(rust_main)
la sp, bootstacktop
tail rust_main
.section .data
.align 12 #PGSHIFT

@ -1,5 +1,3 @@
global_asm!(include_str!("boot/entry.S"));
extern crate riscv;
extern crate bbl;

Loading…
Cancel
Save