From 4ca5617bfc3132b5caf52d25f2bc5359b6eb8da2 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Mon, 28 Oct 2013 23:02:13 +0100 Subject: [PATCH] Create a sub makefile for the micro_kernel --- Makefile | 11 ++++------- micro_kernel/Makefile | 5 +++++ micro_kernel/micro_kernel.asm | 8 ++++---- micro_kernel/shell.asm | 6 +++--- 4 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 micro_kernel/Makefile diff --git a/Makefile b/Makefile index 296c4436..d7b18e31 100644 --- a/Makefile +++ b/Makefile @@ -3,15 +3,12 @@ default: thor.flp bootloader.bin: force_look cd bootloader; $(MAKE) +micro_kernel.bin: force_look + cd micro_kernel; $(MAKE) + force_look: true -MICRO_KERNEL_SRC=$(wildcard micro_kernel/*.asm) -MICRO_KERNEL_UTILS_SRC=$(wildcard micro_kernel/utils/*.asm) - -micro_kernel.bin: $(MICRO_KERNEL_SRC) $(MICRO_KERNEL_UTILS_SRC) - nasm -w+all -f bin -o micro_kernel.bin micro_kernel/micro_kernel.asm - KERNEL_FLAGS=-masm=intel -Ikernel/include/ -O1 -std=c++11 -Wall -Wextra -fno-exceptions -fno-rtti -ffreestanding KERNEL_LINK_FLAGS=-std=c++11 -T linker.ld -ffreestanding -O1 -nostdlib @@ -44,7 +41,7 @@ filler.bin: kernel.bin thor.flp: bootloader.bin micro_kernel.bin kernel.bin filler.bin cat bootloader/bootloader.bin > thor.bin - cat micro_kernel.bin >> thor.bin + cat micro_kernel/micro_kernel.bin >> thor.bin cat kernel.bin >> thor.bin cat filler.bin >> thor.bin dd status=noxfer conv=notrunc if=thor.bin of=thor.flp diff --git a/micro_kernel/Makefile b/micro_kernel/Makefile new file mode 100644 index 00000000..f253dee3 --- /dev/null +++ b/micro_kernel/Makefile @@ -0,0 +1,5 @@ +MICRO_KERNEL_SRC=$(wildcard *.asm) +MICRO_KERNEL_UTILS_SRC=$(wildcard utils/*.asm) + +micro_kernel.bin: $(MICRO_KERNEL_SRC) $(MICRO_KERNEL_UTILS_SRC) + nasm -w+all -f bin -o micro_kernel.bin micro_kernel.asm diff --git a/micro_kernel/micro_kernel.asm b/micro_kernel/micro_kernel.asm index 37633ad3..6af5872b 100644 --- a/micro_kernel/micro_kernel.asm +++ b/micro_kernel/micro_kernel.asm @@ -113,11 +113,11 @@ lm_start: ; Includes -%include "micro_kernel/utils/macros.asm" -%include "micro_kernel/utils/console.asm" +%include "utils/macros.asm" +%include "utils/console.asm" -%include "micro_kernel/interrupts.asm" -%include "micro_kernel/shell.asm" +%include "interrupts.asm" +%include "shell.asm" ; Global Descriptors Table diff --git a/micro_kernel/shell.asm b/micro_kernel/shell.asm index 2f3a8a8b..3e1f876d 100644 --- a/micro_kernel/shell.asm +++ b/micro_kernel/shell.asm @@ -1,7 +1,7 @@ -%include "micro_kernel/utils/utils.asm" -%include "micro_kernel/utils/keyboard.asm" +%include "utils/utils.asm" +%include "utils/keyboard.asm" -%include "micro_kernel/commands.asm" +%include "commands.asm" ; Entry point of the shell, this function never returns shell_start: