aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-12-15 17:13:12 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-12-15 17:13:12 +0100
commit7b9482ae637126ac9337876e60f519b493437711 (patch)
tree6fc71a253c8b0325d303bd34c95b564ba536ed14
parent116f9332a206767c45095950f09f7c7447b561cf (diff)
parenta9eeec745e29d89afd48ee43d09432eb6fc35be7 (diff)
downloadteachos-7b9482ae637126ac9337876e60f519b493437711.tar.xz
teachos-7b9482ae637126ac9337876e60f519b493437711.zip
os: rework kernel architecture
Rework the code structure and architecture of the kernel by separating platform-dependent and platform-independent code more cleanly. As of this patchset, full feature parity has not been achieved. Nonetheless, a sufficient subset of functionality has been ported to the new architecture to demonstrate the feasibility of the new structure.
-rw-r--r--.clang-format163
-rw-r--r--.clang-tidy7
-rw-r--r--.clangd3
-rw-r--r--.devcontainer/x86-64/devcontainer.json37
-rw-r--r--.gitignore14
-rw-r--r--.vscode/extensions.json6
-rw-r--r--.vscode/launch.json31
-rw-r--r--.vscode/settings.json42
-rw-r--r--.vscode/tasks.json6
-rw-r--r--CMakeLists.txt151
-rw-r--r--CMakePresets.json25
-rw-r--r--Doxyfile2974
-rw-r--r--arch/x86_64/CMakeLists.txt176
-rw-r--r--arch/x86_64/include/arch/boot/pointers.hpp15
-rw-r--r--arch/x86_64/include/arch/io/port_io.hpp133
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/control_register.hpp71
-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/main.hpp30
-rw-r--r--arch/x86_64/include/arch/memory/multiboot/elf_symbols_section.hpp169
-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.hpp180
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_entry.hpp121
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_table.hpp157
-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/stl/container.hpp99
-rw-r--r--arch/x86_64/include/arch/stl/contiguous_pointer_iterator.hpp216
-rw-r--r--arch/x86_64/include/arch/stl/forward_value_iterator.hpp121
-rw-r--r--arch/x86_64/include/arch/video/vga/io.hpp39
-rw-r--r--arch/x86_64/include/arch/video/vga/text.hpp169
-rw-r--r--arch/x86_64/include/x86_64/boot/boot.hpp70
-rw-r--r--arch/x86_64/include/x86_64/boot/ld.hpp61
-rw-r--r--arch/x86_64/include/x86_64/cpu/control_register.hpp244
-rw-r--r--arch/x86_64/include/x86_64/cpu/model_specific_register.hpp148
-rw-r--r--arch/x86_64/include/x86_64/cpu/registers.hpp30
-rw-r--r--arch/x86_64/include/x86_64/device_io/port_io.hpp101
-rw-r--r--arch/x86_64/include/x86_64/memory/buffered_allocator.hpp68
-rw-r--r--arch/x86_64/include/x86_64/memory/kernel_mapper.hpp32
-rw-r--r--arch/x86_64/include/x86_64/memory/mmu.hpp (renamed from arch/x86_64/include/arch/kernel/cpu/tlb.hpp)14
-rw-r--r--arch/x86_64/include/x86_64/memory/page_table.hpp341
-rw-r--r--arch/x86_64/include/x86_64/memory/page_utilities.hpp22
-rw-r--r--arch/x86_64/include/x86_64/memory/paging_root.hpp27
-rw-r--r--arch/x86_64/include/x86_64/memory/recursive_page_mapper.hpp23
-rw-r--r--arch/x86_64/include/x86_64/memory/region_allocator.hpp79
-rw-r--r--arch/x86_64/include/x86_64/memory/scoped_mapping.hpp66
-rw-r--r--arch/x86_64/include/x86_64/vga/crtc.hpp39
-rw-r--r--arch/x86_64/include/x86_64/vga/text.hpp178
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/interrupt_descriptor_table/gate_descriptor.hpp (renamed from arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/gate_descriptor.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/interrupt_descriptor_table/idt_flags.hpp (renamed from arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/idt_flags.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.hpp (renamed from arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.hpp (renamed from arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/interrupt_descriptor_table/ist_offset.hpp (renamed from arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/ist_offset.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/interrupt_descriptor_table/segment_selector.hpp (renamed from arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/segment_selector.hpp)6
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/main.hpp (renamed from arch/x86_64/include/arch/context_switching/main.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/segment_descriptor_table/access_byte.hpp (renamed from arch/x86_64/include/arch/context_switching/segment_descriptor_table/access_byte.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/segment_descriptor_table/gdt_flags.hpp (renamed from arch/x86_64/include/arch/context_switching/segment_descriptor_table/gdt_flags.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/segment_descriptor_table/global_descriptor_table.hpp (renamed from arch/x86_64/include/arch/context_switching/segment_descriptor_table/global_descriptor_table.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/segment_descriptor_table/global_descriptor_table_pointer.hpp (renamed from arch/x86_64/include/arch/context_switching/segment_descriptor_table/global_descriptor_table_pointer.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/segment_descriptor_table/segment_descriptor_base.hpp (renamed from arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor_base.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/segment_descriptor_table/segment_descriptor_extension.hpp (renamed from arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor_extension.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/segment_descriptor_table/segment_descriptor_type.hpp (renamed from arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor_type.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/segment_descriptor_table/task_state_segment.hpp (renamed from arch/x86_64/include/arch/context_switching/segment_descriptor_table/task_state_segment.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/syscall/main.hpp (renamed from arch/x86_64/include/arch/context_switching/syscall/main.hpp)5
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/syscall/syscall_enable.hpp (renamed from arch/x86_64/include/arch/context_switching/syscall/syscall_enable.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/context_switching/syscall/syscall_handler.hpp (renamed from arch/x86_64/include/arch/context_switching/syscall/syscall_handler.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/exception_handling/assert.hpp (renamed from arch/x86_64/include/arch/exception_handling/assert.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/exception_handling/panic.hpp (renamed from arch/x86_64/include/arch/exception_handling/panic.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/interrupt_handling/generic_interrupt_handler.hpp (renamed from arch/x86_64/include/arch/interrupt_handling/generic_interrupt_handler.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/kernel/cpu/call.hpp (renamed from arch/x86_64/include/arch/kernel/cpu/call.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/kernel/cpu/gdtr.hpp (renamed from arch/x86_64/include/arch/kernel/cpu/gdtr.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/kernel/cpu/idtr.hpp (renamed from arch/x86_64/include/arch/kernel/cpu/idtr.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/kernel/cpu/if.hpp (renamed from arch/x86_64/include/arch/kernel/cpu/if.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/kernel/cpu/msr.hpp (renamed from arch/x86_64/include/arch/kernel/cpu/msr.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/kernel/cpu/segment_register.hpp (renamed from arch/x86_64/include/arch/kernel/cpu/segment_register.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/kernel/cpu/tr.hpp (renamed from arch/x86_64/include/arch/kernel/cpu/tr.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/kernel/halt.hpp (renamed from arch/x86_64/include/arch/kernel/halt.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/kernel/main.hpp (renamed from arch/x86_64/include/arch/kernel/main.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/memory/heap/bump_allocator.hpp (renamed from arch/x86_64/include/arch/memory/heap/bump_allocator.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/memory/heap/global_heap_allocator.hpp (renamed from arch/x86_64/include/arch/memory/heap/global_heap_allocator.hpp)19
-rw-r--r--arch/x86_64/pre/include/arch/memory/heap/heap_allocator.hpp (renamed from arch/x86_64/include/arch/memory/heap/heap_allocator.hpp)8
-rw-r--r--arch/x86_64/pre/include/arch/memory/heap/linked_list_allocator.hpp (renamed from arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp)10
-rw-r--r--arch/x86_64/pre/include/arch/memory/heap/memory_block.hpp (renamed from arch/x86_64/include/arch/memory/heap/memory_block.hpp)0
-rw-r--r--arch/x86_64/pre/include/arch/memory/heap/user_heap_allocator.hpp (renamed from arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp)11
-rw-r--r--arch/x86_64/pre/include/arch/user/main.hpp (renamed from arch/x86_64/include/arch/user/main.hpp)0
-rw-r--r--arch/x86_64/pre/src/context_switching/interrupt_descriptor_table/gate_descriptor.cpp (renamed from arch/x86_64/src/context_switching/interrupt_descriptor_table/gate_descriptor.cpp)0
-rw-r--r--arch/x86_64/pre/src/context_switching/interrupt_descriptor_table/idt_flags.cpp (renamed from arch/x86_64/src/context_switching/interrupt_descriptor_table/idt_flags.cpp)5
-rw-r--r--arch/x86_64/pre/src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.cpp (renamed from arch/x86_64/src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.cpp)2
-rw-r--r--arch/x86_64/pre/src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.cpp (renamed from arch/x86_64/src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.cpp)0
-rw-r--r--arch/x86_64/pre/src/context_switching/interrupt_descriptor_table/ist_offset.cpp (renamed from arch/x86_64/src/context_switching/interrupt_descriptor_table/ist_offset.cpp)0
-rw-r--r--arch/x86_64/pre/src/context_switching/interrupt_descriptor_table/segment_selector.cpp (renamed from arch/x86_64/src/context_switching/interrupt_descriptor_table/segment_selector.cpp)15
-rw-r--r--arch/x86_64/pre/src/context_switching/main.cpp (renamed from arch/x86_64/src/context_switching/main.cpp)13
-rw-r--r--arch/x86_64/pre/src/context_switching/segment_descriptor_table/access_byte.cpp (renamed from arch/x86_64/src/context_switching/segment_descriptor_table/access_byte.cpp)5
-rw-r--r--arch/x86_64/pre/src/context_switching/segment_descriptor_table/gdt_flags.cpp (renamed from arch/x86_64/src/context_switching/segment_descriptor_table/gdt_flags.cpp)10
-rw-r--r--arch/x86_64/pre/src/context_switching/segment_descriptor_table/global_descriptor_table.cpp (renamed from arch/x86_64/src/context_switching/segment_descriptor_table/global_descriptor_table.cpp)10
-rw-r--r--arch/x86_64/pre/src/context_switching/segment_descriptor_table/global_descriptor_table_pointer.cpp (renamed from arch/x86_64/src/context_switching/segment_descriptor_table/global_descriptor_table_pointer.cpp)0
-rw-r--r--arch/x86_64/pre/src/context_switching/segment_descriptor_table/segment_descriptor_base.cpp (renamed from arch/x86_64/src/context_switching/segment_descriptor_table/segment_descriptor_base.cpp)5
-rw-r--r--arch/x86_64/pre/src/context_switching/segment_descriptor_table/segment_descriptor_extension.cpp (renamed from arch/x86_64/src/context_switching/segment_descriptor_table/segment_descriptor_extension.cpp)10
-rw-r--r--arch/x86_64/pre/src/context_switching/syscall/main.cpp (renamed from arch/x86_64/src/context_switching/syscall/main.cpp)2
-rw-r--r--arch/x86_64/pre/src/context_switching/syscall/syscall_enable.cpp (renamed from arch/x86_64/src/context_switching/syscall/syscall_enable.cpp)10
-rw-r--r--arch/x86_64/pre/src/context_switching/syscall/syscall_handler.cpp (renamed from arch/x86_64/src/context_switching/syscall/syscall_handler.cpp)11
-rw-r--r--