From 8562967013a7ef1aff8533bc6e5ceeb75de77790 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Thu, 9 Nov 2017 15:48:08 +0000 Subject: [PATCH] Move "arch/x86" to "arch" --- arch/Makefile | 59 ++++++++++++++++++++++++++++++++---- arch/{x86 => }/asm.h | 0 arch/{x86 => }/config.h | 0 arch/{x86 => }/console.c | 0 arch/{x86 => }/console.h | 0 arch/{x86 => }/exception.c | 0 arch/{x86 => }/hwint.c | 0 arch/{x86 => }/hwint.h | 0 arch/{x86 => }/info.c | 0 arch/{x86 => }/init.c | 0 arch/{x86 => }/interrupt.asm | 0 arch/{x86 => }/interrupt.h | 0 arch/{x86 => }/itoa.c | 0 arch/{x86 => }/keyboard.c | 0 arch/{x86 => }/keyboard.h | 0 arch/{x86 => }/linker.ld | 0 arch/{x86 => }/logger.c | 0 arch/{x86 => }/logger.h | 0 arch/{x86 => }/main.c | 0 arch/{x86 => }/memset.c | 0 arch/{x86 => }/multiboot.c | 0 arch/{x86 => }/multiboot.h | 0 arch/{x86 => }/pagedir.c | 0 arch/{x86 => }/pagedir.h | 0 arch/{x86 => }/paging.asm | 0 arch/{x86 => }/paging.c | 0 arch/{x86 => }/paging.h | 0 arch/{x86 => }/panic.asm | 0 arch/{x86 => }/panic.c | 0 arch/{x86 => }/panic.h | 0 arch/{x86 => }/pfa.c | 0 arch/{x86 => }/pfa.h | 0 arch/{x86 => }/pic.c | 0 arch/{x86 => }/pic.h | 0 arch/{x86 => }/protected.asm | 0 arch/{x86 => }/protected.c | 0 arch/{x86 => }/protected.h | 0 arch/{x86 => }/start.s | 0 arch/{x86 => }/strlen.c | 0 arch/{x86 => }/strncpy.c | 0 arch/{x86 => }/syscall.c | 0 arch/{x86 => }/tasks.asm | 0 arch/{x86 => }/tasks.h | 0 arch/{x86 => }/timer.c | 0 arch/{x86 => }/timer.h | 0 arch/{x86 => }/tss.asm | 0 arch/{x86 => }/tss.c | 0 arch/{x86 => }/tss.h | 0 arch/x86/Makefile | 56 ---------------------------------- 49 files changed, 53 insertions(+), 62 deletions(-) rename arch/{x86 => }/asm.h (100%) rename arch/{x86 => }/config.h (100%) rename arch/{x86 => }/console.c (100%) rename arch/{x86 => }/console.h (100%) rename arch/{x86 => }/exception.c (100%) rename arch/{x86 => }/hwint.c (100%) rename arch/{x86 => }/hwint.h (100%) rename arch/{x86 => }/info.c (100%) rename arch/{x86 => }/init.c (100%) rename arch/{x86 => }/interrupt.asm (100%) rename arch/{x86 => }/interrupt.h (100%) rename arch/{x86 => }/itoa.c (100%) rename arch/{x86 => }/keyboard.c (100%) rename arch/{x86 => }/keyboard.h (100%) rename arch/{x86 => }/linker.ld (100%) rename arch/{x86 => }/logger.c (100%) rename arch/{x86 => }/logger.h (100%) rename arch/{x86 => }/main.c (100%) rename arch/{x86 => }/memset.c (100%) rename arch/{x86 => }/multiboot.c (100%) rename arch/{x86 => }/multiboot.h (100%) rename arch/{x86 => }/pagedir.c (100%) rename arch/{x86 => }/pagedir.h (100%) rename arch/{x86 => }/paging.asm (100%) rename arch/{x86 => }/paging.c (100%) rename arch/{x86 => }/paging.h (100%) rename arch/{x86 => }/panic.asm (100%) rename arch/{x86 => }/panic.c (100%) rename arch/{x86 => }/panic.h (100%) rename arch/{x86 => }/pfa.c (100%) rename arch/{x86 => }/pfa.h (100%) rename arch/{x86 => }/pic.c (100%) rename arch/{x86 => }/pic.h (100%) rename arch/{x86 => }/protected.asm (100%) rename arch/{x86 => }/protected.c (100%) rename arch/{x86 => }/protected.h (100%) rename arch/{x86 => }/start.s (100%) rename arch/{x86 => }/strlen.c (100%) rename arch/{x86 => }/strncpy.c (100%) rename arch/{x86 => }/syscall.c (100%) rename arch/{x86 => }/tasks.asm (100%) rename arch/{x86 => }/tasks.h (100%) rename arch/{x86 => }/timer.c (100%) rename arch/{x86 => }/timer.h (100%) rename arch/{x86 => }/tss.asm (100%) rename arch/{x86 => }/tss.c (100%) rename arch/{x86 => }/tss.h (100%) delete mode 100644 arch/x86/Makefile diff --git a/arch/Makefile b/arch/Makefile index c21dbb5..438c281 100644 --- a/arch/Makefile +++ b/arch/Makefile @@ -1,9 +1,56 @@ -SUBDIRS = x86 +# Architecture-dependent +OBJS = start.s.o +OBJS += main.c.o +OBJS += init.c.o +OBJS += multiboot.c.o +OBJS += panic.c.o panic.asm.cpp.o +OBJS += pfa.c.o +OBJS += paging.c.o paging.asm.cpp.o +OBJS += pagedir.c.o -all: - make all -C $(ARCH) +# Architecture-independent +OBJS += info.c.o +OBJS += memset.c.o +OBJS += strlen.c.o +OBJS += itoa.c.o +OBJS += strncpy.c.o -clean: $(addprefix clean-, $(SUBDIRS)) +# Built-in drivers +OBJS += console.c.o +OBJS += pic.c.o +OBJS += timer.c.o +OBJS += keyboard.c.o -clean-%: - make clean -C $* +# For debugging +OBJS += logger.c.o + +OBJS += protected.c.o protected.asm.cpp.o + +OBJS += tss.c.o tss.asm.cpp.o +OBJS += tasks.asm.cpp.o + +OBJS += interrupt.asm.cpp.o + +OBJS += exception.c.o +OBJS += hwint.c.o +OBJS += syscall.c.o + +all: $(KERNEL) + +clean: + rm -f $(OBJS) + +$(KERNEL): $(OBJS) + $(CC) -T linker.ld -o $(KERNEL) -ffreestanding -nostdlib -lgcc $(OBJS) + +%.c.o: %.c + $(CC) -c $< -o $@ $(CFLAGS) + +%.s.o: %.s + $(AS) $< -o $@ + +%.asm.cpp.o: %.asm.cpp + nasm -felf32 -o $@ $< + +%.asm.cpp: %.asm + cpp -P $< $@ diff --git a/arch/x86/asm.h b/arch/asm.h similarity index 100% rename from arch/x86/asm.h rename to arch/asm.h diff --git a/arch/x86/config.h b/arch/config.h similarity index 100% rename from arch/x86/config.h rename to arch/config.h diff --git a/arch/x86/console.c b/arch/console.c similarity index 100% rename from arch/x86/console.c rename to arch/console.c diff --git a/arch/x86/console.h b/arch/console.h similarity index 100% rename from arch/x86/console.h rename to arch/console.h diff --git a/arch/x86/exception.c b/arch/exception.c similarity index 100% rename from arch/x86/exception.c rename to arch/exception.c diff --git a/arch/x86/hwint.c b/arch/hwint.c similarity index 100% rename from arch/x86/hwint.c rename to arch/hwint.c diff --git a/arch/x86/hwint.h b/arch/hwint.h similarity index 100% rename from arch/x86/hwint.h rename to arch/hwint.h diff --git a/arch/x86/info.c b/arch/info.c similarity index 100% rename from arch/x86/info.c rename to arch/info.c diff --git a/arch/x86/init.c b/arch/init.c similarity index 100% rename from arch/x86/init.c rename to arch/init.c diff --git a/arch/x86/interrupt.asm b/arch/interrupt.asm similarity index 100% rename from arch/x86/interrupt.asm rename to arch/interrupt.asm diff --git a/arch/x86/interrupt.h b/arch/interrupt.h similarity index 100% rename from arch/x86/interrupt.h rename to arch/interrupt.h diff --git a/arch/x86/itoa.c b/arch/itoa.c similarity index 100% rename from arch/x86/itoa.c rename to arch/itoa.c diff --git a/arch/x86/keyboard.c b/arch/keyboard.c similarity index 100% rename from arch/x86/keyboard.c rename to arch/keyboard.c diff --git a/arch/x86/keyboard.h b/arch/keyboard.h similarity index 100% rename from arch/x86/keyboard.h rename to arch/keyboard.h diff --git a/arch/x86/linker.ld b/arch/linker.ld similarity index 100% rename from arch/x86/linker.ld rename to arch/linker.ld diff --git a/arch/x86/logger.c b/arch/logger.c similarity index 100% rename from arch/x86/logger.c rename to arch/logger.c diff --git a/arch/x86/logger.h b/arch/logger.h similarity index 100% rename from arch/x86/logger.h rename to arch/logger.h diff --git a/arch/x86/main.c b/arch/main.c similarity index 100% rename from arch/x86/main.c rename to arch/main.c diff --git a/arch/x86/memset.c b/arch/memset.c similarity index 100% rename from arch/x86/memset.c rename to arch/memset.c diff --git a/arch/x86/multiboot.c b/arch/multiboot.c similarity index 100% rename from arch/x86/multiboot.c rename to arch/multiboot.c diff --git a/arch/x86/multiboot.h b/arch/multiboot.h similarity index 100% rename from arch/x86/multiboot.h rename to arch/multiboot.h diff --git a/arch/x86/pagedir.c b/arch/pagedir.c similarity index 100% rename from arch/x86/pagedir.c rename to arch/pagedir.c diff --git a/arch/x86/pagedir.h b/arch/pagedir.h similarity index 100% rename from arch/x86/pagedir.h rename to arch/pagedir.h diff --git a/arch/x86/paging.asm b/arch/paging.asm similarity index 100% rename from arch/x86/paging.asm rename to arch/paging.asm diff --git a/arch/x86/paging.c b/arch/paging.c similarity index 100% rename from arch/x86/paging.c rename to arch/paging.c diff --git a/arch/x86/paging.h b/arch/paging.h similarity index 100% rename from arch/x86/paging.h rename to arch/paging.h diff --git a/arch/x86/panic.asm b/arch/panic.asm similarity index 100% rename from arch/x86/panic.asm rename to arch/panic.asm diff --git a/arch/x86/panic.c b/arch/panic.c similarity index 100% rename from arch/x86/panic.c rename to arch/panic.c diff --git a/arch/x86/panic.h b/arch/panic.h similarity index 100% rename from arch/x86/panic.h rename to arch/panic.h diff --git a/arch/x86/pfa.c b/arch/pfa.c similarity index 100% rename from arch/x86/pfa.c rename to arch/pfa.c diff --git a/arch/x86/pfa.h b/arch/pfa.h similarity index 100% rename from arch/x86/pfa.h rename to arch/pfa.h diff --git a/arch/x86/pic.c b/arch/pic.c similarity index 100% rename from arch/x86/pic.c rename to arch/pic.c diff --git a/arch/x86/pic.h b/arch/pic.h similarity index 100% rename from arch/x86/pic.h rename to arch/pic.h diff --git a/arch/x86/protected.asm b/arch/protected.asm similarity index 100% rename from arch/x86/protected.asm rename to arch/protected.asm diff --git a/arch/x86/protected.c b/arch/protected.c similarity index 100% rename from arch/x86/protected.c rename to arch/protected.c diff --git a/arch/x86/protected.h b/arch/protected.h similarity index 100% rename from arch/x86/protected.h rename to arch/protected.h diff --git a/arch/x86/start.s b/arch/start.s similarity index 100% rename from arch/x86/start.s rename to arch/start.s diff --git a/arch/x86/strlen.c b/arch/strlen.c similarity index 100% rename from arch/x86/strlen.c rename to arch/strlen.c diff --git a/arch/x86/strncpy.c b/arch/strncpy.c similarity index 100% rename from arch/x86/strncpy.c rename to arch/strncpy.c diff --git a/arch/x86/syscall.c b/arch/syscall.c similarity index 100% rename from arch/x86/syscall.c rename to arch/syscall.c diff --git a/arch/x86/tasks.asm b/arch/tasks.asm similarity index 100% rename from arch/x86/tasks.asm rename to arch/tasks.asm diff --git a/arch/x86/tasks.h b/arch/tasks.h similarity index 100% rename from arch/x86/tasks.h rename to arch/tasks.h diff --git a/arch/x86/timer.c b/arch/timer.c similarity index 100% rename from arch/x86/timer.c rename to arch/timer.c diff --git a/arch/x86/timer.h b/arch/timer.h similarity index 100% rename from arch/x86/timer.h rename to arch/timer.h diff --git a/arch/x86/tss.asm b/arch/tss.asm similarity index 100% rename from arch/x86/tss.asm rename to arch/tss.asm diff --git a/arch/x86/tss.c b/arch/tss.c similarity index 100% rename from arch/x86/tss.c rename to arch/tss.c diff --git a/arch/x86/tss.h b/arch/tss.h similarity index 100% rename from arch/x86/tss.h rename to arch/tss.h diff --git a/arch/x86/Makefile b/arch/x86/Makefile deleted file mode 100644 index 438c281..0000000 --- a/arch/x86/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -# Architecture-dependent -OBJS = start.s.o -OBJS += main.c.o -OBJS += init.c.o -OBJS += multiboot.c.o -OBJS += panic.c.o panic.asm.cpp.o -OBJS += pfa.c.o -OBJS += paging.c.o paging.asm.cpp.o -OBJS += pagedir.c.o - -# Architecture-independent -OBJS += info.c.o -OBJS += memset.c.o -OBJS += strlen.c.o -OBJS += itoa.c.o -OBJS += strncpy.c.o - -# Built-in drivers -OBJS += console.c.o -OBJS += pic.c.o -OBJS += timer.c.o -OBJS += keyboard.c.o - -# For debugging -OBJS += logger.c.o - -OBJS += protected.c.o protected.asm.cpp.o - -OBJS += tss.c.o tss.asm.cpp.o -OBJS += tasks.asm.cpp.o - -OBJS += interrupt.asm.cpp.o - -OBJS += exception.c.o -OBJS += hwint.c.o -OBJS += syscall.c.o - -all: $(KERNEL) - -clean: - rm -f $(OBJS) - -$(KERNEL): $(OBJS) - $(CC) -T linker.ld -o $(KERNEL) -ffreestanding -nostdlib -lgcc $(OBJS) - -%.c.o: %.c - $(CC) -c $< -o $@ $(CFLAGS) - -%.s.o: %.s - $(AS) $< -o $@ - -%.asm.cpp.o: %.asm.cpp - nasm -felf32 -o $@ $< - -%.asm.cpp: %.asm - cpp -P $< $@