From b289b67088c8485fef894c99e258a278c298e051 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 4 Nov 2017 06:21:22 +0000 Subject: [PATCH] Add include dir --- Makefile | 2 +- arch/Makefile | 2 +- arch/console.c | 2 +- arch/kprintf.c | 3 ++- arch/paging.c | 3 ++- arch/protected.c | 3 ++- arch/util.h => include/kernelmq/stdlib.h | 4 ++-- 7 files changed, 11 insertions(+), 8 deletions(-) rename arch/util.h => include/kernelmq/stdlib.h (68%) diff --git a/Makefile b/Makefile index fb037a1..72fcf11 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ all: all-kernel all-iso all-libk clean: clean-kernel clean-iso clean-libk all-kernel: all-libk - make all -C arch LIBK=$(shell pwd)/libk/libk.a + make all -C arch I=$(shell pwd)/include LIBK=$(shell pwd)/libk/libk.a clean-kernel: make clean -C arch diff --git a/arch/Makefile b/arch/Makefile index 5e2629e..13eeb76 100644 --- a/arch/Makefile +++ b/arch/Makefile @@ -27,7 +27,7 @@ kernel: $(OBJS) grub-file --is-x86-multiboot2 $@ %.c.o: %.c - $(CC) -c $< -o $@ -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra + $(CC) -c $< -o $@ -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra -I "$(I)" %.s.o: %.s $(AS) $< -o $@ diff --git a/arch/console.c b/arch/console.c index 32a99aa..7dfdcb1 100644 --- a/arch/console.c +++ b/arch/console.c @@ -1,6 +1,6 @@ #include "console.h" -#include "util.h" +#include static unsigned short *const console_buffer = (unsigned short*)0xB8000; diff --git a/arch/kprintf.c b/arch/kprintf.c index de8c5ff..e5c62aa 100644 --- a/arch/kprintf.c +++ b/arch/kprintf.c @@ -1,7 +1,8 @@ #include "kprintf.h" #include "console.h" -#include "util.h" + +#include void kprintf(const char *format, ...) { diff --git a/arch/paging.c b/arch/paging.c index 800a401..081ef84 100644 --- a/arch/paging.c +++ b/arch/paging.c @@ -2,7 +2,8 @@ #include "logger.h" #include "kmalloc.h" -#include "util.h" + +#include #define PAGES_PER_TABLE 1024 #define TABLES_PER_DIR 1024 diff --git a/arch/protected.c b/arch/protected.c index 4c011f0..02c015b 100644 --- a/arch/protected.c +++ b/arch/protected.c @@ -5,7 +5,8 @@ #include "asm.h" #include "exception.h" #include "hwint.h" -#include "util.h" + +#include struct GdtPointer { unsigned short limit; diff --git a/arch/util.h b/include/kernelmq/stdlib.h similarity index 68% rename from arch/util.h rename to include/kernelmq/stdlib.h index 3cd3c92..4151564 100644 --- a/arch/util.h +++ b/include/kernelmq/stdlib.h @@ -1,5 +1,5 @@ -#ifndef KERNELMQ_INCLUDED_UTIL -#define KERNELMQ_INCLUDED_UTIL 1 +#ifndef KERNELMQ_INCLUDED_STDLIB +#define KERNELMQ_INCLUDED_STDLIB 1 void memset(void *buffer, unsigned char value, unsigned int size); unsigned int strlen(const char *s);