diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index e35e81c..ffff089 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,7 +4,9 @@ "name": "Fennix x64 (Linux, GCC, debug)", "includePath": [ "${workspaceFolder}/include", - "${workspaceFolder}/include/**" + "${workspaceFolder}/include/**", + "${workspaceFolder}/include_std", + "${workspaceFolder}/include_std/**" ], "defines": [ "__debug_vscode__", @@ -74,7 +76,10 @@ { "name": "Fennix x32 (Linux, GCC, debug)", "includePath": [ - "${workspaceFolder}/include/**" + "${workspaceFolder}/include", + "${workspaceFolder}/include/**", + "${workspaceFolder}/include_std", + "${workspaceFolder}/include_std/**" ], "defines": [ "__debug_vscode__", @@ -147,7 +152,10 @@ { "name": "Fennix Aarch64 (Linux, GCC, debug)", "includePath": [ - "${workspaceFolder}/include/**" + "${workspaceFolder}/include", + "${workspaceFolder}/include/**", + "${workspaceFolder}/include_std", + "${workspaceFolder}/include_std/**" ], "defines": [ "__debug_vscode__", diff --git a/Core/Lock.cpp b/Core/Lock.cpp index f032fec..f0f6bd8 100644 --- a/Core/Lock.cpp +++ b/Core/Lock.cpp @@ -31,7 +31,7 @@ bool ForceUnlock = false; std::atomic_size_t LocksCount = 0; -size_t GetLocksCount() { return LocksCount; } +size_t GetLocksCount() { return LocksCount.load(); } void LockClass::DeadLock(SpinLockData Lock) { diff --git a/FileSystem/Filesystem.cpp b/FileSystem/Filesystem.cpp index ffe680d..c0a45ae 100644 --- a/FileSystem/Filesystem.cpp +++ b/FileSystem/Filesystem.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include "../kernel.h" @@ -189,9 +188,7 @@ namespace VirtualFileSystem Node *ParentNode = nullptr; if (FileSystemRoot->Children.size() >= 1) { - if (FileSystemRoot->Children[0] == nullptr) - panic("Root node is null!"); - + assert(FileSystemRoot->Children[0] != nullptr); ParentNode = FileSystemRoot->Children[0]; // 0 - filesystem root } else diff --git a/Makefile b/Makefile index af6e4f2..43362f5 100644 --- a/Makefile +++ b/Makefile @@ -40,11 +40,11 @@ C_SOURCES = $(shell find ./ -type f -name '*.c' -not -path "./Architecture/amd64 CPP_SOURCES = $(shell find ./ -type f -name '*.cpp' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i386/*") RS_SOURCES = $(shell find ./ -type f -name '*.rs' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i386/*") endif -HEADERS = $(sort $(dir $(wildcard ./include/*))) +HEADERS = $(sort $(dir $(wildcard ./include/*))) $(sort $(dir $(wildcard ./include_std/*))) OBJ = $(C_SOURCES:.c=.o) $(CPP_SOURCES:.cpp=.o) $(RS_SOURCES:.rs=.o) $(ASM_SOURCES:.asm=.o) $(S_SOURCES:.S=.o) $(PSF_SOURCES:.psf=.o) $(BMP_SOURCES:.bmp=.o) STACK_USAGE_OBJ = $(C_SOURCES:.c=.su) $(CPP_SOURCES:.cpp=.su) GCNO_OBJ = $(C_SOURCES:.c=.gcno) $(CPP_SOURCES:.cpp=.gcno) -INCLUDE_DIR = ./include +INCLUDE_DIR = -I./include -I./include_std LDFLAGS := -Wl,-Map kernel.map -shared -nostdlib -nodefaultlibs -nolibc @@ -56,7 +56,7 @@ WARNCFLAG = -Wall -Wextra \ # https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html CFLAGS := \ - -I$(INCLUDE_DIR) \ + $(INCLUDE_DIR) \ -DKERNEL_NAME='"$(OSNAME)"' \ -DKERNEL_VERSION='"$(KERNEL_VERSION)"' \ -DGIT_COMMIT='"$(GIT_COMMIT)"' \ diff --git a/include/sys.h b/include/sys.h deleted file mode 100644 index e696362..0000000 --- a/include/sys.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - This file is part of Fennix Kernel. - - Fennix Kernel is free software: you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation, either version 3 of - the License, or (at your option) any later version. - - Fennix Kernel is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Fennix Kernel. If not, see . -*/ - -#ifndef __FENNIX_KERNEL_SYSTEM_H__ -#define __FENNIX_KERNEL_SYSTEM_H__ - -#include -#include - -// TODO: Add actual panic screen -#define panic(msg) \ - { \ - error(msg); \ - CPU::Stop(); \ - } - -#endif // !__FENNIX_KERNEL_SYSTEM_H__ diff --git a/include/assert.h b/include_std/assert.h similarity index 100% rename from include/assert.h rename to include_std/assert.h diff --git a/include/atomic b/include_std/atomic similarity index 100% rename from include/atomic rename to include_std/atomic diff --git a/include/cstddef b/include_std/cstddef similarity index 100% rename from include/cstddef rename to include_std/cstddef diff --git a/include/cstring b/include_std/cstring similarity index 100% rename from include/cstring rename to include_std/cstring diff --git a/include/dlfcn.h b/include_std/dlfcn.h similarity index 100% rename from include/dlfcn.h rename to include_std/dlfcn.h diff --git a/include/errno.h b/include_std/errno.h similarity index 100% rename from include/errno.h rename to include_std/errno.h diff --git a/include/limits.h b/include_std/limits.h similarity index 100% rename from include/limits.h rename to include_std/limits.h diff --git a/include/math.h b/include_std/math.h similarity index 100% rename from include/math.h rename to include_std/math.h diff --git a/include/pthread.h b/include_std/pthread.h similarity index 100% rename from include/pthread.h rename to include_std/pthread.h diff --git a/include/sched.h b/include_std/sched.h similarity index 100% rename from include/sched.h rename to include_std/sched.h diff --git a/include/std.hpp b/include_std/std.hpp similarity index 100% rename from include/std.hpp rename to include_std/std.hpp diff --git a/include/std/atomic.hpp b/include_std/std/atomic.hpp similarity index 100% rename from include/std/atomic.hpp rename to include_std/std/atomic.hpp diff --git a/include/std/functional.hpp b/include_std/std/functional.hpp similarity index 100% rename from include/std/functional.hpp rename to include_std/std/functional.hpp diff --git a/include/std/list.hpp b/include_std/std/list.hpp similarity index 100% rename from include/std/list.hpp rename to include_std/std/list.hpp diff --git a/include/std/smart_ptr.hpp b/include_std/std/smart_ptr.hpp similarity index 100% rename from include/std/smart_ptr.hpp rename to include_std/std/smart_ptr.hpp diff --git a/include/std/stdexcept.hpp b/include_std/std/stdexcept.hpp similarity index 100% rename from include/std/stdexcept.hpp rename to include_std/std/stdexcept.hpp diff --git a/include/std/string.hpp b/include_std/std/string.hpp similarity index 100% rename from include/std/string.hpp rename to include_std/std/string.hpp diff --git a/include/std/unordered_map.hpp b/include_std/std/unordered_map.hpp similarity index 100% rename from include/std/unordered_map.hpp rename to include_std/std/unordered_map.hpp diff --git a/include/std/utility.hpp b/include_std/std/utility.hpp similarity index 100% rename from include/std/utility.hpp rename to include_std/std/utility.hpp diff --git a/include/std/vector.hpp b/include_std/std/vector.hpp similarity index 100% rename from include/std/vector.hpp rename to include_std/std/vector.hpp diff --git a/include/stddef.h b/include_std/stddef.h similarity index 100% rename from include/stddef.h rename to include_std/stddef.h diff --git a/include/stdint.h b/include_std/stdint.h similarity index 100% rename from include/stdint.h rename to include_std/stdint.h diff --git a/include/stdio.h b/include_std/stdio.h similarity index 100% rename from include/stdio.h rename to include_std/stdio.h diff --git a/include/stdlib.h b/include_std/stdlib.h similarity index 100% rename from include/stdlib.h rename to include_std/stdlib.h diff --git a/include/string.h b/include_std/string.h similarity index 100% rename from include/string.h rename to include_std/string.h diff --git a/include/string.hpp b/include_std/string.hpp similarity index 100% rename from include/string.hpp rename to include_std/string.hpp diff --git a/include/strings.h b/include_std/strings.h similarity index 100% rename from include/strings.h rename to include_std/strings.h diff --git a/include/sys/stat.h b/include_std/sys/stat.h similarity index 100% rename from include/sys/stat.h rename to include_std/sys/stat.h diff --git a/include/sys/time.h b/include_std/sys/time.h similarity index 100% rename from include/sys/time.h rename to include_std/sys/time.h diff --git a/include/sys/types.h b/include_std/sys/types.h similarity index 100% rename from include/sys/types.h rename to include_std/sys/types.h diff --git a/include/unistd.h b/include_std/unistd.h similarity index 100% rename from include/unistd.h rename to include_std/unistd.h diff --git a/include/vector b/include_std/vector similarity index 100% rename from include/vector rename to include_std/vector diff --git a/include/wchar.h b/include_std/wchar.h similarity index 100% rename from include/wchar.h rename to include_std/wchar.h