From 18a2fd9baac58e3cefc83bcfd8bd5c2d82038366 Mon Sep 17 00:00:00 2001 From: Enrico Fraccaroli Date: Tue, 5 Oct 2021 14:29:24 +0200 Subject: [PATCH] Force includes to use absolute paths. --- mentos/CMakeLists.txt | 27 +--- mentos/inc/bits/ioctls.h | 9 -- mentos/inc/bits/termios-struct.h | 45 ------ mentos/inc/elf/elf.h | 2 +- mentos/inc/fs/procfs.h | 2 +- mentos/inc/fs/vfs.h | 4 +- mentos/inc/fs/vfs_types.h | 2 +- mentos/inc/hardware/timer.h | 6 +- mentos/inc/io/proc_modules.h | 2 +- mentos/inc/klib/hashmap.h | 2 +- mentos/inc/klib/spinlock.h | 2 +- mentos/inc/klib/stdatomic.h | 2 +- mentos/inc/mem/kheap.h | 2 +- mentos/inc/mem/paging.h | 2 +- mentos/inc/mem/slab.h | 4 +- mentos/inc/mem/vmem_map.h | 6 +- mentos/inc/mem/zone_allocator.h | 10 +- mentos/inc/misc/debug.h | 2 +- mentos/inc/process/process.h | 6 +- mentos/inc/process/scheduler.h | 4 +- mentos/inc/process/wait.h | 4 +- mentos/inc/system/signal.h | 8 +- mentos/inc/system/syscall.h | 6 +- mentos/inc/system/syscall_types.h | 197 ----------------------- mentos/src/boot.c | 6 +- mentos/src/descriptor_tables/exception.c | 8 +- mentos/src/descriptor_tables/gdt.c | 6 +- mentos/src/descriptor_tables/idt.c | 6 +- mentos/src/descriptor_tables/interrupt.c | 12 +- mentos/src/descriptor_tables/tss.c | 6 +- mentos/src/devices/fpu.c | 12 +- mentos/src/devices/pci.c | 6 +- mentos/src/drivers/ata.c | 22 +-- mentos/src/drivers/fdc.c | 6 +- mentos/src/drivers/keyboard/keyboard.c | 16 +- mentos/src/drivers/keyboard/keymap.c | 2 +- mentos/src/drivers/mouse.c | 6 +- mentos/src/drivers/rtc.c | 8 +- mentos/src/elf/elf.c | 14 +- mentos/src/fs/initrd.c | 12 +- mentos/src/fs/ioctl.c | 10 +- mentos/src/fs/namei.c | 6 +- mentos/src/fs/open.c | 8 +- mentos/src/fs/procfs.c | 8 +- mentos/src/fs/read_write.c | 10 +- mentos/src/fs/readdir.c | 10 +- mentos/src/fs/stat.c | 10 +- mentos/src/fs/vfs.c | 16 +- mentos/src/hardware/cpuid.c | 2 +- mentos/src/hardware/pic8259.c | 4 +- mentos/src/hardware/timer.c | 26 +-- mentos/src/io/mm_io.c | 2 +- mentos/src/io/port_io.c | 2 +- mentos/src/io/proc_running.c | 10 +- mentos/src/io/proc_system.c | 10 +- mentos/src/io/proc_video.c | 16 +- mentos/src/io/stdio.c | 8 +- mentos/src/io/vga/vga.c | 12 +- mentos/src/io/video.c | 4 +- mentos/src/ipc/msg.c | 2 +- mentos/src/ipc/sem.c | 2 +- mentos/src/ipc/shm.c | 2 +- mentos/src/kernel.c | 48 +++--- mentos/src/kernel/sys.c | 8 +- mentos/src/klib/assert.c | 2 +- mentos/src/klib/hashmap.c | 4 +- mentos/src/klib/libgen.c | 6 +- mentos/src/klib/list.c | 4 +- mentos/src/klib/mutex.c | 4 +- mentos/src/klib/ndtree.c | 8 +- mentos/src/klib/rbtree.c | 6 +- mentos/src/klib/spinlock.c | 2 +- mentos/src/klib/string.c | 2 +- mentos/src/klib/time.c | 8 +- mentos/src/klib/vscanf.c | 4 +- mentos/src/klib/vsprintf.c | 2 +- mentos/src/mem/buddysystem.c | 8 +- mentos/src/mem/kheap.c | 8 +- mentos/src/mem/paging.c | 14 +- mentos/src/mem/slab.c | 8 +- mentos/src/mem/vmem_map.c | 4 +- mentos/src/mem/zone_allocator.c | 10 +- mentos/src/misc/debug.c | 8 +- mentos/src/multiboot.c | 4 +- mentos/src/process/process.c | 22 +-- mentos/src/process/scheduler.c | 26 +-- mentos/src/process/scheduler_algorithm.c | 12 +- mentos/src/process/wait.c | 2 +- mentos/src/sys/module.c | 6 +- mentos/src/sys/utsname.c | 8 +- mentos/src/system/errno.c | 4 +- mentos/src/system/panic.c | 4 +- mentos/src/system/printk.c | 4 +- mentos/src/system/signal.c | 14 +- mentos/src/system/syscall.c | 20 +-- 95 files changed, 351 insertions(+), 627 deletions(-) delete mode 100644 mentos/inc/bits/ioctls.h delete mode 100644 mentos/inc/bits/termios-struct.h delete mode 100644 mentos/inc/system/syscall_types.h diff --git a/mentos/CMakeLists.txt b/mentos/CMakeLists.txt index 78e3ec6..3dd47a5 100644 --- a/mentos/CMakeLists.txt +++ b/mentos/CMakeLists.txt @@ -134,32 +134,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL "Debug") # ============================================================================= # Add the includes. -include_directories( - inc - inc/bits - inc/descriptor_tables - inc/devices - inc/drivers - inc/drivers/keyboard - inc/fs - inc/hardware - inc/io - inc/io/vga - inc/ipc - inc/kernel - inc/klib - inc/lng - inc/mem - inc/misc - inc/sys - inc/system - inc/process - inc/elf - inc/ui - inc/ui/shell - inc/ui/command - inc/ui/init - ../libc/inc) +include_directories(inc ../libc/inc) # ============================================================================= # Add kernel library. diff --git a/mentos/inc/bits/ioctls.h b/mentos/inc/bits/ioctls.h deleted file mode 100644 index c872a26..0000000 --- a/mentos/inc/bits/ioctls.h +++ /dev/null @@ -1,9 +0,0 @@ -/// MentOS, The Mentoring Operating system project -/// @file ioctls.h -/// @brief Definitions of tty ioctl numbers. 0x54 is just a magic number to make these -/// relatively unique ('T') - -#pragma once - -#define TCGETS 0x5401U ///< Get the current serial port settings. -#define TCSETS 0x5402U ///< Set the current serial port settings. diff --git a/mentos/inc/bits/termios-struct.h b/mentos/inc/bits/termios-struct.h deleted file mode 100644 index a54adbc..0000000 --- a/mentos/inc/bits/termios-struct.h +++ /dev/null @@ -1,45 +0,0 @@ -/// MentOS, The Mentoring Operating system project -/// @file termios-struct.h -/// @brief -/// Copyright (c) 2014-2021 This file is distributed under the MIT License. -/// See LICENSE.md for details. - -#pragma once - -/// Type for control characters. -typedef unsigned char cc_t; -/// Type for speed. -typedef unsigned int speed_t; -/// Type for flags. -typedef unsigned int tcflag_t; -/// The number of control characters. -#define NCCS 32 - -/// @brief Stores information about a terminal IOs. -typedef struct termios { - tcflag_t c_iflag; ///< input mode flags - tcflag_t c_oflag; ///< output mode flags - tcflag_t c_cflag; ///< control mode flags - tcflag_t c_lflag; ///< local mode flags - cc_t c_line; ///< line discipline - cc_t c_cc[NCCS]; ///< control characters - speed_t c_ispeed; ///< input speed - speed_t c_ospeed; ///< output speed -} termios; - -/// @brief These flags generally control higher-level aspects of input processing than the input -/// modes flags described in Input Modes, such as echoing, signals, and the choice of canonical -/// or noncanonical input. -enum { - ISIG = 000001U, ///< Controls whether the INTR, QUIT, and SUSP characters are recognized. - ICANON = 000002U, ///< Enables canonical input processing mode. - ECHO = 000010U, ///< Echo input characters. - ECHOE = 000020U, ///< If ICANON is set, the ERASE character erases the preceding character. - ECHOK = 000040U, ///< If ICANON is set, the KILL character erases the current line. - ECHONL = 000100U, ///< If ICANON is set, echo the NL character even if ECHO is not set. - NOFLSH = 000200U, ///< Do not clear in/out queues when receiving INTR, QUIT, and SUSP. - TOSTOP = 000400U, ///< Allows SIGTTOU signals generated by background processes. - ECHOCTL = 001000U, ///< If this and ECHO are set, control characters with ‘^’ are echoed. - ECHOKE = 004000U, ///< If ICANON is set, KILL is echoed by erasing each character on the line. - IEXTEN = 100000U, ///< Enables implementation-defined input processing. -}; \ No newline at end of file diff --git a/mentos/inc/elf/elf.h b/mentos/inc/elf/elf.h index 44ba0b3..af303ea 100644 --- a/mentos/inc/elf/elf.h +++ b/mentos/inc/elf/elf.h @@ -6,7 +6,7 @@ #pragma once -#include "process.h" +#include "process/process.h" #include "stdint.h" /// @defgroup header_segment_types Program Header Segment Types diff --git a/mentos/inc/fs/procfs.h b/mentos/inc/fs/procfs.h index 68afcab..039e9d9 100644 --- a/mentos/inc/fs/procfs.h +++ b/mentos/inc/fs/procfs.h @@ -6,7 +6,7 @@ #pragma once -#include "process.h" +#include "process/process.h" /// @brief Stores information about a procfs directory entry. typedef struct proc_dir_entry_t { diff --git a/mentos/inc/fs/vfs.h b/mentos/inc/fs/vfs.h index c5ef6a1..1a2a5e1 100644 --- a/mentos/inc/fs/vfs.h +++ b/mentos/inc/fs/vfs.h @@ -6,8 +6,8 @@ #pragma once -#include "vfs_types.h" -#include "slab.h" +#include "fs/vfs_types.h" +#include "mem/slab.h" #define MAX_OPEN_FD 16 ///< Maximum number of opened file. diff --git a/mentos/inc/fs/vfs_types.h b/mentos/inc/fs/vfs_types.h index ba47810..4e9893e 100644 --- a/mentos/inc/fs/vfs_types.h +++ b/mentos/inc/fs/vfs_types.h @@ -6,7 +6,7 @@ #pragma once -#include "list_head.h" +#include "klib/list_head.h" #include "sys/dirent.h" #include "bits/stat.h" #include "stdint.h" diff --git a/mentos/inc/hardware/timer.h b/mentos/inc/hardware/timer.h index 459fe61..0faa231 100644 --- a/mentos/inc/hardware/timer.h +++ b/mentos/inc/hardware/timer.h @@ -8,9 +8,9 @@ #include "kernel.h" #include "stdint.h" -#include "list_head.h" -#include "spinlock.h" -#include "process.h" +#include "klib/list_head.h" +#include "klib/spinlock.h" +#include "process/process.h" #include "time.h" /// This enables the dynamic timer system use an hierarchical timing wheel, diff --git a/mentos/inc/io/proc_modules.h b/mentos/inc/io/proc_modules.h index 5725d6c..6dbd4a2 100644 --- a/mentos/inc/io/proc_modules.h +++ b/mentos/inc/io/proc_modules.h @@ -6,7 +6,7 @@ #pragma once -#include "vfs.h" +#include "fs/vfs.h" /// @brief Initialize the procfs video files. /// @return 0 on success, 1 on failure. diff --git a/mentos/inc/klib/hashmap.h b/mentos/inc/klib/hashmap.h index 37e2c44..392a0a3 100644 --- a/mentos/inc/klib/hashmap.h +++ b/mentos/inc/klib/hashmap.h @@ -6,7 +6,7 @@ #pragma once -#include "list.h" +#include "klib/list.h" // == OPAQUE TYPES ============================================================ /// @brief Stores information of an entry of the hashmap. diff --git a/mentos/inc/klib/spinlock.h b/mentos/inc/klib/spinlock.h index 792661c..f9f3c4d 100644 --- a/mentos/inc/klib/spinlock.h +++ b/mentos/inc/klib/spinlock.h @@ -6,7 +6,7 @@ #pragma once -#include "stdatomic.h" +#include "klib/stdatomic.h" /// Determines if the spinlock is free. #define SPINLOCK_FREE 0 diff --git a/mentos/inc/klib/stdatomic.h b/mentos/inc/klib/stdatomic.h index 78fca83..03234d4 100644 --- a/mentos/inc/klib/stdatomic.h +++ b/mentos/inc/klib/stdatomic.h @@ -8,7 +8,7 @@ #include "stdint.h" #include "stdbool.h" -#include "compiler.h" +#include "klib/compiler.h" /// @brief Standard structure for atomic operations (see below /// for volatile explanation). diff --git a/mentos/inc/mem/kheap.h b/mentos/inc/mem/kheap.h index c3f38d3..309b74f 100644 --- a/mentos/inc/mem/kheap.h +++ b/mentos/inc/mem/kheap.h @@ -8,7 +8,7 @@ #pragma once #include "kernel.h" -#include "scheduler.h" +#include "process/scheduler.h" /// @brief Initialize heap. /// @param initial_size Starting size. diff --git a/mentos/inc/mem/paging.h b/mentos/inc/mem/paging.h index f9e25f3..1298602 100644 --- a/mentos/inc/mem/paging.h +++ b/mentos/inc/mem/paging.h @@ -6,7 +6,7 @@ #pragma once -#include "zone_allocator.h" +#include "mem/zone_allocator.h" #include "proc_access.h" #include "kernel.h" #include "stddef.h" diff --git a/mentos/inc/mem/slab.h b/mentos/inc/mem/slab.h index 8894278..5d99ea1 100644 --- a/mentos/inc/mem/slab.h +++ b/mentos/inc/mem/slab.h @@ -6,9 +6,9 @@ #pragma once -#include "list_head.h" +#include "klib/list_head.h" #include "stddef.h" -#include "gfp.h" +#include "mem/gfp.h" //#define ENABLE_CACHE_TRACE //#define ENABLE_ALLOC_TRACE diff --git a/mentos/inc/mem/vmem_map.h b/mentos/inc/mem/vmem_map.h index 1bd11dc..b8e65b6 100644 --- a/mentos/inc/mem/vmem_map.h +++ b/mentos/inc/mem/vmem_map.h @@ -6,9 +6,9 @@ #pragma once -#include "buddysystem.h" -#include "zone_allocator.h" -#include "paging.h" +#include "mem/buddysystem.h" +#include "mem/zone_allocator.h" +#include "mem/paging.h" /// Size of the virtual memory. #define VIRTUAL_MEMORY_SIZE_MB 128 diff --git a/mentos/inc/mem/zone_allocator.h b/mentos/inc/mem/zone_allocator.h index 8febc9f..8fb57a5 100644 --- a/mentos/inc/mem/zone_allocator.h +++ b/mentos/inc/mem/zone_allocator.h @@ -6,15 +6,15 @@ #pragma once -#include "gfp.h" +#include "mem/gfp.h" #include "math.h" #include "stdint.h" -#include "list_head.h" +#include "klib/list_head.h" #include "sys/bitops.h" -#include "stdatomic.h" +#include "klib/stdatomic.h" #include "boot.h" -#include "buddysystem.h" -#include "slab.h" +#include "mem/buddysystem.h" +#include "mem/slab.h" #define page_count(p) atomic_read(&(p)->count) ///< Reads the page count. #define set_page_count(p, v) atomic_set(&(p)->count, v) ///< Sets the page count. diff --git a/mentos/inc/misc/debug.h b/mentos/inc/misc/debug.h index 85060d8..60ca043 100644 --- a/mentos/inc/misc/debug.h +++ b/mentos/inc/misc/debug.h @@ -6,7 +6,7 @@ #pragma once -#include "kernel_levels.h" +#include "sys/kernel_levels.h" struct pt_regs; diff --git a/mentos/inc/process/process.h b/mentos/inc/process/process.h index a647f8b..39a455d 100644 --- a/mentos/inc/process/process.h +++ b/mentos/inc/process/process.h @@ -6,9 +6,9 @@ #pragma once -#include "paging.h" -#include "signal.h" -#include "fpu.h" +#include "mem/paging.h" +#include "system/signal.h" +#include "devices/fpu.h" /// The maximum length of a name for a task_struct. #define TASK_NAME_MAX_LENGTH 100 diff --git a/mentos/inc/process/scheduler.h b/mentos/inc/process/scheduler.h index 5e7ded6..1fc6596 100644 --- a/mentos/inc/process/scheduler.h +++ b/mentos/inc/process/scheduler.h @@ -6,8 +6,8 @@ #pragma once -#include "list_head.h" -#include "process.h" +#include "klib/list_head.h" +#include "process/process.h" #include "stddef.h" /// @brief Structure that contains information about live processes. diff --git a/mentos/inc/process/wait.h b/mentos/inc/process/wait.h index 4a6430f..05afbba 100644 --- a/mentos/inc/process/wait.h +++ b/mentos/inc/process/wait.h @@ -6,8 +6,8 @@ #pragma once -#include "list_head.h" -#include "spinlock.h" +#include "klib/list_head.h" +#include "klib/spinlock.h" /// @brief Return immediately if no child is there to be waited for. #define WNOHANG 0x00000001 diff --git a/mentos/inc/system/signal.h b/mentos/inc/system/signal.h index 249c874..4e360b1 100644 --- a/mentos/inc/system/signal.h +++ b/mentos/inc/system/signal.h @@ -6,10 +6,10 @@ #pragma once -#include "stdatomic.h" -#include "spinlock.h" -#include "list_head.h" -#include "syscall.h" +#include "klib/stdatomic.h" +#include "klib/spinlock.h" +#include "klib/list_head.h" +#include "system/syscall.h" /// @brief Signal codes. typedef enum { diff --git a/mentos/inc/system/syscall.h b/mentos/inc/system/syscall.h index 98747e9..f52ccde 100644 --- a/mentos/inc/system/syscall.h +++ b/mentos/inc/system/syscall.h @@ -6,11 +6,11 @@ #pragma once -#include "syscall_types.h" -#include "vfs_types.h" +#include "system/syscall_types.h" +#include "fs/vfs_types.h" #include "kernel.h" #include "sys/dirent.h" -#include "types.h" +#include "sys/types.h" /// @brief Initialize the system calls. void syscall_init(); diff --git a/mentos/inc/system/syscall_types.h b/mentos/inc/system/syscall_types.h deleted file mode 100644 index cd2bf69..0000000 --- a/mentos/inc/system/syscall_types.h +++ /dev/null @@ -1,197 +0,0 @@ -/// MentOS, The Mentoring Operating system project -/// @file syscall_types.h -/// @brief System Call numbers. -/// @copyright (c) 2014-2021 This file is distributed under the MIT License. -/// See LICENSE.md for details. - -#pragma once - -#define __NR_exit 1 ///< System-call number for `exit` -#define __NR_fork 2 ///< System-call number for `fork` -#define __NR_read 3 ///< System-call number for `read` -#define __NR_write 4 ///< System-call number for `write` -#define __NR_open 5 ///< System-call number for `open` -#define __NR_close 6 ///< System-call number for `close` -#define __NR_waitpid 7 ///< System-call number for `waitpid` -#define __NR_creat 8 ///< System-call number for `creat` -#define __NR_link 9 ///< System-call number for `link` -#define __NR_unlink 10 ///< System-call number for `unlink` -#define __NR_execve 11 ///< System-call number for `execve` -#define __NR_chdir 12 ///< System-call number for `chdir` -#define __NR_time 13 ///< System-call number for `time` -#define __NR_mknod 14 ///< System-call number for `mknod` -#define __NR_chmod 15 ///< System-call number for `chmod` -#define __NR_lchown 16 ///< System-call number for `lchown` -#define __NR_stat 18 ///< System-call number for `stat` -#define __NR_lseek 19 ///< System-call number for `lseek` -#define __NR_getpid 20 ///< System-call number for `getpid` -#define __NR_mount 21 ///< System-call number for `mount` -#define __NR_oldumount 22 ///< System-call number for `oldumount` -#define __NR_setuid 23 ///< System-call number for `setuid` -#define __NR_getuid 24 ///< System-call number for `getuid` -#define __NR_stime 25 ///< System-call number for `stime` -#define __NR_ptrace 26 ///< System-call number for `ptrace` -#define __NR_alarm 27 ///< System-call number for `alarm` -#define __NR_fstat 28 ///< System-call number for `fstat` -#define __NR_pause 29 ///< System-call number for `pause` -#define __NR_utime 30 ///< System-call number for `utime` -#define __NR_access 33 ///< System-call number for `access` -#define __NR_nice 34 ///< System-call number for `nice` -#define __NR_sync 36 ///< System-call number for `sync` -#define __NR_kill 37 ///< System-call number for `kill` -#define __NR_rename 38 ///< System-call number for `rename` -#define __NR_mkdir 39 ///< System-call number for `mkdir` -#define __NR_rmdir 40 ///< System-call number for `rmdir` -#define __NR_dup 41 ///< System-call number for `dup` -#define __NR_pipe 42 ///< System-call number for `pipe` -#define __NR_times 43 ///< System-call number for `times` -#define __NR_brk 45 ///< System-call number for `brk` -#define __NR_setgid 46 ///< System-call number for `setgid` -#define __NR_getgid 47 ///< System-call number for `getgid` -#define __NR_signal 48 ///< System-call number for `signal` -#define __NR_geteuid 49 ///< System-call number for `geteuid` -#define __NR_getegid 50 ///< System-call number for `getegid` -#define __NR_acct 51 ///< System-call number for `acct` -#define __NR_umount 52 ///< System-call number for `umount` -#define __NR_ioctl 54 ///< System-call number for `ioctl` -#define __NR_fcntl 55 ///< System-call number for `fcntl` -#define __NR_setpgid 57 ///< System-call number for `setpgid` -#define __NR_olduname 59 ///< System-call number for `olduname` -#define __NR_umask 60 ///< System-call number for `umask` -#define __NR_chroot 61 ///< System-call number for `chroot` -#define __NR_ustat 62 ///< System-call number for `ustat` -#define __NR_dup2 63 ///< System-call number for `dup2` -#define __NR_getppid 64 ///< System-call number for `getppid` -#define __NR_getpgrp 65 ///< System-call number for `getpgrp` -#define __NR_setsid 66 ///< System-call number for `setsid` -#define __NR_sigaction 67 ///< System-call number for `sigaction` -#define __NR_sgetmask 68 ///< System-call number for `sgetmask` -#define __NR_ssetmask 69 ///< System-call number for `ssetmask` -#define __NR_setreuid 70 ///< System-call number for `setreuid` -#define __NR_setregid 71 ///< System-call number for `setregid` -#define __NR_sigsuspend 72 ///< System-call number for `sigsuspend` -#define __NR_sigpending 73 ///< System-call number for `sigpending` -#define __NR_sethostname 74 ///< System-call number for `sethostname` -#define __NR_setrlimit 75 ///< System-call number for `setrlimit` -#define __NR_getrlimit 76 ///< System-call number for `getrlimit` -#define __NR_getrusage 77 ///< System-call number for `getrusage` -#define __NR_gettimeofday 78 ///< System-call number for `gettimeofday` -#define __NR_settimeofday 79 ///< System-call number for `settimeofday` -#define __NR_getgroups 80 ///< System-call number for `getgroups` -#define __NR_setgroups 81 ///< System-call number for `setgroups` -#define __NR_symlink 83 ///< System-call number for `symlink` -#define __NR_lstat 84 ///< System-call number for `lstat` -#define __NR_readlink 85 ///< System-call number for `readlink` -#define __NR_uselib 86 ///< System-call number for `uselib` -#define __NR_swapon 87 ///< System-call number for `swapon` -#define __NR_reboot 88 ///< System-call number for `reboot` -#define __NR_readdir 89 ///< System-call number for `readdir` -#define __NR_mmap 90 ///< System-call number for `mmap` -#define __NR_munmap 91 ///< System-call number for `munmap` -#define __NR_truncate 92 ///< System-call number for `truncate` -#define __NR_ftruncate 93 ///< System-call number for `ftruncate` -#define __NR_fchmod 94 ///< System-call number for `fchmod` -#define __NR_fchown 95 ///< System-call number for `fchown` -#define __NR_getpriority 96 ///< System-call number for `getpriority` -#define __NR_setpriority 97 ///< System-call number for `setpriority` -#define __NR_statfs 99 ///< System-call number for `statfs` -#define __NR_fstatfs 100 ///< System-call number for `fstatfs` -#define __NR_ioperm 101 ///< System-call number for `ioperm` -#define __NR_socketcall 102 ///< System-call number for `socketcall` -#define __NR_syslog 103 ///< System-call number for `syslog` -#define __NR_setitimer 104 ///< System-call number for `setitimer` -#define __NR_getitimer 105 ///< System-call number for `getitimer` -#define __NR_newstat 106 ///< System-call number for `newstat` -#define __NR_newlstat 107 ///< System-call number for `newlstat` -#define __NR_newfstat 108 ///< System-call number for `newfstat` -#define __NR_uname 109 ///< System-call number for `uname` -#define __NR_iopl 110 ///< System-call number for `iopl` -#define __NR_vhangup 111 ///< System-call number for `vhangup` -#define __NR_idle 112 ///< System-call number for `idle` -#define __NR_vm86old 113 ///< System-call number for `vm86old` -#define __NR_wait4 114 ///< System-call number for `wait4` -#define __NR_swapoff 115 ///< System-call number for `swapoff` -#define __NR_sysinfo 116 ///< System-call number for `sysinfo` -#define __NR_ipc 117 ///< System-call number for `ipc` -#define __NR_fsync 118 ///< System-call number for `fsync` -#define __NR_sigreturn 119 ///< System-call number for `sigreturn` -#define __NR_clone 120 ///< System-call number for `clone` -#define __NR_setdomainname 121 ///< System-call number for `setdomainname` -#define __NR_newuname 122 ///< System-call number for `newuname` -#define __NR_modify_ldt 123 ///< System-call number for `modify_ldt` -#define __NR_adjtimex 124 ///< System-call number for `adjtimex` -#define __NR_mprotect 125 ///< System-call number for `mprotect` -#define __NR_sigprocmask 126 ///< System-call number for `sigprocmask` -#define __NR_create_module 127 ///< System-call number for `create_module` -#define __NR_init_module 128 ///< System-call number for `init_module` -#define __NR_delete_module 129 ///< System-call number for `delete_module` -#define __NR_get_kernel_syms 130 ///< System-call number for `get_kernel_syms` -#define __NR_quotactl 131 ///< System-call number for `quotactl` -#define __NR_getpgid 132 ///< System-call number for `getpgid` -#define __NR_fchdir 133 ///< System-call number for `fchdir` -#define __NR_bdflush 134 ///< System-call number for `bdflush` -#define __NR_sysfs 135 ///< System-call number for `sysfs` -#define __NR_personality 136 ///< System-call number for `personality` -#define __NR_setfsuid 138 ///< System-call number for `setfsuid` -#define __NR_setfsgid 139 ///< System-call number for `setfsgid` -#define __NR_llseek 140 ///< System-call number for `llseek` -#define __NR_getdents 141 ///< System-call number for `getdents` -#define __NR_select 142 ///< System-call number for `select` -#define __NR_flock 143 ///< System-call number for `flock` -#define __NR_msync 144 ///< System-call number for `msync` -#define __NR_readv 145 ///< System-call number for `readv` -#define __NR_writev 146 ///< System-call number for `writev` -#define __NR_getsid 147 ///< System-call number for `getsid` -#define __NR_fdatasync 148 ///< System-call number for `fdatasync` -#define __NR_sysctl 149 ///< System-call number for `sysctl` -#define __NR_mlock 150 ///< System-call number for `mlock` -#define __NR_munlock 151 ///< System-call number for `munlock` -#define __NR_mlockall 152 ///< System-call number for `mlockall` -#define __NR_munlockall 153 ///< System-call number for `munlockall` -#define __NR_sched_setparam 154 ///< System-call number for `sched_setparam` -#define __NR_sched_getparam 155 ///< System-call number for `sched_getparam` -#define __NR_sched_setscheduler 156 ///< System-call number for `sched_setscheduler` -#define __NR_sched_getscheduler 157 ///< System-call number for `sched_getscheduler` -#define __NR_sched_yield 158 ///< System-call number for `sched_yield` -#define __NR_sched_get_priority_max 159 ///< System-call number for `sched_get_priority_max` -#define __NR_sched_get_priority_min 160 ///< System-call number for `sched_get_priority_min` -#define __NR_sched_rr_get_interval 161 ///< System-call number for `sched_rr_get_interval` -#define __NR_nanosleep 162 ///< System-call number for `nanosleep` -#define __NR_mremap 163 ///< System-call number for `mremap` -#define __NR_setresuid 164 ///< System-call number for `setresuid` -#define __NR_getresuid 165 ///< System-call number for `getresuid` -#define __NR_vm86 166 ///< System-call number for `vm86` -#define __NR_query_module 167 ///< System-call number for `query_module` -#define __NR_poll 168 ///< System-call number for `poll` -#define __NR_nfsservctl 169 ///< System-call number for `nfsservctl` -#define __NR_setresgid 170 ///< System-call number for `setresgid` -#define __NR_getresgid 171 ///< System-call number for `getresgid` -#define __NR_prctl 172 ///< System-call number for `prctl` -#define __NR_rt_sigreturn 173 ///< System-call number for `rt_sigreturn` -#define __NR_rt_sigaction 174 ///< System-call number for `rt_sigaction` -#define __NR_rt_sigprocmask 175 ///< System-call number for `rt_sigprocmask` -#define __NR_rt_sigpending 176 ///< System-call number for `rt_sigpending` -#define __NR_rt_sigtimedwait 177 ///< System-call number for `rt_sigtimedwait` -#define __NR_rt_sigqueueinfo 178 ///< System-call number for `rt_sigqueueinfo` -#define __NR_rt_sigsuspend 179 ///< System-call number for `rt_sigsuspend` -#define __NR_pread 180 ///< System-call number for `pread` -#define __NR_pwrite 181 ///< System-call number for `pwrite` -#define __NR_chown 182 ///< System-call number for `chown` -#define __NR_getcwd 183 ///< System-call number for `getcwd` -#define __NR_capget 184 ///< System-call number for `capget` -#define __NR_capset 185 ///< System-call number for `capset` -#define __NR_sigaltstack 186 ///< System-call number for `sigaltstack` -#define __NR_sendfile 187 ///< System-call number for `sendfile` -#define __NR_waitperiod 188 ///< System-call number for `waitperiod` -#define __NR_msgctl 189 ///< System-call number for `msgctl` -#define __NR_msgget 190 ///< System-call number for `msgget` -#define __NR_msgrcv 191 ///< System-call number for `msgrcv` -#define __NR_msgsnd 192 ///< System-call number for `msgsnd` -#define __NR_semctl 193 ///< System-call number for `semctl` -#define __NR_semget 194 ///< System-call number for `semget` -#define __NR_semop 195 ///< System-call number for `semop` -#define __NR_shmat 196 ///< System-call number for `shmat` -#define __NR_shmctl 197 ///< System-call number for `shmctl` -#define __NR_shmdt 198 ///< System-call number for `shmdt` -#define __NR_shmget 199 ///< System-call number for `shmget` -#define SYSCALL_NUMBER 200 ///< The total number of system-calls. diff --git a/mentos/src/boot.c b/mentos/src/boot.c index 1f7973e..aad9189 100644 --- a/mentos/src/boot.c +++ b/mentos/src/boot.c @@ -6,10 +6,10 @@ #include "link_access.h" #include "multiboot.h" -#include "paging.h" -#include "module.h" +#include "mem/paging.h" +#include "sys/module.h" #include "stdint.h" -#include "elf.h" +#include "elf/elf.h" /// @defgroup bootloader Bootloader /// @brief Set of functions and variables for booting the kernel. diff --git a/mentos/src/descriptor_tables/exception.c b/mentos/src/descriptor_tables/exception.c index 00e1c13..571790a 100644 --- a/mentos/src/descriptor_tables/exception.c +++ b/mentos/src/descriptor_tables/exception.c @@ -4,11 +4,11 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "panic.h" -#include "isr.h" -#include "idt.h" +#include "system/panic.h" +#include "descriptor_tables/isr.h" +#include "descriptor_tables/idt.h" #include "stdio.h" -#include "debug.h" +#include "misc/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 8e359e2..039a0bc 100644 --- a/mentos/src/descriptor_tables/gdt.c +++ b/mentos/src/descriptor_tables/gdt.c @@ -4,9 +4,9 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "debug.h" -#include "gdt.h" -#include "tss.h" +#include "misc/debug.h" +#include "descriptor_tables/gdt.h" +#include "descriptor_tables/tss.h" /// The maximum dimension of the GDT. #define GDT_SIZE 10 diff --git a/mentos/src/descriptor_tables/idt.c b/mentos/src/descriptor_tables/idt.c index 207aa42..a4ae9de 100644 --- a/mentos/src/descriptor_tables/idt.c +++ b/mentos/src/descriptor_tables/idt.c @@ -4,9 +4,9 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "idt.h" -#include "gdt.h" -#include "isr.h" +#include "descriptor_tables/idt.h" +#include "descriptor_tables/gdt.h" +#include "descriptor_tables/isr.h" /// @brief This function is in idt.asm. /// @param idt_pointer Address of the idt. diff --git a/mentos/src/descriptor_tables/interrupt.c b/mentos/src/descriptor_tables/interrupt.c index 2788a68..8b67c91 100644 --- a/mentos/src/descriptor_tables/interrupt.c +++ b/mentos/src/descriptor_tables/interrupt.c @@ -4,15 +4,15 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "isr.h" +#include "descriptor_tables/isr.h" -#include "scheduler.h" -#include "pic8259.h" -#include "printk.h" +#include "process/scheduler.h" +#include "hardware/pic8259.h" +#include "system/printk.h" #include "assert.h" #include "stdio.h" -#include "debug.h" -#include "idt.h" +#include "misc/debug.h" +#include "descriptor_tables/idt.h" /// @brief Shared interrupt handlers, stored into a double-linked list. typedef struct irq_struct_t { diff --git a/mentos/src/descriptor_tables/tss.c b/mentos/src/descriptor_tables/tss.c index a6aefd3..d1c0484 100644 --- a/mentos/src/descriptor_tables/tss.c +++ b/mentos/src/descriptor_tables/tss.c @@ -4,11 +4,11 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "tss.h" +#include "descriptor_tables/tss.h" #include "string.h" -#include "debug.h" -#include "gdt.h" +#include "misc/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 44dc693..36b3f7a 100644 --- a/mentos/src/devices/fpu.c +++ b/mentos/src/devices/fpu.c @@ -4,15 +4,15 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "fpu.h" -#include "isr.h" -#include "debug.h" +#include "devices/fpu.h" +#include "descriptor_tables/isr.h" +#include "misc/debug.h" #include "string.h" #include "assert.h" -#include "scheduler.h" +#include "process/scheduler.h" #include "math.h" -#include "process.h" -#include "signal.h" +#include "process/process.h" +#include "system/signal.h" /// Pointerst to the current thread using the FPU. task_struct *thread_using_fpu = NULL; diff --git a/mentos/src/devices/pci.c b/mentos/src/devices/pci.c index cb077a9..578b3d7 100644 --- a/mentos/src/devices/pci.c +++ b/mentos/src/devices/pci.c @@ -5,10 +5,10 @@ /// See LICENSE.md for details. ///! @cond Doxygen_Suppress -#include "pci.h" -#include "debug.h" +#include "devices/pci.h" +#include "misc/debug.h" #include "string.h" -#include "port_io.h" +#include "io/port_io.h" void pci_write_field(uint32_t device, int field, int size, uint32_t value) { diff --git a/mentos/src/drivers/ata.c b/mentos/src/drivers/ata.c index cb6b209..647040b 100644 --- a/mentos/src/drivers/ata.c +++ b/mentos/src/drivers/ata.c @@ -5,22 +5,22 @@ /// See LICENSE.md for details. ///! @cond Doxygen_Suppress -#include "ata.h" -#include "spinlock.h" +#include "drivers/ata.h" +#include "klib/spinlock.h" #include "fcntl.h" -#include "vmem_map.h" -#include "list.h" +#include "mem/vmem_map.h" +#include "klib/list.h" #include "stdio.h" -#include "isr.h" -#include "vfs.h" -#include "pci.h" -#include "debug.h" -#include "kheap.h" +#include "descriptor_tables/isr.h" +#include "fs/vfs.h" +#include "devices/pci.h" +#include "misc/debug.h" +#include "mem/kheap.h" #include "assert.h" #include "string.h" #include "kernel.h" -#include "pic8259.h" -#include "port_io.h" +#include "hardware/pic8259.h" +#include "io/port_io.h" #include "time.h" // #define COMPLETE_SCHEDULER diff --git a/mentos/src/drivers/fdc.c b/mentos/src/drivers/fdc.c index 420f60f..9eb0f3d 100644 --- a/mentos/src/drivers/fdc.c +++ b/mentos/src/drivers/fdc.c @@ -4,9 +4,9 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "fdc.h" -#include "video.h" -#include "port_io.h" +#include "drivers/fdc.h" +#include "io/video.h" +#include "io/port_io.h" void fdc_disable_motor() { diff --git a/mentos/src/drivers/keyboard/keyboard.c b/mentos/src/drivers/keyboard/keyboard.c index 0e2a392..18691f6 100644 --- a/mentos/src/drivers/keyboard/keyboard.c +++ b/mentos/src/drivers/keyboard/keyboard.c @@ -4,17 +4,17 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "keyboard.h" +#include "drivers/keyboard/keyboard.h" -#include "port_io.h" -#include "pic8259.h" -#include "keymap.h" +#include "io/port_io.h" +#include "hardware/pic8259.h" +#include "drivers/keyboard/keymap.h" #include "sys/bitops.h" -#include "video.h" -#include "debug.h" +#include "io/video.h" +#include "misc/debug.h" #include "ctype.h" -#include "isr.h" -#include "scheduler.h" +#include "descriptor_tables/isr.h" +#include "process/scheduler.h" /// A macro from Ivan to update buffer indexes. #define STEP(x) (((x) == BUFSIZE - 1) ? 0 : ((x) + 1)) diff --git a/mentos/src/drivers/keyboard/keymap.c b/mentos/src/drivers/keyboard/keymap.c index e24b688..9a2438b 100644 --- a/mentos/src/drivers/keyboard/keymap.c +++ b/mentos/src/drivers/keyboard/keymap.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "keymap.h" +#include "drivers/keyboard/keymap.h" #include "string.h" /// Identifies the current keymap type. diff --git a/mentos/src/drivers/mouse.c b/mentos/src/drivers/mouse.c index 967a608..83acc45 100644 --- a/mentos/src/drivers/mouse.c +++ b/mentos/src/drivers/mouse.c @@ -6,9 +6,9 @@ ///// See LICENSE.md for details. /////! @cond Doxygen_Suppress -#include "mouse.h" -#include "pic8259.h" -#include "port_io.h" +#include "drivers/mouse.h" +#include "hardware/pic8259.h" +#include "io/port_io.h" static uint8_t mouse_cycle = 0; diff --git a/mentos/src/drivers/rtc.c b/mentos/src/drivers/rtc.c index e7cc972..153043e 100644 --- a/mentos/src/drivers/rtc.c +++ b/mentos/src/drivers/rtc.c @@ -4,13 +4,13 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "rtc.h" +#include "drivers/rtc.h" -#include "pic8259.h" +#include "hardware/pic8259.h" #include "string.h" -#include "port_io.h" +#include "io/port_io.h" #include "kernel.h" -#include "isr.h" +#include "descriptor_tables/isr.h" #define CMOS_ADDR 0x70 ///< Addess where we need to write the Address. #define CMOS_DATA 0x71 ///< Addess where we need to write the Data. diff --git a/mentos/src/elf/elf.c b/mentos/src/elf/elf.c index 4478c6b..77024a2 100644 --- a/mentos/src/elf/elf.c +++ b/mentos/src/elf/elf.c @@ -7,17 +7,17 @@ /// Change the header. #define __DEBUG_HEADER__ "[ELF ]" -#include "elf.h" +#include "elf/elf.h" -#include "scheduler.h" -#include "vmem_map.h" -#include "process.h" +#include "process/scheduler.h" +#include "mem/vmem_map.h" +#include "process/process.h" #include "string.h" #include "stddef.h" -#include "debug.h" +#include "misc/debug.h" #include "stdio.h" -#include "slab.h" -#include "vfs.h" +#include "mem/slab.h" +#include "fs/vfs.h" /// @brief Reads the program header from file. /// @param file The file from which we extract the program header. diff --git a/mentos/src/fs/initrd.c b/mentos/src/fs/initrd.c index b7c9dab..3b6848d 100644 --- a/mentos/src/fs/initrd.c +++ b/mentos/src/fs/initrd.c @@ -5,16 +5,16 @@ /// See LICENSE.md for details. #include "assert.h" -#include "syscall.h" +#include "system/syscall.h" #include "sys/module.h" #include "system/panic.h" -#include "vfs.h" -#include "errno.h" -#include "debug.h" -#include "kheap.h" +#include "fs/vfs.h" +#include "sys/errno.h" +#include "misc/debug.h" +#include "mem/kheap.h" #include "fcntl.h" #include "sys/bitops.h" -#include "initrd.h" +#include "fs/initrd.h" #include "string.h" #include "stdio.h" #include "libgen.h" diff --git a/mentos/src/fs/ioctl.c b/mentos/src/fs/ioctl.c index 4cb2090..d2e6b87 100644 --- a/mentos/src/fs/ioctl.c +++ b/mentos/src/fs/ioctl.c @@ -4,12 +4,12 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "ioctl.h" -#include "scheduler.h" -#include "printk.h" +#include "fs/ioctl.h" +#include "process/scheduler.h" +#include "system/printk.h" #include "stdio.h" -#include "errno.h" -#include "vfs.h" +#include "sys/errno.h" +#include "fs/vfs.h" int sys_ioctl(int fd, int request, void *data) { diff --git a/mentos/src/fs/namei.c b/mentos/src/fs/namei.c index 4234eea..8ffb0f9 100644 --- a/mentos/src/fs/namei.c +++ b/mentos/src/fs/namei.c @@ -4,9 +4,9 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "errno.h" -#include "vfs.h" -#include "scheduler.h" +#include "sys/errno.h" +#include "fs/vfs.h" +#include "process/scheduler.h" int sys_unlink(const char *path) { diff --git a/mentos/src/fs/open.c b/mentos/src/fs/open.c index 346adbc..9200609 100644 --- a/mentos/src/fs/open.c +++ b/mentos/src/fs/open.c @@ -8,13 +8,13 @@ #include "process/process.h" #include "system/printk.h" #include "fcntl.h" -#include "syscall.h" +#include "system/syscall.h" #include "string.h" #include "limits.h" -#include "debug.h" -#include "errno.h" +#include "misc/debug.h" +#include "sys/errno.h" #include "stdio.h" -#include "vfs.h" +#include "fs/vfs.h" int sys_open(const char *pathname, int flags, mode_t mode) { diff --git a/mentos/src/fs/procfs.c b/mentos/src/fs/procfs.c index 7ed9833..2de01e6 100644 --- a/mentos/src/fs/procfs.c +++ b/mentos/src/fs/procfs.c @@ -7,11 +7,11 @@ /// Change the header. #define __DEBUG_HEADER__ "[PROCFS]" -#include "procfs.h" -#include "vfs.h" +#include "fs/procfs.h" +#include "fs/vfs.h" #include "string.h" -#include "errno.h" -#include "debug.h" +#include "sys/errno.h" +#include "misc/debug.h" #include "fcntl.h" #include "libgen.h" #include "assert.h" diff --git a/mentos/src/fs/read_write.c b/mentos/src/fs/read_write.c index 3c8e83d..23673f4 100644 --- a/mentos/src/fs/read_write.c +++ b/mentos/src/fs/read_write.c @@ -4,13 +4,13 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "scheduler.h" -#include "vfs_types.h" -#include "panic.h" -#include "errno.h" +#include "process/scheduler.h" +#include "fs/vfs_types.h" +#include "system/panic.h" +#include "sys/errno.h" #include "fcntl.h" #include "stdio.h" -#include "vfs.h" +#include "fs/vfs.h" ssize_t sys_read(int fd, void *buf, size_t nbytes) { diff --git a/mentos/src/fs/readdir.c b/mentos/src/fs/readdir.c index e879ae7..54f74f0 100644 --- a/mentos/src/fs/readdir.c +++ b/mentos/src/fs/readdir.c @@ -5,12 +5,12 @@ /// See LICENSE.md for details. #include "sys/dirent.h" -#include "scheduler.h" -#include "syscall.h" -#include "printk.h" -#include "errno.h" +#include "process/scheduler.h" +#include "system/syscall.h" +#include "system/printk.h" +#include "sys/errno.h" #include "stdio.h" -#include "vfs.h" +#include "fs/vfs.h" int sys_getdents(int fd, dirent_t *dirp, unsigned int count) { diff --git a/mentos/src/fs/stat.c b/mentos/src/fs/stat.c index b8531ee..becfdb1 100644 --- a/mentos/src/fs/stat.c +++ b/mentos/src/fs/stat.c @@ -4,13 +4,13 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "debug.h" -#include "errno.h" -#include "vfs.h" -#include "kheap.h" +#include "misc/debug.h" +#include "sys/errno.h" +#include "fs/vfs.h" +#include "mem/kheap.h" #include "stdio.h" #include "string.h" -#include "initrd.h" +#include "fs/initrd.h" #include "limits.h" int sys_stat(const char *path, stat_t *buf) diff --git a/mentos/src/fs/vfs.c b/mentos/src/fs/vfs.c index 7b7d694..f6e310e 100644 --- a/mentos/src/fs/vfs.c +++ b/mentos/src/fs/vfs.c @@ -4,19 +4,19 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "vfs.h" +#include "fs/vfs.h" -#include "scheduler.h" -#include "spinlock.h" +#include "process/scheduler.h" +#include "klib/spinlock.h" #include "strerror.h" -#include "syscall.h" -#include "hashmap.h" +#include "system/syscall.h" +#include "klib/hashmap.h" #include "string.h" -#include "procfs.h" +#include "fs/procfs.h" #include "assert.h" #include "libgen.h" -#include "debug.h" -#include "panic.h" +#include "misc/debug.h" +#include "system/panic.h" #include "stdio.h" /// The hashmap that associates a type of Filesystem `name` to its `mount` function; diff --git a/mentos/src/hardware/cpuid.c b/mentos/src/hardware/cpuid.c index 1c255e8..a157016 100644 --- a/mentos/src/hardware/cpuid.c +++ b/mentos/src/hardware/cpuid.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "cpuid.h" +#include "hardware/cpuid.h" #include "string.h" void get_cpuid(cpuinfo_t *cpuinfo) diff --git a/mentos/src/hardware/pic8259.c b/mentos/src/hardware/pic8259.c index 649cb7b..9dac083 100644 --- a/mentos/src/hardware/pic8259.c +++ b/mentos/src/hardware/pic8259.c @@ -4,8 +4,8 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "pic8259.h" -#include "port_io.h" +#include "hardware/pic8259.h" +#include "io/port_io.h" #include "stddef.h" /// End-of-interrupt command code. diff --git a/mentos/src/hardware/timer.c b/mentos/src/hardware/timer.c index c38b7d4..117c02e 100644 --- a/mentos/src/hardware/timer.c +++ b/mentos/src/hardware/timer.c @@ -4,22 +4,22 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "timer.h" +#include "hardware/timer.h" -#include "irqflags.h" -#include "scheduler.h" -#include "pic8259.h" -#include "port_io.h" +#include "klib/irqflags.h" +#include "process/scheduler.h" +#include "hardware/pic8259.h" +#include "io/port_io.h" #include "stdint.h" -#include "kheap.h" -#include "debug.h" -#include "wait.h" -#include "rtc.h" -#include "isr.h" -#include "fpu.h" -#include "signal.h" +#include "mem/kheap.h" +#include "misc/debug.h" +#include "process/wait.h" +#include "drivers/rtc.h" +#include "descriptor_tables/isr.h" +#include "devices/fpu.h" +#include "system/signal.h" #include "assert.h" -#include "errno.h" +#include "sys/errno.h" /// Number of ticks per seconds. #define TICKS_PER_SECOND 1193 diff --git a/mentos/src/io/mm_io.c b/mentos/src/io/mm_io.c index 0b215b5..219f776 100644 --- a/mentos/src/io/mm_io.c +++ b/mentos/src/io/mm_io.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "mm_io.h" +#include "io/mm_io.h" uint8_t in_memb(uint32_t addr) { diff --git a/mentos/src/io/port_io.c b/mentos/src/io/port_io.c index 7da53bb..9dfe3ff 100644 --- a/mentos/src/io/port_io.c +++ b/mentos/src/io/port_io.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "port_io.h" +#include "io/port_io.h" inline uint8_t inportb(uint16_t port) { diff --git a/mentos/src/io/proc_running.c b/mentos/src/io/proc_running.c index 02596c2..916fd70 100644 --- a/mentos/src/io/proc_running.c +++ b/mentos/src/io/proc_running.c @@ -2,15 +2,15 @@ // Created by andrea on 02/05/20. // -#include "procfs.h" +#include "fs/procfs.h" -#include "process.h" +#include "process/process.h" #include "string.h" #include "libgen.h" #include "stdio.h" -#include "errno.h" -#include "debug.h" -#include "prio.h" +#include "sys/errno.h" +#include "misc/debug.h" +#include "process/prio.h" /// @brief Returns the character identifying the process state. /// @details diff --git a/mentos/src/io/proc_system.c b/mentos/src/io/proc_system.c index 132f710..9e90927 100644 --- a/mentos/src/io/proc_system.c +++ b/mentos/src/io/proc_system.c @@ -4,14 +4,14 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "procfs.h" +#include "fs/procfs.h" #include "version.h" -#include "process.h" +#include "process/process.h" #include "string.h" #include "stdio.h" -#include "errno.h" -#include "debug.h" -#include "timer.h" +#include "sys/errno.h" +#include "misc/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 b9597a2..8937451 100644 --- a/mentos/src/io/proc_video.c +++ b/mentos/src/io/proc_video.c @@ -2,16 +2,16 @@ // Created by andrea on 02/05/20. // -#include "termios-struct.h" -#include "keyboard.h" -#include "procfs.h" -#include "ioctls.h" +#include "bits/termios-struct.h" +#include "drivers/keyboard/keyboard.h" +#include "fs/procfs.h" +#include "bits/ioctls.h" #include "sys/bitops.h" -#include "video.h" -#include "debug.h" -#include "errno.h" +#include "io/video.h" +#include "misc/debug.h" +#include "sys/errno.h" #include "fcntl.h" -#include "vfs.h" +#include "fs/vfs.h" static termios ktermios = { .c_cflag = 0, diff --git a/mentos/src/io/stdio.c b/mentos/src/io/stdio.c index 0e57909..d28f4d4 100644 --- a/mentos/src/io/stdio.c +++ b/mentos/src/io/stdio.c @@ -2,12 +2,12 @@ /// @brief Standard I/0 functions. /// @date Apr 2019 -#include "syscall.h" -#include "errno.h" +#include "system/syscall.h" +#include "sys/errno.h" #include "stdio.h" -#include "video.h" +#include "io/video.h" #include "ctype.h" -#include "keyboard.h" +#include "drivers/keyboard/keyboard.h" #include "string.h" void putchar(int character) diff --git a/mentos/src/io/vga/vga.c b/mentos/src/io/vga/vga.c index a3630ca..3d1ea71 100644 --- a/mentos/src/io/vga/vga.c +++ b/mentos/src/io/vga/vga.c @@ -1,13 +1,13 @@ -#include "vga.h" +#include "io/vga/vga.h" -#include "vga_palette.h" -#include "vga_mode.h" -#include "vga_font.h" +#include "io/vga/vga_palette.h" +#include "io/vga/vga_mode.h" +#include "io/vga/vga_font.h" -#include "port_io.h" +#include "io/port_io.h" #include "stdbool.h" #include "string.h" -#include "debug.h" +#include "misc/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/io/video.c b/mentos/src/io/video.c index 92f6ce7..d160806 100644 --- a/mentos/src/io/video.c +++ b/mentos/src/io/video.c @@ -4,8 +4,8 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "port_io.h" -#include "video.h" +#include "io/port_io.h" +#include "io/video.h" #include "stdbool.h" #include "ctype.h" #include "string.h" diff --git a/mentos/src/ipc/msg.c b/mentos/src/ipc/msg.c index 8f975dd..bbaa6d9 100644 --- a/mentos/src/ipc/msg.c +++ b/mentos/src/ipc/msg.c @@ -6,7 +6,7 @@ ///! @cond Doxygen_Suppress #include "ipc/msg.h" -#include "panic.h" +#include "system/panic.h" long sys_msgget(key_t key, int msgflg) { diff --git a/mentos/src/ipc/sem.c b/mentos/src/ipc/sem.c index 7e88a96..238b40f 100644 --- a/mentos/src/ipc/sem.c +++ b/mentos/src/ipc/sem.c @@ -6,7 +6,7 @@ ///! @cond Doxygen_Suppress #include "ipc/sem.h" -#include "panic.h" +#include "system/panic.h" long sys_semget(key_t key, int nsems, int semflg) { diff --git a/mentos/src/ipc/shm.c b/mentos/src/ipc/shm.c index ad55185..4bab57c 100644 --- a/mentos/src/ipc/shm.c +++ b/mentos/src/ipc/shm.c @@ -6,7 +6,7 @@ ///! @cond Doxygen_Suppress #include "ipc/shm.h" -#include "panic.h" +#include "system/panic.h" #if 0 struct shmid_ds *head = NULL; diff --git a/mentos/src/kernel.c b/mentos/src/kernel.c index cfb849a..6ec25bb 100644 --- a/mentos/src/kernel.c +++ b/mentos/src/kernel.c @@ -4,34 +4,34 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "proc_modules.h" -#include "vmem_map.h" -#include "procfs.h" -#include "pci.h" -#include "ata.h" -#include "idt.h" +#include "io/proc_modules.h" +#include "mem/vmem_map.h" +#include "fs/procfs.h" +#include "devices/pci.h" +#include "drivers/ata.h" +#include "descriptor_tables/idt.h" #include "kernel.h" -#include "zone_allocator.h" -#include "gdt.h" -#include "syscall.h" +#include "mem/zone_allocator.h" +#include "descriptor_tables/gdt.h" +#include "system/syscall.h" #include "version.h" -#include "video.h" -#include "pic8259.h" -#include "debug.h" -#include "fdc.h" -#include "initrd.h" -#include "irqflags.h" -#include "keyboard.h" -#include "scheduler.h" -#include "timer.h" -#include "vfs.h" -#include "fpu.h" -#include "printk.h" -#include "module.h" -#include "rtc.h" +#include "io/video.h" +#include "hardware/pic8259.h" +#include "misc/debug.h" +#include "drivers/fdc.h" +#include "fs/initrd.h" +#include "klib/irqflags.h" +#include "drivers/keyboard/keyboard.h" +#include "process/scheduler.h" +#include "hardware/timer.h" +#include "fs/vfs.h" +#include "devices/fpu.h" +#include "system/printk.h" +#include "sys/module.h" +#include "drivers/rtc.h" #include "stdio.h" #include "assert.h" -#include "vga.h" +#include "io/vga/vga.h" /// Describe start address of grub multiboot modules. char *module_start[MAX_MODULES]; diff --git a/mentos/src/kernel/sys.c b/mentos/src/kernel/sys.c index e968039..a9e5581 100644 --- a/mentos/src/kernel/sys.c +++ b/mentos/src/kernel/sys.c @@ -5,10 +5,10 @@ /// See LICENSE.md for details. #include "stdio.h" -#include "errno.h" -#include "reboot.h" -#include "stdatomic.h" -#include "mutex.h" +#include "sys/errno.h" +#include "sys/reboot.h" +#include "klib/stdatomic.h" +#include "klib/mutex.h" static void machine_power_off() { diff --git a/mentos/src/klib/assert.c b/mentos/src/klib/assert.c index 63960a1..9621daf 100644 --- a/mentos/src/klib/assert.c +++ b/mentos/src/klib/assert.c @@ -6,7 +6,7 @@ #include "assert.h" #include "stdio.h" -#include "panic.h" +#include "system/panic.h" void __assert_fail(const char *assertion, const char *file, const char *function, unsigned int line) { diff --git a/mentos/src/klib/hashmap.c b/mentos/src/klib/hashmap.c index 27d7d8a..3033aba 100644 --- a/mentos/src/klib/hashmap.c +++ b/mentos/src/klib/hashmap.c @@ -4,10 +4,10 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "hashmap.h" +#include "klib/hashmap.h" #include "assert.h" #include "string.h" -#include "slab.h" +#include "mem/slab.h" /// @brief Stores information of an entry of the hashmap. struct hashmap_entry_t { diff --git a/mentos/src/klib/libgen.c b/mentos/src/klib/libgen.c index a3fa585..10283c6 100644 --- a/mentos/src/klib/libgen.c +++ b/mentos/src/klib/libgen.c @@ -4,13 +4,13 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "syscall.h" +#include "system/syscall.h" #include "libgen.h" #include "string.h" -#include "initrd.h" +#include "fs/initrd.h" #include "limits.h" #include "assert.h" -#include "paging.h" +#include "mem/paging.h" int parse_path(char *out, char **cur, char sep, size_t max) { diff --git a/mentos/src/klib/list.c b/mentos/src/klib/list.c index 4209f2a..836c6c6 100644 --- a/mentos/src/klib/list.c +++ b/mentos/src/klib/list.c @@ -4,10 +4,10 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "list.h" +#include "klib/list.h" #include "assert.h" #include "string.h" -#include "slab.h" +#include "mem/slab.h" static inline listnode_t *__node_alloc() { diff --git a/mentos/src/klib/mutex.c b/mentos/src/klib/mutex.c index 4d9e1f1..6a921ea 100644 --- a/mentos/src/klib/mutex.c +++ b/mentos/src/klib/mutex.c @@ -4,8 +4,8 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "mutex.h" -#include "debug.h" +#include "klib/mutex.h" +#include "misc/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 3564c5a..095d4d8 100644 --- a/mentos/src/klib/ndtree.c +++ b/mentos/src/klib/ndtree.c @@ -4,11 +4,11 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "debug.h" -#include "ndtree.h" +#include "misc/debug.h" +#include "klib/ndtree.h" #include "assert.h" -#include "list_head.h" -#include "slab.h" +#include "klib/list_head.h" +#include "mem/slab.h" // ============================================================================ // Tree types. diff --git a/mentos/src/klib/rbtree.c b/mentos/src/klib/rbtree.c index ca686c5..7f6abe8 100644 --- a/mentos/src/klib/rbtree.c +++ b/mentos/src/klib/rbtree.c @@ -4,11 +4,11 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "rbtree.h" +#include "klib/rbtree.h" #include "assert.h" -#include "debug.h" -#include "slab.h" +#include "misc/debug.h" +#include "mem/slab.h" /// @brief Stores information of a node. struct rbtree_node_t { diff --git a/mentos/src/klib/spinlock.c b/mentos/src/klib/spinlock.c index 6f15c43..5c59035 100644 --- a/mentos/src/klib/spinlock.c +++ b/mentos/src/klib/spinlock.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "spinlock.h" +#include "klib/spinlock.h" void spinlock_init(spinlock_t *spinlock) { diff --git a/mentos/src/klib/string.c b/mentos/src/klib/string.c index b3e4b6c..9cbd601 100644 --- a/mentos/src/klib/string.c +++ b/mentos/src/klib/string.c @@ -4,7 +4,7 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "kheap.h" +#include "mem/kheap.h" #include "stdio.h" #include "fcntl.h" #include "string.h" diff --git a/mentos/src/klib/time.c b/mentos/src/klib/time.c index 8898a35..2b97404 100644 --- a/mentos/src/klib/time.c +++ b/mentos/src/klib/time.c @@ -4,13 +4,13 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "debug.h" +#include "misc/debug.h" #include "time.h" #include "stdio.h" #include "stddef.h" -#include "port_io.h" -#include "timer.h" -#include "rtc.h" +#include "io/port_io.h" +#include "hardware/timer.h" +#include "drivers/rtc.h" static const char *str_weekdays[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; diff --git a/mentos/src/klib/vscanf.c b/mentos/src/klib/vscanf.c index 82bf75e..b811d6b 100644 --- a/mentos/src/klib/vscanf.c +++ b/mentos/src/klib/vscanf.c @@ -4,10 +4,10 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "vfs.h" +#include "fs/vfs.h" #include "ctype.h" #include "string.h" -#include "debug.h" +#include "misc/debug.h" #include "stdio.h" static int vsscanf(const char *buf, const char *s, va_list ap) diff --git a/mentos/src/klib/vsprintf.c b/mentos/src/klib/vsprintf.c index 47a123b..d44d4a7 100644 --- a/mentos/src/klib/vsprintf.c +++ b/mentos/src/klib/vsprintf.c @@ -11,7 +11,7 @@ #include "stdbool.h" #include "stdint.h" #include "stdio.h" -#include "video.h" +#include "io/video.h" #include "fcvt.h" /// Size of the buffer used to call cvt functions. diff --git a/mentos/src/mem/buddysystem.c b/mentos/src/mem/buddysystem.c index 900087c..d1cd2b1 100644 --- a/mentos/src/mem/buddysystem.c +++ b/mentos/src/mem/buddysystem.c @@ -7,11 +7,11 @@ /// Change the header. #define __DEBUG_HEADER__ "[BUDDY ]" -#include "buddysystem.h" -#include "paging.h" +#include "mem/buddysystem.h" +#include "mem/paging.h" #include "assert.h" -#include "debug.h" -#include "panic.h" +#include "misc/debug.h" +#include "system/panic.h" /// @brief Cache level low limit after which allocation starts. #define LOW_WATERMARK_LEVEL 10 diff --git a/mentos/src/mem/kheap.c b/mentos/src/mem/kheap.c index 12adba4..6f9ffe0 100644 --- a/mentos/src/mem/kheap.c +++ b/mentos/src/mem/kheap.c @@ -7,13 +7,13 @@ /// Change the header. #define __DEBUG_HEADER__ "[KHEAP ]" -#include "kheap.h" +#include "mem/kheap.h" #include "math.h" -#include "debug.h" +#include "misc/debug.h" #include "string.h" -#include "paging.h" +#include "mem/paging.h" #include "assert.h" -#include "list_head.h" +#include "klib/list_head.h" /// Overhead given by the block_t itself. #define OVERHEAD sizeof(block_t) diff --git a/mentos/src/mem/paging.c b/mentos/src/mem/paging.c index 34357f4..11601dd 100644 --- a/mentos/src/mem/paging.c +++ b/mentos/src/mem/paging.c @@ -7,15 +7,15 @@ /// Change the header. #define __DEBUG_HEADER__ "[PAGING]" -#include "paging.h" -#include "isr.h" -#include "vmem_map.h" -#include "zone_allocator.h" -#include "kheap.h" -#include "debug.h" +#include "mem/paging.h" +#include "descriptor_tables/isr.h" +#include "mem/vmem_map.h" +#include "mem/zone_allocator.h" +#include "mem/kheap.h" +#include "misc/debug.h" #include "assert.h" #include "string.h" -#include "panic.h" +#include "system/panic.h" /// Cache for storing mm_struct. kmem_cache_t *mm_cache; diff --git a/mentos/src/mem/slab.c b/mentos/src/mem/slab.c index 7417b68..744c374 100644 --- a/mentos/src/mem/slab.c +++ b/mentos/src/mem/slab.c @@ -7,11 +7,11 @@ /// Change the header. #define __DEBUG_HEADER__ "[SLAB ]" -#include "zone_allocator.h" -#include "paging.h" +#include "mem/zone_allocator.h" +#include "mem/paging.h" #include "assert.h" -#include "debug.h" -#include "slab.h" +#include "misc/debug.h" +#include "mem/slab.h" /// @brief Use it to manage cached pages. typedef struct kmem_obj { diff --git a/mentos/src/mem/vmem_map.c b/mentos/src/mem/vmem_map.c index 4d45cc7..2bed3cc 100644 --- a/mentos/src/mem/vmem_map.c +++ b/mentos/src/mem/vmem_map.c @@ -7,9 +7,9 @@ /// Change the header. #define __DEBUG_HEADER__ "[VMEM ]" -#include "vmem_map.h" +#include "mem/vmem_map.h" #include "string.h" -#include "panic.h" +#include "system/panic.h" /// Virtual addresses manager. static virt_map_page_manager_t virt_default_mapping; diff --git a/mentos/src/mem/zone_allocator.c b/mentos/src/mem/zone_allocator.c index 67ffa16..5c805d4 100644 --- a/mentos/src/mem/zone_allocator.c +++ b/mentos/src/mem/zone_allocator.c @@ -7,14 +7,14 @@ /// Change the header. #define __DEBUG_HEADER__ "[PMM ]" -#include "zone_allocator.h" -#include "buddysystem.h" -#include "list_head.h" +#include "mem/zone_allocator.h" +#include "mem/buddysystem.h" +#include "klib/list_head.h" #include "kernel.h" #include "assert.h" -#include "paging.h" +#include "mem/paging.h" #include "string.h" -#include "debug.h" +#include "misc/debug.h" /// TODO: Comment. #define MIN_PAGE_ALIGN(addr) ((addr) & (~(PAGE_SIZE - 1))) diff --git a/mentos/src/misc/debug.c b/mentos/src/misc/debug.c index 7f7ff75..c3e2be5 100644 --- a/mentos/src/misc/debug.c +++ b/mentos/src/misc/debug.c @@ -5,13 +5,13 @@ /// See LICENSE.md for details. #include "sys/bitops.h" -#include "debug.h" -#include "spinlock.h" -#include "port_io.h" +#include "misc/debug.h" +#include "klib/spinlock.h" +#include "io/port_io.h" #include "kernel.h" #include "string.h" #include "stdio.h" -#include "video.h" +#include "io/video.h" /// Serial port for QEMU. #define SERIAL_COM1 (0x03F8) diff --git a/mentos/src/multiboot.c b/mentos/src/multiboot.c index 6874ea1..e9801c5 100644 --- a/mentos/src/multiboot.c +++ b/mentos/src/multiboot.c @@ -10,8 +10,8 @@ #include "kernel.h" #include "sys/bitops.h" #include "stddef.h" -#include "debug.h" -#include "panic.h" +#include "misc/debug.h" +#include "system/panic.h" #include "stddef.h" diff --git a/mentos/src/process/process.c b/mentos/src/process/process.c index 528a831..b2eb124 100644 --- a/mentos/src/process/process.c +++ b/mentos/src/process/process.c @@ -5,26 +5,26 @@ /// See LICENSE.md for details. -#include "kernel_levels.h" +#include "sys/kernel_levels.h" //#ifndef __DEBUG_LEVEL__ //#define __DEBUG_LEVEL__ LOGLEVEL_DEBUG //#endif -#include -#include "process.h" -#include "scheduler.h" +#include "process/process.h" +#include "process/scheduler.h" #include "assert.h" #include "libgen.h" #include "string.h" -#include "timer.h" +#include "hardware/timer.h" +#include "sys/errno.h" #include "fcntl.h" -#include "panic.h" -#include "debug.h" -#include "wait.h" -#include "prio.h" -#include "vfs.h" -#include "elf.h" +#include "system/panic.h" +#include "misc/debug.h" +#include "process/wait.h" +#include "process/prio.h" +#include "fs/vfs.h" +#include "elf/elf.h" /// Cache for creating the task structs. static kmem_cache_t *task_struct_cache; diff --git a/mentos/src/process/scheduler.c b/mentos/src/process/scheduler.c index e578c85..accfd33 100644 --- a/mentos/src/process/scheduler.c +++ b/mentos/src/process/scheduler.c @@ -9,20 +9,20 @@ #include "assert.h" #include "strerror.h" -#include "vfs.h" -#include "scheduler.h" -#include "tss.h" -#include "fpu.h" -#include "prio.h" -#include "wait.h" -#include "kheap.h" -#include "panic.h" -#include "debug.h" +#include "fs/vfs.h" +#include "process/scheduler.h" +#include "descriptor_tables/tss.h" +#include "devices/fpu.h" +#include "process/prio.h" +#include "process/wait.h" +#include "mem/kheap.h" +#include "system/panic.h" +#include "misc/debug.h" #include "time.h" -#include "errno.h" -#include "list_head.h" -#include "paging.h" -#include "timer.h" +#include "sys/errno.h" +#include "klib/list_head.h" +#include "mem/paging.h" +#include "hardware/timer.h" #include "math.h" #include "stdio.h" diff --git a/mentos/src/process/scheduler_algorithm.c b/mentos/src/process/scheduler_algorithm.c index 656389d..9eec80b 100644 --- a/mentos/src/process/scheduler_algorithm.c +++ b/mentos/src/process/scheduler_algorithm.c @@ -4,13 +4,13 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "timer.h" -#include "prio.h" -#include "debug.h" +#include "hardware/timer.h" +#include "process/prio.h" +#include "misc/debug.h" #include "assert.h" -#include "list_head.h" -#include "wait.h" -#include "scheduler.h" +#include "klib/list_head.h" +#include "process/wait.h" +#include "process/scheduler.h" /// @brief Updates task execution statistics. /// @param task the task to update. diff --git a/mentos/src/process/wait.c b/mentos/src/process/wait.c index 6680e27..9b37b82 100644 --- a/mentos/src/process/wait.c +++ b/mentos/src/process/wait.c @@ -7,7 +7,7 @@ /// Change the header. #define __DEBUG_HEADER__ "[WAIT ]" -#include "wait.h" +#include "process/wait.h" static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_entry_t *wq) { diff --git a/mentos/src/sys/module.c b/mentos/src/sys/module.c index 761103d..88d8b7b 100644 --- a/mentos/src/sys/module.c +++ b/mentos/src/sys/module.c @@ -4,11 +4,11 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "slab.h" -#include "module.h" +#include "mem/slab.h" +#include "sys/module.h" #include "string.h" #include "sys/bitops.h" -#include "debug.h" +#include "misc/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 cd3e6eb..9a10dc2 100644 --- a/mentos/src/sys/utsname.c +++ b/mentos/src/sys/utsname.c @@ -5,12 +5,12 @@ /// See LICENSE.md for details. #include "string.h" -#include "utsname.h" +#include "sys/utsname.h" #include "version.h" -#include "debug.h" -#include "errno.h" +#include "misc/debug.h" +#include "sys/errno.h" #include "fcntl.h" -#include "vfs.h" +#include "fs/vfs.h" static inline int __gethostname(char *name, size_t len) { diff --git a/mentos/src/system/errno.c b/mentos/src/system/errno.c index c52a17f..c4bc9e1 100644 --- a/mentos/src/system/errno.c +++ b/mentos/src/system/errno.c @@ -4,8 +4,8 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "errno.h" -#include "scheduler.h" +#include "sys/errno.h" +#include "process/scheduler.h" /// @brief Returns the error number for the current process. /// @return Pointer to the error number. diff --git a/mentos/src/system/panic.c b/mentos/src/system/panic.c index c37b61e..6693357 100644 --- a/mentos/src/system/panic.c +++ b/mentos/src/system/panic.c @@ -4,8 +4,8 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "panic.h" -#include "debug.h" +#include "system/panic.h" +#include "misc/debug.h" void kernel_panic(const char *msg) { diff --git a/mentos/src/system/printk.c b/mentos/src/system/printk.c index 9d64247..00e475e 100644 --- a/mentos/src/system/printk.c +++ b/mentos/src/system/printk.c @@ -4,10 +4,10 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "printk.h" +#include "system/printk.h" #include "stdarg.h" #include "stdio.h" -#include "video.h" +#include "io/video.h" int sys_syslog(const char *format, ...) { diff --git a/mentos/src/system/signal.c b/mentos/src/system/signal.c index 17b8467..dfc8f7e 100644 --- a/mentos/src/system/signal.c +++ b/mentos/src/system/signal.c @@ -7,15 +7,15 @@ /// Change the header. #define __DEBUG_HEADER__ "[SIGNAL]" -#include "signal.h" -#include "wait.h" -#include "scheduler.h" -#include "process.h" -#include "errno.h" +#include "system/signal.h" +#include "process/wait.h" +#include "process/scheduler.h" +#include "process/process.h" +#include "sys/errno.h" #include "assert.h" -#include "debug.h" +#include "misc/debug.h" #include "string.h" -#include "irqflags.h" +#include "klib/irqflags.h" /// SLAB caches for signal bits. static kmem_cache_t *sigqueue_cachep; diff --git a/mentos/src/system/syscall.c b/mentos/src/system/syscall.c index c727119..b8931df 100644 --- a/mentos/src/system/syscall.c +++ b/mentos/src/system/syscall.c @@ -4,17 +4,17 @@ /// @copyright (c) 2014-2021 This file is distributed under the MIT License. /// See LICENSE.md for details. -#include "fpu.h" -#include "kheap.h" -#include "syscall.h" -#include "isr.h" -#include "errno.h" +#include "devices/fpu.h" +#include "mem/kheap.h" +#include "system/syscall.h" +#include "descriptor_tables/isr.h" +#include "sys/errno.h" #include "kernel.h" -#include "process.h" -#include "scheduler.h" -#include "utsname.h" -#include "ioctl.h" -#include "timer.h" +#include "process/process.h" +#include "process/scheduler.h" +#include "sys/utsname.h" +#include "fs/ioctl.h" +#include "hardware/timer.h" #include "ipc/msg.h" #include "ipc/sem.h"