From ca4250c663595e4f9ee0d2836a742bfffe103831 Mon Sep 17 00:00:00 2001 From: Enrico Fraccaroli Date: Wed, 10 Nov 2021 12:14:40 +0100 Subject: [PATCH] Move debugging functions to io folder. --- mentos/CMakeLists.txt | 4 ++-- mentos/src/boot.c | 2 +- mentos/src/descriptor_tables/exception.c | 2 +- mentos/src/descriptor_tables/gdt.c | 2 +- mentos/src/descriptor_tables/interrupt.c | 2 +- mentos/src/descriptor_tables/tss.c | 2 +- mentos/src/devices/fpu.c | 2 +- mentos/src/devices/pci.c | 2 +- mentos/src/drivers/ata.c | 2 +- mentos/src/drivers/keyboard/keyboard.c | 2 +- mentos/src/elf/elf.c | 2 +- mentos/src/fs/initrd.c | 2 +- mentos/src/fs/open.c | 2 +- mentos/src/fs/procfs.c | 2 +- mentos/src/fs/stat.c | 2 +- mentos/src/fs/vfs.c | 2 +- mentos/src/hardware/timer.c | 2 +- mentos/src/io/debug.c | 2 +- mentos/src/io/proc_running.c | 2 +- mentos/src/io/proc_system.c | 2 +- mentos/src/io/proc_video.c | 2 +- mentos/src/io/vga/vga.c | 2 +- mentos/src/kernel.c | 2 +- mentos/src/klib/mutex.c | 2 +- mentos/src/klib/ndtree.c | 2 +- mentos/src/klib/rbtree.c | 2 +- mentos/src/klib/time.c | 2 +- mentos/src/klib/vscanf.c | 2 +- mentos/src/mem/buddysystem.c | 2 +- mentos/src/mem/kheap.c | 2 +- mentos/src/mem/paging.c | 2 +- mentos/src/mem/slab.c | 2 +- mentos/src/mem/zone_allocator.c | 2 +- mentos/src/multiboot.c | 2 +- mentos/src/process/process.c | 2 +- mentos/src/process/scheduler.c | 2 +- mentos/src/process/scheduler_algorithm.c | 2 +- mentos/src/sys/module.c | 2 +- mentos/src/sys/utsname.c | 2 +- mentos/src/system/panic.c | 2 +- mentos/src/system/signal.c | 2 +- 41 files changed, 42 insertions(+), 42 deletions(-) diff --git a/mentos/CMakeLists.txt b/mentos/CMakeLists.txt index 8be90ca..f43a68e 100644 --- a/mentos/CMakeLists.txt +++ b/mentos/CMakeLists.txt @@ -167,6 +167,7 @@ if(USE_BUDDY_SYSTEM) src/io/mm_io.c src/io/video.c src/io/stdio.c + src/io/debug.c src/io/proc_video.c src/io/proc_running.c src/io/proc_system.c @@ -197,7 +198,6 @@ if(USE_BUDDY_SYSTEM) src/mem/vmem_map.c src/mem/zone_allocator.c src/mem/buddysystem.c - src/misc/debug.c src/elf/elf.c src/descriptor_tables/gdt.c src/descriptor_tables/gdt.S @@ -250,6 +250,7 @@ else(USE_BUDDY_SYSTEM) src/io/mm_io.c src/io/video.c src/io/stdio.c + src/io/debug.c src/io/proc_video.c src/io/proc_running.c src/io/proc_system.c @@ -279,7 +280,6 @@ else(USE_BUDDY_SYSTEM) src/mem/slab.c src/mem/vmem_map.c src/mem/zone_allocator.c - src/misc/debug.c src/elf/elf.c src/descriptor_tables/gdt.c src/descriptor_tables/gdt.S diff --git a/mentos/src/boot.c b/mentos/src/boot.c index 73daf91..b4796a2 100644 --- a/mentos/src/boot.c +++ b/mentos/src/boot.c @@ -55,7 +55,7 @@ static inline void __outportb(uint16_t port, uint8_t data) static inline void __debug_putchar(char c) { #if (defined(DEBUG_STDIO) || defined(DEBUG_LOG)) - outportb(SERIAL_COM1, c); + __outportb(SERIAL_COM1, c); #endif } diff --git a/mentos/src/descriptor_tables/exception.c b/mentos/src/descriptor_tables/exception.c index 3d52d2a..1789618 100644 --- a/mentos/src/descriptor_tables/exception.c +++ b/mentos/src/descriptor_tables/exception.c @@ -8,7 +8,7 @@ #include "descriptor_tables/isr.h" #include "descriptor_tables/idt.h" #include "stdio.h" -#include "misc/debug.h" +#include "io/debug.h" // Default error messages for exceptions. static const char *exception_messages[32] = { diff --git a/mentos/src/descriptor_tables/gdt.c b/mentos/src/descriptor_tables/gdt.c index 039a0bc..46a84d5 100644 --- a/mentos/src/descriptor_tables/gdt.c +++ b/mentos/src/descriptor_tables/gdt.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "misc/debug.h" +#include "io/debug.h" #include "descriptor_tables/gdt.h" #include "descriptor_tables/tss.h" diff --git a/mentos/src/descriptor_tables/interrupt.c b/mentos/src/descriptor_tables/interrupt.c index 3780a94..11d6b8f 100644 --- a/mentos/src/descriptor_tables/interrupt.c +++ b/mentos/src/descriptor_tables/interrupt.c @@ -11,7 +11,7 @@ #include "system/printk.h" #include "assert.h" #include "stdio.h" -#include "misc/debug.h" +#include "io/debug.h" #include "descriptor_tables/idt.h" /// @brief Shared interrupt handlers, stored into a double-linked list. diff --git a/mentos/src/descriptor_tables/tss.c b/mentos/src/descriptor_tables/tss.c index d1c0484..867be60 100644 --- a/mentos/src/descriptor_tables/tss.c +++ b/mentos/src/descriptor_tables/tss.c @@ -7,7 +7,7 @@ #include "descriptor_tables/tss.h" #include "string.h" -#include "misc/debug.h" +#include "io/debug.h" #include "descriptor_tables/gdt.h" static tss_entry_t kernel_tss; diff --git a/mentos/src/devices/fpu.c b/mentos/src/devices/fpu.c index 36b3f7a..c48c250 100644 --- a/mentos/src/devices/fpu.c +++ b/mentos/src/devices/fpu.c @@ -6,7 +6,7 @@ #include "devices/fpu.h" #include "descriptor_tables/isr.h" -#include "misc/debug.h" +#include "io/debug.h" #include "string.h" #include "assert.h" #include "process/scheduler.h" diff --git a/mentos/src/devices/pci.c b/mentos/src/devices/pci.c index 578b3d7..116d0e1 100644 --- a/mentos/src/devices/pci.c +++ b/mentos/src/devices/pci.c @@ -6,7 +6,7 @@ ///! @cond Doxygen_Suppress #include "devices/pci.h" -#include "misc/debug.h" +#include "io/debug.h" #include "string.h" #include "io/port_io.h" diff --git a/mentos/src/drivers/ata.c b/mentos/src/drivers/ata.c index c5035b9..02026fe 100644 --- a/mentos/src/drivers/ata.c +++ b/mentos/src/drivers/ata.c @@ -16,7 +16,7 @@ #include "descriptor_tables/isr.h" #include "fs/vfs.h" #include "devices/pci.h" -#include "misc/debug.h" +#include "io/debug.h" #include "mem/kheap.h" #include "assert.h" #include "string.h" diff --git a/mentos/src/drivers/keyboard/keyboard.c b/mentos/src/drivers/keyboard/keyboard.c index af32aef..eb228a4 100644 --- a/mentos/src/drivers/keyboard/keyboard.c +++ b/mentos/src/drivers/keyboard/keyboard.c @@ -13,7 +13,7 @@ #include "drivers/keyboard/keymap.h" #include "sys/bitops.h" #include "io/video.h" -#include "misc/debug.h" +#include "io/debug.h" #include "ctype.h" #include "descriptor_tables/isr.h" #include "process/scheduler.h" diff --git a/mentos/src/elf/elf.c b/mentos/src/elf/elf.c index 77024a2..76a9946 100644 --- a/mentos/src/elf/elf.c +++ b/mentos/src/elf/elf.c @@ -14,7 +14,7 @@ #include "process/process.h" #include "string.h" #include "stddef.h" -#include "misc/debug.h" +#include "io/debug.h" #include "stdio.h" #include "mem/slab.h" #include "fs/vfs.h" diff --git a/mentos/src/fs/initrd.c b/mentos/src/fs/initrd.c index 3b6848d..2c6cb78 100644 --- a/mentos/src/fs/initrd.c +++ b/mentos/src/fs/initrd.c @@ -10,7 +10,7 @@ #include "system/panic.h" #include "fs/vfs.h" #include "sys/errno.h" -#include "misc/debug.h" +#include "io/debug.h" #include "mem/kheap.h" #include "fcntl.h" #include "sys/bitops.h" diff --git a/mentos/src/fs/open.c b/mentos/src/fs/open.c index 9200609..910ce10 100644 --- a/mentos/src/fs/open.c +++ b/mentos/src/fs/open.c @@ -11,7 +11,7 @@ #include "system/syscall.h" #include "string.h" #include "limits.h" -#include "misc/debug.h" +#include "io/debug.h" #include "sys/errno.h" #include "stdio.h" #include "fs/vfs.h" diff --git a/mentos/src/fs/procfs.c b/mentos/src/fs/procfs.c index 2de01e6..ca35656 100644 --- a/mentos/src/fs/procfs.c +++ b/mentos/src/fs/procfs.c @@ -11,7 +11,7 @@ #include "fs/vfs.h" #include "string.h" #include "sys/errno.h" -#include "misc/debug.h" +#include "io/debug.h" #include "fcntl.h" #include "libgen.h" #include "assert.h" diff --git a/mentos/src/fs/stat.c b/mentos/src/fs/stat.c index becfdb1..f1c479f 100644 --- a/mentos/src/fs/stat.c +++ b/mentos/src/fs/stat.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "misc/debug.h" +#include "io/debug.h" #include "sys/errno.h" #include "fs/vfs.h" #include "mem/kheap.h" diff --git a/mentos/src/fs/vfs.c b/mentos/src/fs/vfs.c index f6e310e..46b0516 100644 --- a/mentos/src/fs/vfs.c +++ b/mentos/src/fs/vfs.c @@ -15,7 +15,7 @@ #include "fs/procfs.h" #include "assert.h" #include "libgen.h" -#include "misc/debug.h" +#include "io/debug.h" #include "system/panic.h" #include "stdio.h" diff --git a/mentos/src/hardware/timer.c b/mentos/src/hardware/timer.c index 117c02e..3f043be 100644 --- a/mentos/src/hardware/timer.c +++ b/mentos/src/hardware/timer.c @@ -12,7 +12,7 @@ #include "io/port_io.h" #include "stdint.h" #include "mem/kheap.h" -#include "misc/debug.h" +#include "io/debug.h" #include "process/wait.h" #include "drivers/rtc.h" #include "descriptor_tables/isr.h" diff --git a/mentos/src/io/debug.c b/mentos/src/io/debug.c index c3e2be5..901fc28 100644 --- a/mentos/src/io/debug.c +++ b/mentos/src/io/debug.c @@ -5,7 +5,7 @@ /// See LICENSE.md for details. #include "sys/bitops.h" -#include "misc/debug.h" +#include "io/debug.h" #include "klib/spinlock.h" #include "io/port_io.h" #include "kernel.h" diff --git a/mentos/src/io/proc_running.c b/mentos/src/io/proc_running.c index 916fd70..d2d55fa 100644 --- a/mentos/src/io/proc_running.c +++ b/mentos/src/io/proc_running.c @@ -9,7 +9,7 @@ #include "libgen.h" #include "stdio.h" #include "sys/errno.h" -#include "misc/debug.h" +#include "io/debug.h" #include "process/prio.h" /// @brief Returns the character identifying the process state. diff --git a/mentos/src/io/proc_system.c b/mentos/src/io/proc_system.c index 9e90927..ddd519c 100644 --- a/mentos/src/io/proc_system.c +++ b/mentos/src/io/proc_system.c @@ -10,7 +10,7 @@ #include "string.h" #include "stdio.h" #include "sys/errno.h" -#include "misc/debug.h" +#include "io/debug.h" #include "hardware/timer.h" static ssize_t procs_do_uptime(char *buffer, size_t bufsize); diff --git a/mentos/src/io/proc_video.c b/mentos/src/io/proc_video.c index 8937451..c8e647b 100644 --- a/mentos/src/io/proc_video.c +++ b/mentos/src/io/proc_video.c @@ -8,7 +8,7 @@ #include "bits/ioctls.h" #include "sys/bitops.h" #include "io/video.h" -#include "misc/debug.h" +#include "io/debug.h" #include "sys/errno.h" #include "fcntl.h" #include "fs/vfs.h" diff --git a/mentos/src/io/vga/vga.c b/mentos/src/io/vga/vga.c index 1c2fc1f..179c76b 100644 --- a/mentos/src/io/vga/vga.c +++ b/mentos/src/io/vga/vga.c @@ -7,7 +7,7 @@ #include "io/port_io.h" #include "stdbool.h" #include "string.h" -#include "misc/debug.h" +#include "io/debug.h" #include "math.h" #define COUNT_OF(x) ((sizeof(x) / sizeof(0 [x])) / ((size_t)(!(sizeof(x) % sizeof(0 [x]))))) diff --git a/mentos/src/kernel.c b/mentos/src/kernel.c index 7e40467..20042f6 100644 --- a/mentos/src/kernel.c +++ b/mentos/src/kernel.c @@ -17,7 +17,7 @@ #include "version.h" #include "io/video.h" #include "hardware/pic8259.h" -#include "misc/debug.h" +#include "io/debug.h" #include "drivers/fdc.h" #include "fs/initrd.h" #include "klib/irqflags.h" diff --git a/mentos/src/klib/mutex.c b/mentos/src/klib/mutex.c index 6a921ea..f973381 100644 --- a/mentos/src/klib/mutex.c +++ b/mentos/src/klib/mutex.c @@ -5,7 +5,7 @@ /// See LICENSE.md for details. #include "klib/mutex.h" -#include "misc/debug.h" +#include "io/debug.h" void mutex_lock(mutex_t *mutex, uint32_t owner) { diff --git a/mentos/src/klib/ndtree.c b/mentos/src/klib/ndtree.c index 095d4d8..2097623 100644 --- a/mentos/src/klib/ndtree.c +++ b/mentos/src/klib/ndtree.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "misc/debug.h" +#include "io/debug.h" #include "klib/ndtree.h" #include "assert.h" #include "klib/list_head.h" diff --git a/mentos/src/klib/rbtree.c b/mentos/src/klib/rbtree.c index 7f6abe8..579ae69 100644 --- a/mentos/src/klib/rbtree.c +++ b/mentos/src/klib/rbtree.c @@ -7,7 +7,7 @@ #include "klib/rbtree.h" #include "assert.h" -#include "misc/debug.h" +#include "io/debug.h" #include "mem/slab.h" /// @brief Stores information of a node. diff --git a/mentos/src/klib/time.c b/mentos/src/klib/time.c index 2b97404..85459c2 100644 --- a/mentos/src/klib/time.c +++ b/mentos/src/klib/time.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "misc/debug.h" +#include "io/debug.h" #include "time.h" #include "stdio.h" #include "stddef.h" diff --git a/mentos/src/klib/vscanf.c b/mentos/src/klib/vscanf.c index b811d6b..f9e323e 100644 --- a/mentos/src/klib/vscanf.c +++ b/mentos/src/klib/vscanf.c @@ -7,7 +7,7 @@ #include "fs/vfs.h" #include "ctype.h" #include "string.h" -#include "misc/debug.h" +#include "io/debug.h" #include "stdio.h" static int vsscanf(const char *buf, const char *s, va_list ap) diff --git a/mentos/src/mem/buddysystem.c b/mentos/src/mem/buddysystem.c index 410521d..cf229e4 100644 --- a/mentos/src/mem/buddysystem.c +++ b/mentos/src/mem/buddysystem.c @@ -11,7 +11,7 @@ #include "mem/buddysystem.h" #include "mem/paging.h" #include "assert.h" -#include "misc/debug.h" +#include "io/debug.h" #include "system/panic.h" /// @brief Cache level low limit after which allocation starts. diff --git a/mentos/src/mem/kheap.c b/mentos/src/mem/kheap.c index 6f9ffe0..8a6a91f 100644 --- a/mentos/src/mem/kheap.c +++ b/mentos/src/mem/kheap.c @@ -9,7 +9,7 @@ #include "mem/kheap.h" #include "math.h" -#include "misc/debug.h" +#include "io/debug.h" #include "string.h" #include "mem/paging.h" #include "assert.h" diff --git a/mentos/src/mem/paging.c b/mentos/src/mem/paging.c index 11601dd..c27a292 100644 --- a/mentos/src/mem/paging.c +++ b/mentos/src/mem/paging.c @@ -12,7 +12,7 @@ #include "mem/vmem_map.h" #include "mem/zone_allocator.h" #include "mem/kheap.h" -#include "misc/debug.h" +#include "io/debug.h" #include "assert.h" #include "string.h" #include "system/panic.h" diff --git a/mentos/src/mem/slab.c b/mentos/src/mem/slab.c index 744c374..b530c63 100644 --- a/mentos/src/mem/slab.c +++ b/mentos/src/mem/slab.c @@ -10,7 +10,7 @@ #include "mem/zone_allocator.h" #include "mem/paging.h" #include "assert.h" -#include "misc/debug.h" +#include "io/debug.h" #include "mem/slab.h" /// @brief Use it to manage cached pages. diff --git a/mentos/src/mem/zone_allocator.c b/mentos/src/mem/zone_allocator.c index 5c805d4..22efb92 100644 --- a/mentos/src/mem/zone_allocator.c +++ b/mentos/src/mem/zone_allocator.c @@ -14,7 +14,7 @@ #include "assert.h" #include "mem/paging.h" #include "string.h" -#include "misc/debug.h" +#include "io/debug.h" /// TODO: Comment. #define MIN_PAGE_ALIGN(addr) ((addr) & (~(PAGE_SIZE - 1))) diff --git a/mentos/src/multiboot.c b/mentos/src/multiboot.c index 59f18bc..245b555 100644 --- a/mentos/src/multiboot.c +++ b/mentos/src/multiboot.c @@ -11,7 +11,7 @@ #include "kernel.h" #include "sys/bitops.h" #include "stddef.h" -#include "misc/debug.h" +#include "io/debug.h" #include "system/panic.h" #include "stddef.h" diff --git a/mentos/src/process/process.c b/mentos/src/process/process.c index b2eb124..a947429 100644 --- a/mentos/src/process/process.c +++ b/mentos/src/process/process.c @@ -20,7 +20,7 @@ #include "sys/errno.h" #include "fcntl.h" #include "system/panic.h" -#include "misc/debug.h" +#include "io/debug.h" #include "process/wait.h" #include "process/prio.h" #include "fs/vfs.h" diff --git a/mentos/src/process/scheduler.c b/mentos/src/process/scheduler.c index accfd33..9e874f4 100644 --- a/mentos/src/process/scheduler.c +++ b/mentos/src/process/scheduler.c @@ -17,7 +17,7 @@ #include "process/wait.h" #include "mem/kheap.h" #include "system/panic.h" -#include "misc/debug.h" +#include "io/debug.h" #include "time.h" #include "sys/errno.h" #include "klib/list_head.h" diff --git a/mentos/src/process/scheduler_algorithm.c b/mentos/src/process/scheduler_algorithm.c index 9eec80b..1eb3667 100644 --- a/mentos/src/process/scheduler_algorithm.c +++ b/mentos/src/process/scheduler_algorithm.c @@ -6,7 +6,7 @@ #include "hardware/timer.h" #include "process/prio.h" -#include "misc/debug.h" +#include "io/debug.h" #include "assert.h" #include "klib/list_head.h" #include "process/wait.h" diff --git a/mentos/src/sys/module.c b/mentos/src/sys/module.c index 88d8b7b..b090dec 100644 --- a/mentos/src/sys/module.c +++ b/mentos/src/sys/module.c @@ -8,7 +8,7 @@ #include "sys/module.h" #include "string.h" #include "sys/bitops.h" -#include "misc/debug.h" +#include "io/debug.h" /// Defined in kernel.ld, points at the end of kernel's data segment. extern void *_kernel_end; diff --git a/mentos/src/sys/utsname.c b/mentos/src/sys/utsname.c index 9a10dc2..ebb62d8 100644 --- a/mentos/src/sys/utsname.c +++ b/mentos/src/sys/utsname.c @@ -7,7 +7,7 @@ #include "string.h" #include "sys/utsname.h" #include "version.h" -#include "misc/debug.h" +#include "io/debug.h" #include "sys/errno.h" #include "fcntl.h" #include "fs/vfs.h" diff --git a/mentos/src/system/panic.c b/mentos/src/system/panic.c index 6693357..116e198 100644 --- a/mentos/src/system/panic.c +++ b/mentos/src/system/panic.c @@ -5,7 +5,7 @@ /// See LICENSE.md for details. #include "system/panic.h" -#include "misc/debug.h" +#include "io/debug.h" void kernel_panic(const char *msg) { diff --git a/mentos/src/system/signal.c b/mentos/src/system/signal.c index dfc8f7e..9c133b8 100644 --- a/mentos/src/system/signal.c +++ b/mentos/src/system/signal.c @@ -13,7 +13,7 @@ #include "process/process.h" #include "sys/errno.h" #include "assert.h" -#include "misc/debug.h" +#include "io/debug.h" #include "string.h" #include "klib/irqflags.h"