Compare commits

...

10 commits

Author SHA1 Message Date
babbleberry
d70738eea6 Updated to add -mstrict-align and use Apple Silicon gcc 2024-04-22 10:50:24 +01:00
babbleberry
71d96e9044 Fixed pull up/pull down being the wrong way around 2024-04-22 09:54:15 +01:00
Adam Greenwood-Byrne
4cd63a2716
Merge pull request #52 from babbleberry/revert-51-master
Revert "Solve Issue #50 pull up pull down register mapping wrong way around"
2024-04-22 09:49:56 +01:00
Adam Greenwood-Byrne
1d022a6b6c
Revert "Solve Issue #50 pull up pull down register mapping wrong way around" 2024-04-22 09:49:39 +01:00
Adam Greenwood-Byrne
16f2a00914
Merge pull request #51 from LabNelson/master
Solve Issue #50 pull up pull down register mapping wrong way around
2024-04-22 09:44:20 +01:00
Nelson Ehling
0bd322d7b7 edit makefile for copying image and config to sd card 2024-03-27 12:57:39 +01:00
Nelson Ehling
c71a1cc18a Merge branch 'master' of https://github.com/LabNelson/rpi4-osdev 2024-03-27 12:51:32 +01:00
Nelson Ehling
d7ad289e54 setup folder for interrupt controlled SPI-Ethernet 2024-03-27 12:35:12 +01:00
Nelson
c1edecf21f
Merge branch 'babbleberry:master' into master 2024-03-20 14:51:47 +01:00
Nelson Ehling
8277e48bc2 changed pull up pull down register mapping 2024-03-20 14:51:11 +01:00
32 changed files with 74 additions and 96 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

@ -19,8 +19,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -19,8 +19,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -19,8 +19,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -19,8 +19,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -19,8 +19,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -19,8 +19,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -17,8 +17,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -18,8 +18,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -18,8 +18,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -18,8 +18,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -18,8 +18,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }

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

@ -19,8 +19,8 @@ enum {
enum {
Pull_None = 0,
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
Pull_Down = 2,
Pull_Up = 1
};
void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }