Compare commits
2 Commits
b58cef5658
...
51aa6ba7dd
| Author | SHA1 | Date |
|---|---|---|
|
|
51aa6ba7dd | |
|
|
2cbb83f0c3 |
|
|
@ -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 -fPIE
|
-Wall -Wextra -pedantic -Wno-language-extension-token -std=gnu11 -I../ext -Isrc -fPIE
|
||||||
LDFLAGS := $(LDFLAGS) -T $(LDSCRIPT)
|
LDFLAGS := $(LDFLAGS) -T $(LDSCRIPT)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -21,18 +21,17 @@ 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 dirs
|
.PHONY: all clean obj
|
||||||
|
|
||||||
all: bin/$(TARGET)-$(ARCH)
|
all: bin/$(TARGET)-$(ARCH)
|
||||||
|
|
||||||
bin/$(TARGET)-$(ARCH): $(OBJ) dirs
|
bin/$(TARGET)-$(ARCH): $(OBJ)
|
||||||
|
@mkdir -p $(@D)
|
||||||
$(LD) $(LDFLAGS) $(OBJ) -o $@
|
$(LD) $(LDFLAGS) $(OBJ) -o $@
|
||||||
|
|
||||||
obj/$(ARCH)/%.o: src/%.c $(HFILES) dirs
|
obj/$(ARCH)/%.o: src/%.c $(HFILES)
|
||||||
|
@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
|
||||||
|
|
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#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;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#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);
|
||||||
|
|
|
||||||
|
|
@ -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*);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue