aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.devcontainer/x86-64/devcontainer.json3
-rw-r--r--.vscode/settings.json1
-rw-r--r--.vscode/tasks.json2
-rw-r--r--CMakeLists.txt18
-rw-r--r--arch/x86_64/CMakeLists.txt37
-rw-r--r--arch/x86_64/include/arch/boot/pointers.hpp8
-rw-r--r--arch/x86_64/include/arch/exception_handling/assert.hpp17
-rw-r--r--arch/x86_64/include/arch/exception_handling/panic.hpp23
-rw-r--r--arch/x86_64/include/arch/io/port_io.hpp3
-rw-r--r--arch/x86_64/include/arch/kernel/halt.hpp13
-rw-r--r--arch/x86_64/include/arch/kernel/main.hpp10
-rw-r--r--arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp67
-rw-r--r--arch/x86_64/include/arch/memory/allocator/concept.hpp21
-rw-r--r--arch/x86_64/include/arch/memory/allocator/physical_frame.hpp86
-rw-r--r--arch/x86_64/include/arch/memory/allocator/tiny_frame_allocator.hpp74
-rw-r--r--arch/x86_64/include/arch/memory/cpu/control_register.hpp71
-rw-r--r--arch/x86_64/include/arch/memory/cpu/msr.hpp64
-rw-r--r--arch/x86_64/include/arch/memory/cpu/tlb.hpp27
-rw-r--r--arch/x86_64/include/arch/memory/heap/bump_allocator.hpp55
-rw-r--r--arch/x86_64/include/arch/memory/heap/concept.hpp22
-rw-r--r--arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp132
-rw-r--r--arch/x86_64/include/arch/memory/heap/memory_block.hpp38
-rw-r--r--arch/x86_64/include/arch/memory/main.hpp16
-rw-r--r--arch/x86_64/include/arch/memory/multiboot/elf_symbols_section.hpp169
-rw-r--r--arch/x86_64/include/arch/memory/multiboot/info.hpp64
-rw-r--r--arch/x86_64/include/arch/memory/multiboot/memory_map.hpp53
-rw-r--r--arch/x86_64/include/arch/memory/multiboot/reader.hpp53
-rw-r--r--arch/x86_64/include/arch/memory/paging/active_page_table.hpp206
-rw-r--r--arch/x86_64/include/arch/memory/paging/inactive_page_table.hpp39
-rw-r--r--arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp159
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_entry.hpp116
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_table.hpp148
-rw-r--r--arch/x86_64/include/arch/memory/paging/temporary_page.hpp64
-rw-r--r--arch/x86_64/include/arch/memory/paging/virtual_page.hpp91
-rw-r--r--arch/x86_64/include/arch/shared/container.hpp83
-rw-r--r--arch/x86_64/include/arch/shared/contiguous_pointer_iterator.hpp190
-rw-r--r--arch/x86_64/include/arch/shared/forward_value_iterator.hpp110
-rw-r--r--arch/x86_64/include/arch/shared/mutex.hpp57
-rw-r--r--arch/x86_64/include/arch/video/vga/io.hpp12
-rw-r--r--arch/x86_64/include/arch/video/vga/text.hpp96
-rw-r--r--arch/x86_64/scripts/kernel.ld51
-rw-r--r--arch/x86_64/src/boot/boot.s80
-rw-r--r--arch/x86_64/src/exception_handling/abort.cpp15
-rw-r--r--arch/x86_64/src/exception_handling/assert.cpp15
-rw-r--r--arch/x86_64/src/exception_handling/panic.cpp22
-rw-r--r--arch/x86_64/src/exception_handling/pure_virtual.cpp6
-rw-r--r--arch/x86_64/src/kernel/main.cpp64
-rw-r--r--arch/x86_64/src/memory/allocator/area_frame_allocator.cpp85
-rw-r--r--arch/x86_64/src/memory/allocator/physical_frame.cpp24
-rw-r--r--arch/x86_64/src/memory/allocator/tiny_frame_allocator.cpp34
-rw-r--r--arch/x86_64/src/memory/cpu/control_register.cpp74
-rw-r--r--arch/x86_64/src/memory/cpu/msr.cpp31
-rw-r--r--arch/x86_64/src/memory/cpu/tlb.cpp16
-rw-r--r--arch/x86_64/src/memory/heap/bump_allocator.cpp52
-rw-r--r--arch/x86_64/src/memory/heap/linked_list_allocator.cpp168
-rw-r--r--arch/x86_64/src/memory/heap/memory_block.cpp15
-rw-r--r--arch/x86_64/src/memory/main.cpp53
-rw-r--r--arch/x86_64/src/memory/multiboot/elf_symbols_section.cpp13
-rw-r--r--arch/x86_64/src/memory/multiboot/reader.cpp131
-rw-r--r--arch/x86_64/src/memory/paging/active_page_table.cpp98
-rw-r--r--arch/x86_64/src/memory/paging/inactive_page_table.cpp20
-rw-r--r--arch/x86_64/src/memory/paging/page_entry.cpp58
-rw-r--r--arch/x86_64/src/memory/paging/page_table.cpp128
-rw-r--r--arch/x86_64/src/memory/paging/temporary_page.cpp29
-rw-r--r--arch/x86_64/src/memory/paging/virtual_page.cpp33
-rw-r--r--arch/x86_64/src/shared/mutex.cpp16
-rw-r--r--arch/x86_64/src/video/vga/text.cpp42
-rw-r--r--cmake/Platforms/x86_64.cmake2
-rw-r--r--docs/arch/x86_64/boot.rst9
-rw-r--r--docs/arch/x86_64/boot/pointers.rst5
-rw-r--r--docs/arch/x86_64/exception_handling.rst9
-rw-r--r--docs/arch/x86_64/exception_handling/assert.rst5
-rw-r--r--docs/arch/x86_64/exception_handling/panic.rst5
-rw-r--r--docs/arch/x86_64/kernel.rst9
-rw-r--r--docs/arch/x86_64/kernel/halt.rst5
-rw-r--r--docs/arch/x86_64/kernel/main.rst5
-rw-r--r--docs/arch/x86_64/memory.rst9
-rw-r--r--docs/arch/x86_64/memory/allocator.rst9
-rw-r--r--docs/arch/x86_64/memory/allocator/area_frame_allocator.rst5
-rw-r--r--docs/arch/x86_64/memory/allocator/concept.rst5
-rw-r--r--docs/arch/x86_64/memory/allocator/physical_frame.rst5
-rw-r--r--docs/arch/x86_64/memory/allocator/tiny_frame_allocator.rst5
-rw-r--r--docs/arch/x86_64/memory/cpu.rst9
-rw-r--r--docs/arch/x86_64/memory/cpu/control_register.rst5
-rw-r--r--docs/arch/x86_64/memory/cpu/msr.rst5
-rw-r--r--docs/arch/x86_64/memory/cpu/tlb.rst5
-rw-r--r--docs/arch/x86_64/memory/heap.rst9
-rw-r--r--docs/arch/x86_64/memory/heap/bump_allocator.rst5
-rw-r--r--docs/arch/x86_64/memory/heap/concept.rst5
-rw-r--r--docs/arch/x86_64/memory/heap/linked_list_allocator.rst5
-rw-r--r--docs/arch/x86_64/memory/heap/memory_block.rst5
-rw-r--r--docs/arch/x86_64/memory/main.rst5
-rw-r--r--docs/arch/x86_64/memory/multiboot.rst9
-rw-r--r--docs/arch/x86_64/memory/multiboot/elf_symbols_section.rst5
-rw-r--r--docs/arch/x86_64/memory/multiboot/info.rst5
-rw-r--r--docs/arch/x86_64/memory/multiboot/memory_map.rst5
-rw-r--r--docs/arch/x86_64/memory/multiboot/reader.rst5
-rw-r--r--docs/arch/x86_64/memory/paging.rst9
-rw-r--r--docs/arch/x86_64/memory/paging/active_page_table.rst5
-rw-r--r--docs/arch/x86_64/memory/paging/inactive_page_table.rst5
-rw-r--r--docs/arch/x86_64/memory/paging/kernel_mapper.rst5
-rw-r--r--docs/arch/x86_64/memory/paging/page_entry.rst5
-rw-r--r--docs/arch/x86_64/memory/paging/page_table.rst5
-rw-r--r--docs/arch/x86_64/memory/paging/temporary_page.rst5
-rw-r--r--docs/arch/x86_64/memory/paging/virtual_page.rst5
-rw-r--r--docs/arch/x86_64/shared.rst9
-rw-r--r--docs/arch/x86_64/shared/container.rst5
-rw-r--r--docs/arch/x86_64/shared/contiguous_pointer_iterator.rst5
-rw-r--r--docs/arch/x86_64/shared/forward_value_iterator.rst5
-rw-r--r--docs/arch/x86_64/shared/mutex.rst5
-rw-r--r--include/memory/asm_pointer.hpp6
-rw-r--r--src/kernel/main.cpp8
112 files changed, 4032 insertions, 125 deletions
diff --git a/.devcontainer/x86-64/devcontainer.json b/.devcontainer/x86-64/devcontainer.json
index 6899c4c..1eb5859 100644
--- a/.devcontainer/x86-64/devcontainer.json
+++ b/.devcontainer/x86-64/devcontainer.json
@@ -10,5 +10,6 @@
"zixuanwang.linkerscript"
]
}
- }
+ },
+ "initializeCommand": "docker pull registry.gitlab.ost.ch:45023/teachos/devcontainers/x86-64:14.2.0",
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 21d4f5f..f0f6745 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -2,6 +2,7 @@
"cmake.useCMakePresets": "always",
"cmake.options.statusBarVisibility": "visible",
+ "C_Cpp.default.cppStandard": "c++20",
"C_Cpp.autoAddFileAssociations": false,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"C_Cpp.formatting": "clangFormat",
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 83b2248..2e076e4 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -38,6 +38,8 @@
"args": [
"-m",
"32M",
+ "-display",
+ "curses",
"-cdrom",
"${workspaceFolder}/build/teachos-${input:build_type}.iso"
],
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f780d3..12ac210 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,7 +27,7 @@ set(CMAKE_CXX_EXTENSIONS NO)
find_package("Doxygen")
-set(DOXYGEN_GENERATE_HTML NO)
+set(DOXYGEN_GENERATE_HTML YES)
set(DOXYGEN_GENERATE_XML YES)
set(DOXYGEN_EXCLUDE_PATTERNS "*.cpp")
set(DOXYGEN_OUTPUT_DIRECTORY "doxygen")
@@ -101,6 +101,20 @@ add_library("_video" OBJECT)
add_library("teachos::video" ALIAS "_video")
#[============================================================================[
+# THE Memory Library
+#]============================================================================]
+
+add_library("_memory" OBJECT)
+add_library("teachos::memory" ALIAS "_memory")
+
+#[============================================================================[
+# The Exception handling Library
+#]============================================================================]
+
+add_library("_exception" OBJECT)
+add_library("teachos::exception" ALIAS "_exception")
+
+#[============================================================================[
# The Kernel
#]============================================================================]
@@ -112,6 +126,8 @@ add_executable("teachos::kernel" ALIAS "_kernel")
target_link_libraries("_kernel" PRIVATE
"teachos::boot"
"teachos::video"
+ "teachos::memory"
+ "teachos::exception"
)
#[============================================================================[
diff --git a/arch/x86_64/CMakeLists.txt b/arch/x86_64/CMakeLists.txt
index 6ff1332..c5624d8 100644
--- a/arch/x86_64/CMakeLists.txt
+++ b/arch/x86_64/CMakeLists.txt
@@ -37,6 +37,43 @@ target_sources("_video" PRIVATE
)
#[============================================================================[
+# The Memory Library
+#]============================================================================]
+
+target_sources("_memory" PRIVATE
+ "src/memory/main.cpp"
+ "src/memory/multiboot/elf_symbols_section.cpp"
+ "src/memory/multiboot/reader.cpp"
+ "src/memory/allocator/area_frame_allocator.cpp"
+ "src/memory/allocator/tiny_frame_allocator.cpp"
+ "src/memory/allocator/physical_frame.cpp"
+ "src/memory/paging/page_entry.cpp"
+ "src/memory/paging/page_table.cpp"
+ "src/memory/paging/temporary_page.cpp"
+ "src/memory/paging/virtual_page.cpp"
+ "src/memory/paging/active_page_table.cpp"
+ "src/memory/paging/inactive_page_table.cpp"
+ "src/memory/cpu/tlb.cpp"
+ "src/memory/cpu/control_register.cpp"
+ "src/memory/cpu/msr.cpp"
+ "src/memory/heap/bump_allocator.cpp"
+ "src/memory/heap/memory_block.cpp"
+ "src/memory/heap/linked_list_allocator.cpp"
+ "src/shared/mutex.cpp"
+)
+
+#[============================================================================[
+# The Exception handling Library
+#]============================================================================]
+
+target_sources("_exception" PRIVATE
+ "src/exception_handling/assert.cpp"
+ "src/exception_handling/abort.cpp"
+ "src/exception_handling/panic.cpp"
+ "src/exception_handling/pure_virtual.cpp"
+)
+
+#[============================================================================[
# The Bootable ISO Image
#]============================================================================]
diff --git a/arch/x86_64/include/arch/boot/pointers.hpp b/arch/x86_64/include/arch/boot/pointers.hpp
index dcd14fe..fe9c657 100644
--- a/arch/x86_64/include/arch/boot/pointers.hpp
+++ b/arch/x86_64/include/arch/boot/pointers.hpp
@@ -5,7 +5,11 @@
namespace teachos::arch::boot