I have not yet been able to figure out the problem. I have changed my compiler and have started using ARM DS5 to compile and use the makefile with a few modifications.
The compiler is obtained from
https://developer.arm.com/open-source/g ... /downloads and linked to the DS5 toolchain.
To refresh the error provided by
arm-none-eabi-gcc -Iinclude -MMD -c src/start32.S -o build/start32_s.o
is
src/start32.S: Assembler messages:
src/start32.S:103: Error: selected processor does not support `vmsr fpexc,r0' in ARM mode
I have not yet been able to enable the floating point unit, I have tried many options (Linux and windows) and have not yet been able to enable the FP unit.
Attached below is a copy of my makefile
Code: Select all
ARMGNU ?= arm-none-eabi-
#ARMGNU ?=
COPS = -Wall -nostdlib -nostartfiles -ffreestanding -Iinclude -O2 \
-mcpu=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv8-a+neon+fpv3
#COPS = -Wall -nostdlib -nostartfiles -ffreestanding -Iinclude -O2 \
# -mfpu=neon-vfpv4 -mcpu=cortex-a53 -mfloat-abi=hard -march=armv8-a
#old flags
#-mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7-a -mtune=cortex-a53
ASMOPS = -Iinclude
BUILD_DIR = build
SRC_DIR = src
all :kernel7.img
clean:
del $(BUILD_DIR)\*.o
del $(BUILD_DIR)\*.d
# del $(BUILD_DIR)\*.elf
$(BUILD_DIR)/%_c.o: $(SRC_DIR)/%.c
# mkdir -p $(@D)
$(ARMGNU)gcc $(COPS) -MMD -c $< -o [email protected]
$(BUILD_DIR)/%_s.o: $(SRC_DIR)/%.S
$(ARMGNU)gcc $(ASMOPS) -MMD -c $< -o [email protected]
C_FILES = $(wildcard src/*.c)
ASM_FILES = $(wildcard src/*.S)
#OBJ_FILES = $(wildcard $(BUILD_DIR)/*.o)
OBJ_FILES = $(C_FILES:$(SRC_DIR)/%.c=$(BUILD_DIR)/%_c.o)
OBJ_FILES += $(ASM_FILES:$(SRC_DIR)/%.S=$(BUILD_DIR)/%_s.o)
DEP_FILES = $(OBJ_FILES:%.o=%.d)
-include $(DEP_FILES)
#include the previously built object files
#OBJ_FILES += $(wildcard $(BUILD_DIR)/*.o)
kernel7.img: $(SRC_DIR)/linker32.ld $(OBJ_FILES)
$(ARMGNU)ld -T src/linker32.ld -Map output.map -o $(BUILD_DIR)/kernel7.elf $(OBJ_FILES)
$(ARMGNU)objcopy $(BUILD_DIR)/kernel7.elf -O binary kernel7.img
$(ARMGNU)nm -n $(BUILD_DIR)/kernel7.elf > $(BUILD_DIR)/output.symbol
$(ARMGNU)objdump -D $(BUILD_DIR)/kernel7.elf > $(BUILD_DIR)/output.list
attached is my start.S file extract to enable the FP unit...
Code: Select all
@FPU_enable:
@ MRC p15, 0, r0, c1, c1, 2
@ ORR r0, r0, #3<<10
@ MCR p15, 0, r0, c1, c1, 2
@
@ mrc p15,0,r0,c1,c0, #2 // R0 = Access Control Register
@ orr r0, #(0x300000 + 0xC00000) // Enable Single & Double Precision
@ mcr p15,0,r0,c1,c0, #2 // Access Control Register = R0
@ mov r0, #0x40000000 // R0 = Enable VFP
vmsr fpexc,r0 // FPEXC = R0 --- THIS LINE ALWAYS GIVES AN ERROR!!!
@
if I comment vmsr fpexc,r0 out I am able to compile.