diff --git a/boot/x86_64/Makefile b/boot/x86_64/Makefile index 051d131..8895221 100644 --- a/boot/x86_64/Makefile +++ b/boot/x86_64/Makefile @@ -4,10 +4,10 @@ LD=$(PREFIX)ld SRCS = $(shell find . -name '*.[cS]') OBJS = $(addsuffix .o,$(basename $(SRCS))) ASFLAGS = -CFLAGS += -fno-stack-protector -nostdinc -ffreestanding -std=c11 -fno-builtin -w -Werror -nostdlib -fpie -LDFLAGS = -T loader.ld +CFLAGS = -fno-stack-protector -nostdinc -ffreestanding -std=c11 -fno-builtin -w -Werror -nostdlib +LDFLAGS = -T loader.ld -z max-page-size=0x1000 all: $(OBJS) - $(LD) $(LDFLAGS) -o loader.bin $(OBJS) + $(LD) $(LDFLAGS) -z max-page-size=0x1000 -o loader.bin $(OBJS) %.o: %.c $(CC) $(CFLAGS) -c -o $@ $^ diff --git a/kernel.settings b/kernel.settings index f34dd1d..90dd62f 100644 --- a/kernel.settings +++ b/kernel.settings @@ -1,4 +1,4 @@ -arch = x86 +arch = x86_64 subvar = 9 MODE = debug export PATH := $(HOME)/opt/bin:$(PATH) @@ -9,8 +9,8 @@ ifeq ($(arch),x86) ARCHFLAGS = -m32 else ifeq ($(arch),x86_64) - PREFIX = x86_64-mtgos- - libpath = x86_64-mtgos + PREFIX = x86_64-elf- + libpath = x86_64-elf ARCHFLAGS = -m64 -mno-red-zone LDFLAGS += -z max-page-size=0x1000 else diff --git a/kernel/init.cpp b/kernel/init.cpp index bbaa913..499bae3 100644 --- a/kernel/init.cpp +++ b/kernel/init.cpp @@ -45,7 +45,7 @@ auto load(Elf_Ehdr* file) -> void(**(*)(void*))() { return nullptr; } MTGos::Base::Output out; -void debugNumber(unsigned int i, int start) { +void debugNumber(uintptr_t i, int start) { while(i) { if(i&1) lfb[(start*6)+5]=0xFF; @@ -54,7 +54,7 @@ void debugNumber(unsigned int i, int start) { start++; } } -void adjustVTable(unsigned int** obj, unsigned int mod, int vtableSize) { +void adjustVTable(uintptr_t** obj, uintptr_t mod, int vtableSize) { mod+=0x1000; for(int i=0;i