Fix asm, can use pseudo ops.

master
WangRunji 6 years ago
parent 1611bcb91f
commit de7d9a1b71

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

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

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

Loading…
Cancel
Save