sgmarz / osblog

The Adventures of OS
MIT License
517 stars 70 forks source link

Build error: undefined reference to `asm_trap_vector' #1

Closed xjvs closed 5 years ago

xjvs commented 5 years ago

the tools has been built, there is a patch required before build linux header: https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg5643342.html

$ cd osblog/risc_v/ch1
$ make
cargo build
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
riscv64-unknown-linux-gnu-g++ -Wall -Wextra -pedantic -Wextra -O0 -g -std=c++17 -static -ffreestanding -nostdlib -fno-rtti -fno-exceptions -march=rv64gc -mabi=lp64 -Tsrc/lds/virt.lds  -o os.elf src/asm/boot.S -L./target/riscv64gc-unknown-none-elf/debug -lsos -lgcc
/opt/riscv64/lib/gcc/riscv64-unknown-linux-gnu/9.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: /tmp/cc95q4gI.o: in function `.L0 ':
/data/riscv/myos/src/asm/boot.S:41: undefined reference to `asm_trap_vector'
collect2: error: ld returned 1 exit status
make: *** [Makefile:29: all] Error 1
sgmarz commented 5 years ago

This has been fixed and the fix has been pushed. You need an empty asm_trap_vector assembly function to get this to compile since we put it in the mtvec register during boot.