diff options
Diffstat (limited to 'src/rv64')
| -rw-r--r-- | src/rv64/ci.make | 53 | ||||
| -rw-r--r-- | src/rv64/makefile | 4 | ||||
| -rw-r--r-- | src/rv64/script.lds (renamed from src/rv64/linkscript.ld) | 0 |
3 files changed, 55 insertions, 2 deletions
diff --git a/src/rv64/ci.make b/src/rv64/ci.make new file mode 100644 index 0000000..757d6c1 --- /dev/null +++ b/src/rv64/ci.make @@ -0,0 +1,53 @@ + # + # ======================================================== + # + # CoreBoot + # Date Added: 08/11/2023 + # Copyright 2024, Amlal El Mahrouss, all rights reserved. + # + # ======================================================== + # + +CC=riscv64-unknown-elf-gcc +FIRMWARE=core-boot.elf +FLAGS=-D__COMPILE_RISCV__ -I../../ -Wall -c -nostdlib -ffreestanding -fno-builtin -D__BSTRICT__ -D__BDEBUG__ -O0 -mcmodel=medany +C_SRC= $(wildcard *.s) $(wildcard *.c) $(wildcard ../*.c) -c + +CXX=riscv64-unknown-elf-g++ +CXX_SRC= $(wildcard *.cc) $(wildcard ../*.cc) -c + +LD=riscv64-unknown-elf-ld +OBJ=*.o +FLAGS_LD= --script=script.lds -o core-boot.elf + +EMU=qemu-system-riscv64 -m 4G -smp 2 -machine virt -bios $(FIRMWARE) -d int -device VGA + +.PHONY: all +all: firmware-link + @echo "[CoreBoot] Done." + +# link (make firmware) +.PHONY: firmware-link +firmware-link: firmware-compile + $(LD) $(OBJ) $(FLAGS_LD) + +# compile firmware +.PHONY: firmware-compile +firmware-compile: + $(CC) $(FLAGS) $(C_SRC) + $(CXX) -ffreestanding -fno-rtti -fno-exceptions $(FLAGS) $(CXX_SRC) + +# launch qemu rule +.PHONY: run +run: + $(EMU) + +# launch qemu with attached debugger +.PHONY: run-dbg +run-dbg: + $(EMU) -S + +# remove object files +.PHONY: clean +clean: + rm -f $(wildcard *.o) $(wildcard *.elf) $(wildcard *.rom) $(wildcard *.epm) diff --git a/src/rv64/makefile b/src/rv64/makefile index 0bd8a28..757d6c1 100644 --- a/src/rv64/makefile +++ b/src/rv64/makefile @@ -3,7 +3,7 @@ # # CoreBoot # Date Added: 08/11/2023 - # Copyright 2024, ZKA Technologies, all rights reserved. + # Copyright 2024, Amlal El Mahrouss, all rights reserved. # # ======================================================== # @@ -18,7 +18,7 @@ CXX_SRC= $(wildcard *.cc) $(wildcard ../*.cc) -c LD=riscv64-unknown-elf-ld OBJ=*.o -FLAGS_LD= --script=linkscript.ld -o core-boot.elf +FLAGS_LD= --script=script.lds -o core-boot.elf EMU=qemu-system-riscv64 -m 4G -smp 2 -machine virt -bios $(FIRMWARE) -d int -device VGA diff --git a/src/rv64/linkscript.ld b/src/rv64/script.lds index ca4e8dc..ca4e8dc 100644 --- a/src/rv64/linkscript.ld +++ b/src/rv64/script.lds |
