diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/arm64/ci.make | 2 | ||||
| -rw-r--r-- | src/arm64/makefile | 2 | ||||
| -rw-r--r-- | src/coreboot-start.c | 7 | ||||
| -rw-r--r-- | src/ppc64/makefile | 2 | ||||
| -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 |
7 files changed, 64 insertions, 6 deletions
diff --git a/src/arm64/ci.make b/src/arm64/ci.make index 169d7f7..07f1746 100644 --- a/src/arm64/ci.make +++ b/src/arm64/ci.make @@ -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. # # ======================================================== # diff --git a/src/arm64/makefile b/src/arm64/makefile index 7aa0ae4..8d05e8b 100644 --- a/src/arm64/makefile +++ b/src/arm64/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. # # ======================================================== # diff --git a/src/coreboot-start.c b/src/coreboot-start.c index 07606fc..cfcc668 100644 --- a/src/coreboot-start.c +++ b/src/coreboot-start.c @@ -27,13 +27,18 @@ extern void cb_start_rom(void); extern int cb_boot_processor_ready; -/// @brief hardware thread counter. +/// @brief hardware thread counter (rv64 only) +#ifdef __COMPILE_RISCV__ +uint64_t __cb_hart_counter = 0UL; +#endif /// @brief Start executing the firmware. /// @param void cb_start_exec(void) { +#ifndef __COMPILE_RISCV__ static uint64_t __cb_hart_counter = 0UL; +#endif ++__cb_hart_counter; diff --git a/src/ppc64/makefile b/src/ppc64/makefile index 03d524f..8adb03f 100644 --- a/src/ppc64/makefile +++ b/src/ppc64/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.
#
# ========================================================
#
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 |
