链接脚本
#include <mmu.h>
#include <memlayout.h>
.section .text,"ax",%progbits
.globl kern_entry
kern_entry:
la sp, bootstacktop
tail kern_init
#调用kern_init, 这是我们要用C语言编写的一个函数, tail是riscv伪指令,作用相当于调用函数(跳转)
.section .data
# .align 2^12
.align PGSHIFT
.global bootstack
bootstack:
.space KSTACKSIZE
.global bootstacktop
bootstacktop:最后更新于