Compare commits

..

No commits in common. "51aa6ba7dd96164cc6a1499c1c6f400c2d27b012" and "b58cef5658c7fbfad7aa9884239cae01eddb3aa0" have entirely different histories.

5 changed files with 9 additions and 11 deletions

View File

@ -10,7 +10,7 @@ LDSCRIPT = make/$(ARCH)/linker.ld
CFLAGS ?= -O2 CFLAGS ?= -O2
CFLAGS := $(CFLAGS) $(ARCH_CFLAGS) \ CFLAGS := $(CFLAGS) $(ARCH_CFLAGS) \
-Wall -Wextra -pedantic -Wno-language-extension-token -std=gnu11 -I../ext -Isrc -fPIE -Wall -Wextra -pedantic -Wno-language-extension-token -std=gnu11 -I../ext -fPIE
LDFLAGS := $(LDFLAGS) -T $(LDSCRIPT) LDFLAGS := $(LDFLAGS) -T $(LDSCRIPT)
@ -21,17 +21,18 @@ ARCHFILES := $(ARCHFILES) $(shell find src/arch/$(ARCH) -type f -name '*.c' -pri
HFILES := $(shell find src -type f -name '*.h') HFILES := $(shell find src -type f -name '*.h')
OBJ := $(patsubst src/%.c,obj/$(ARCH)/%.o,$(CFILES) $(ARCHFILES)) OBJ := $(patsubst src/%.c,obj/$(ARCH)/%.o,$(CFILES) $(ARCHFILES))
.PHONY: all clean obj .PHONY: all clean obj dirs
all: bin/$(TARGET)-$(ARCH) all: bin/$(TARGET)-$(ARCH)
bin/$(TARGET)-$(ARCH): $(OBJ) bin/$(TARGET)-$(ARCH): $(OBJ) dirs
@mkdir -p $(@D)
$(LD) $(LDFLAGS) $(OBJ) -o $@ $(LD) $(LDFLAGS) $(OBJ) -o $@
obj/$(ARCH)/%.o: src/%.c $(HFILES) obj/$(ARCH)/%.o: src/%.c $(HFILES) dirs
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
dirs:
mkdir -p bin $(patsubst src/%,obj/$(ARCH)/%, $(shell find src/* -type d -print))
clean: clean:
rm -rf bin obj zig-cache rm -rf bin obj zig-cache

View File

@ -3,4 +3,4 @@ void halt_catch_fire() {
while(1) asm volatile ("hlt"); while(1) asm volatile ("hlt");
} }
const char *arch = "i386"; const char *arch = "i386";

View File

@ -1,8 +1,6 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <print/print.h>
#include "vga.h" #include "vga.h"
static const size_t VGA_WIDTH = 80; static const size_t VGA_WIDTH = 80;

View File

@ -1,6 +1,5 @@
#include "arch/x86/vga.h" #include "arch/x86/vga.h"
#include "hal/ops.h" #include "hal/ops.h"
#include "print/print.h"
void kmain(int argc, char **argv) { void kmain(int argc, char **argv) {
printf("Kernel initialized! Platform: %s\n", arch); printf("Kernel initialized! Platform: %s\n", arch);

View File

@ -1,4 +1,4 @@
#include <hal/print.h> #include "../hal/print.h"
void puts(const char*); void puts(const char*);
void print(const char*); void print(const char*);