Compare commits

..

No commits in common. "64b01f843364ad0ea29504bc7539212cb53eaf11" and "0c17fc4402ecc8ea9843dcf2897a0f0af5c9eb69" have entirely different histories.

10 changed files with 10 additions and 26 deletions

View File

@ -19,7 +19,7 @@ TARGET := kernel
CFILES := $(shell find src -path src/arch -prune -o -type f -name '*.c' -print) CFILES := $(shell find src -path src/arch -prune -o -type f -name '*.c' -print)
ARCHFILES := $(ARCHFILES) $(shell find src/arch/$(ARCH) -type f -name '*.c' -print) ARCHFILES := $(ARCHFILES) $(shell find src/arch/$(ARCH) -type f -name '*.c' -print)
HFILES := $(shell find src -type f -name '*.h') HFILES := $(shell find src -type f -name '*.h')
OBJ := $(patsubst src/%,obj/$(ARCH)/%.o,$(CFILES) $(ARCHFILES)) OBJ := $(patsubst src/%.c,obj/$(ARCH)/%.o,$(CFILES) $(ARCHFILES))
.PHONY: all clean obj $(ARCHES) .PHONY: all clean obj $(ARCHES)
@ -32,9 +32,9 @@ $(ARCHES):
bin/$(TARGET)-$(ARCH): $(OBJ) bin/$(TARGET)-$(ARCH): $(OBJ)
@mkdir -p $(@D) @mkdir -p $(@D)
@echo Linking $@ @echo Linking $@
$(LD) $(LDFLAGS) $(OBJ) -o $@ @$(LD) $(LDFLAGS) $(OBJ) -o $@
obj/$(ARCH)/%.c.o: src/%.c $(HFILES) obj/$(ARCH)/%.o: src/%.c $(HFILES)
@mkdir -p $(@D) @mkdir -p $(@D)
@echo $(CC) $< @echo $(CC) $<
@$(CC) $(CFLAGS) -c $< -o $@ @$(CC) $(CFLAGS) -c $< -o $@

View File

@ -1,3 +1 @@
-include make/x86/make.config -include make/x86/make.config
NASM := nasm -felf32

View File

@ -1,9 +1,2 @@
ARCHFILES := $(shell find src/arch/x86 -type f -name '*.c' -print) \ ARCHFILES := $(shell find src/arch/x86 -type f -name '*.c' -print)
$(shell find src/arch/x86 -type f -name '*.nasm' -print) \
$(shell find src/arch/$(ARCH) -type f -name '*.nasm' -print)
ARCH_CFLAGS := -masm=intel ARCH_CFLAGS := -masm=intel
obj/$(ARCH)/%.nasm.o: src/%.nasm
@mkdir -p $(@D)
@echo nasm $<
@$(NASM) $(NASMFLAGS) $< -o $@

View File

@ -1,4 +1,3 @@
-include make/x86/make.config -include make/x86/make.config
NASM := nasm -felf64
ARCH_CFLAGS := $(ARCH_CFLAGS) -mcmodel=kernel ARCH_CFLAGS := $(ARCH_CFLAGS) -mcmodel=kernel

View File

@ -29,5 +29,6 @@ void stivale2_main(struct stivale2_struct *info) {
); );
printf("PAGE TABLE AT: %x\n", cr3); printf("PAGE TABLE AT: %x\n", cr3);
kmain(); char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
kmain(3, argv);
} }

View File

@ -1,2 +1 @@
extern char archval; const char *arch = "i386";
const char *arch = &archval;

View File

@ -1,2 +0,0 @@
global archval
archval db "i386-nasm", 0

View File

@ -1,3 +1 @@
extern char archval; const char *arch = "x86_64";
const char *arch = &archval;

View File

@ -1,2 +0,0 @@
global archval
archval db "x86_64-nasm", 0

View File

@ -1 +1 @@
void kmain(); void kmain(int argc, char** argv);