Updated to add -mstrict-align and use Apple Silicon gcc

This commit is contained in:
babbleberry 2024-04-22 10:50:24 +01:00
parent 71d96e9044
commit d70738eea6
20 changed files with 50 additions and 72 deletions

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
extern unsigned int spin_cpu0;
extern unsigned int spin_cpu1;
extern unsigned int spin_cpu2;
extern unsigned int spin_cpu3;
extern unsigned long spin_cpu0;
extern unsigned long spin_cpu1;
extern unsigned long spin_cpu2;
extern unsigned long spin_cpu3;
void start_core1(void (*func)(void));
void start_core2(void (*func)(void));

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c lib/*.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
extern unsigned int spin_cpu0;
extern unsigned int spin_cpu1;
extern unsigned int spin_cpu2;
extern unsigned int spin_cpu3;
extern unsigned long spin_cpu0;
extern unsigned long spin_cpu1;
extern unsigned long spin_cpu2;
extern unsigned long spin_cpu3;
void start_core1(void (*func)(void));
void start_core2(void (*func)(void));

View file

@ -1,7 +1,7 @@
extern unsigned int spin_cpu0;
extern unsigned int spin_cpu1;
extern unsigned int spin_cpu2;
extern unsigned int spin_cpu3;
extern unsigned long spin_cpu0;
extern unsigned long spin_cpu1;
extern unsigned long spin_cpu2;
extern unsigned long spin_cpu3;
void start_core1(void (*func)(void));
void start_core2(void (*func)(void));

View file

@ -1,8 +1,8 @@
CFILES = $(wildcard *.c lib/*.c kernel/*.c)
SFILES = $(wildcard boot/*.S lib/*.S kernel/*.S)
OFILES = $(CFILES:.c=.o) $(SFILES:.S=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
extern unsigned int spin_cpu0;
extern unsigned int spin_cpu1;
extern unsigned int spin_cpu2;
extern unsigned int spin_cpu3;
extern unsigned long spin_cpu0;
extern unsigned long spin_cpu1;
extern unsigned long spin_cpu2;
extern unsigned long spin_cpu3;
void start_core1(void (*func)(void));
void start_core2(void (*func)(void));

View file

@ -1,8 +1,8 @@
CFILES = $(wildcard *.c lib/*.c kernel/*.c net/*.c)
SFILES = $(wildcard boot/*.S lib/*.S kernel/*.S)
OFILES = $(CFILES:.c=.o) $(SFILES:.S=.o)
GCCFLAGS = -Wall -O0 -ffreestanding -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
extern unsigned int spin_cpu0;
extern unsigned int spin_cpu1;
extern unsigned int spin_cpu2;
extern unsigned int spin_cpu3;
extern unsigned long spin_cpu0;
extern unsigned long spin_cpu1;
extern unsigned long spin_cpu2;
extern unsigned long spin_cpu3;
void start_core1(void (*func)(void));
void start_core2(void (*func)(void));

View file

@ -1,8 +1,8 @@
CFILES = $(wildcard *.c lib/*.c kernel/*.c net/*.c tcpip/*.c)
SFILES = $(wildcard boot/*.S lib/*.S kernel/*.S)
OFILES = $(CFILES:.c=.o) $(SFILES:.S=.o)
GCCFLAGS = -Wall -O0 -ffreestanding -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
extern unsigned int spin_cpu0;
extern unsigned int spin_cpu1;
extern unsigned int spin_cpu2;
extern unsigned int spin_cpu3;
extern unsigned long spin_cpu0;
extern unsigned long spin_cpu1;
extern unsigned long spin_cpu2;
extern unsigned long spin_cpu3;
void start_core1(void (*func)(void));
void start_core2(void (*func)(void));

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img

View file

@ -1,22 +0,0 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ..\..\gcc-arm-10.2-2020.11-mingw-w64-i686-aarch64-none-elf\bin
all: clean kernel8.img
boot.o: boot.S
$(GCCPATH)\aarch64-none-elf-gcc $(GCCFLAGS) -c boot.S -o boot.o
BCM4345C0.o : BCM4345C0.hcd
$(GCCPATH)\aarch64-none-elf-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
%.o: %.c
$(GCCPATH)\aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
kernel8.img: boot.o $(OFILES) BCM4345C0.o
$(GCCPATH)\aarch64-none-elf-ld -nostdlib boot.o $(OFILES) BCM4345C0.o -T link.ld -o kernel8.elf
$(GCCPATH)\aarch64-none-elf-objcopy -O binary kernel8.elf kernel8.img
clean:
del kernel8.elf *.o *.img

View file

@ -1,7 +1,7 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -mstrict-align
GCCPATH = ../../arm-gnu-toolchain-13.2.Rel1-darwin-arm64-aarch64-none-elf/bin
all: clean kernel8.img