aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2025-06-06 17:15:32 +0200
committerMatteo Gmür <matteo.gmuer1@ost.ch>2025-06-06 17:15:32 +0200
commitc4ced070ab057e4be6552b2f10ec1bf35509e245 (patch)
tree91602a7732d216bff3fbaf2d6158e965460019e5
parent3fb836101a2032e93f7b82c924ce208d7377a5ea (diff)
parent1031a69ca5e23f2087148ad57e57506735872617 (diff)
downloadteachos-c4ced070ab057e4be6552b2f10ec1bf35509e245.tar.xz
teachos-c4ced070ab057e4be6552b2f10ec1bf35509e245.zip
Merge branch 'feat_inital_context_switching' into 'develop_ba'
Implement Context Switching See merge request teachos/kernel!6
-rw-r--r--.vscode/tasks.json3
-rw-r--r--CMakeLists.txt23
-rw-r--r--arch/x86_64/CMakeLists.txt58
-rw-r--r--arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/gate_descriptor.hpp69
-rw-r--r--arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/idt_flags.hpp81
-rw-r--r--arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.hpp24
-rw-r--r--arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.hpp40
-rw-r--r--arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/ist_offset.hpp45
-rw-r--r--arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/segment_selector.hpp105
-rw-r--r--arch/x86_64/include/arch/context_switching/main.hpp51
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/access_byte.hpp104
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/gdt_flags.hpp93
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/global_descriptor_table.hpp37
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/global_descriptor_table_pointer.hpp41
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor_base.hpp73
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor_extension.hpp74
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/segment_descriptor_type.hpp27
-rw-r--r--arch/x86_64/include/arch/context_switching/segment_descriptor_table/task_state_segment.hpp32
-rw-r--r--arch/x86_64/include/arch/context_switching/syscall/main.hpp88
-rw-r--r--arch/x86_64/include/arch/context_switching/syscall/syscall_enable.hpp18
-rw-r--r--arch/x86_64/include/arch/context_switching/syscall/syscall_handler.hpp18
-rw-r--r--arch/x86_64/include/arch/interrupt_handling/generic_interrupt_handler.hpp34
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/call.hpp30
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/control_register.hpp (renamed from arch/x86_64/include/arch/memory/cpu/control_register.hpp)10
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/gdtr.hpp27
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/idtr.hpp27
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/if.hpp21
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/msr.hpp (renamed from arch/x86_64/include/arch/memory/cpu/msr.hpp)10
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/segment_register.hpp97
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/tlb.hpp (renamed from arch/x86_64/include/arch/memory/cpu/tlb.hpp)12
-rw-r--r--arch/x86_64/include/arch/kernel/cpu/tr.hpp24
-rw-r--r--arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp6
-rw-r--r--arch/x86_64/include/arch/memory/allocator/physical_frame.hpp8
-rw-r--r--arch/x86_64/include/arch/memory/heap/global_heap_allocator.hpp50
-rw-r--r--arch/x86_64/include/arch/memory/heap/heap_allocator.hpp6
-rw-r--r--arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp11
-rw-r--r--arch/x86_64/include/arch/memory/heap/memory_block.hpp2
-rw-r--r--arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp148
-rw-r--r--arch/x86_64/include/arch/memory/main.hpp14
-rw-r--r--arch/x86_64/include/arch/memory/multiboot/elf_symbols_section.hpp8
-rw-r--r--arch/x86_64/include/arch/memory/multiboot/memory_map.hpp6
-rw-r--r--arch/x86_64/include/arch/memory/paging/active_page_table.hpp10
-rw-r--r--arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp45
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_entry.hpp8
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_table.hpp11
-rw-r--r--arch/x86_64/include/arch/memory/paging/virtual_page.hpp4
-rw-r--r--arch/x86_64/include/arch/stl/container.hpp (renamed from arch/x86_64/include/arch/shared/container.hpp)34
-rw-r--r--arch/x86_64/include/arch/stl/contiguous_pointer_iterator.hpp (renamed from arch/x86_64/include/arch/shared/contiguous_pointer_iterator.hpp)44
-rw-r--r--arch/x86_64/include/arch/stl/forward_value_iterator.hpp (renamed from arch/x86_64/include/arch/shared/forward_value_iterator.hpp)25
-rw-r--r--arch/x86_64/include/arch/stl/mutex.hpp (renamed from arch/x86_64/include/arch/shared/mutex.hpp)13
-rw-r--r--arch/x86_64/include/arch/stl/shared_pointer.hpp191
-rw-r--r--arch/x86_64/include/arch/stl/stack.hpp212
-rw-r--r--arch/x86_64/include/arch/stl/unique_pointer.hpp158
-rw-r--r--arch/x86_64/include/arch/stl/vector.hpp604
-rw-r--r--arch/x86_64/include/arch/user/main.hpp16
-rw-r--r--arch/x86_64/scripts/kernel.ld18
-rw-r--r--arch/x86_64/src/boot/boot.s4
-rw-r--r--arch/x86_64/src/context_switching/interrupt_descriptor_table/gate_descriptor.cpp24
-rw-r--r--arch/x86_64/src/context_switching/interrupt_descriptor_table/idt_flags.cpp17
-rw-r--r--arch/x86_64/src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table.cpp53
-rw-r--r--arch/x86_64/src/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer.cpp13
-rw-r--r--arch/x86_64/src/context_switching/interrupt_descriptor_table/ist_offset.cpp10
-rw-r--r--arch/x86_64/src/context_switching/interrupt_descriptor_table/segment_selector.cpp15
-rw-r--r--arch/x86_64/src/context_switching/main.cpp63
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/access_byte.cpp17
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/gdt_flags.cpp20
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/global_descriptor_table.cpp109
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/global_descriptor_table_pointer.cpp11
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/segment_descriptor_base.cpp38
-rw-r--r--arch/x86_64/src/context_switching/segment_descriptor_table/segment_descriptor_extension.cpp24
-rw-r--r--arch/x86_64/src/context_switching/syscall/main.cpp35
-rw-r--r--arch/x86_64/src/context_switching/syscall/syscall_enable.cpp32
-rw-r--r--arch/x86_64/src/context_switching/syscall/syscall_handler.cpp118
-rw-r--r--arch/x86_64/src/interrupt_handling/generic_interrupt_handler.cpp13
-rw-r--r--arch/x86_64/src/kernel/cpu/call.cpp9
-rw-r--r--arch/x86_64/src/kernel/cpu/control_register.cpp (renamed from arch/x86_64/src/memory/cpu/control_register.cpp)12
-rw-r--r--arch/x86_64/src/kernel/cpu/gdtr.cpp19
-rw-r--r--arch/x86_64/src/kernel/cpu/idtr.cpp18
-rw-r--r--arch/x86_64/src/kernel/cpu/if.cpp7
-rw-r--r--arch/x86_64/src/kernel/cpu/msr.cpp (renamed from arch/x86_64/src/memory/cpu/msr.cpp)8
-rw-r--r--arch/x86_64/src/kernel/cpu/segment_register.cpp98
-rw-r--r--arch/x86_64/src/kernel/cpu/tlb.cpp (renamed from arch/x86_64/src/memory/cpu/tlb.cpp)10
-rw-r--r--arch/x86_64/src/kernel/cpu/tr.cpp16
-rw-r--r--arch/x86_64/src/kernel/main.cpp12
-rw-r--r--arch/x86_64/src/memory/allocator/area_frame_allocator.cpp2
-rw-r--r--arch/x86_64/src/memory/heap/bump_allocator.cpp4
-rw-r--r--arch/x86_64/src/memory/heap/global_heap_allocator.cpp95
-rw-r--r--arch/x86_64/src/memory/heap/linked_list_allocator.cpp6
-rw-r--r--arch/x86_64/src/memory/heap/memory_block.cpp4
-rw-r--r--arch/x86_64/src/memory/heap/user_heap_allocator.cpp200
-rw-r--r--arch/x86_64/src/memory/main.cpp64
-rw-r--r--arch/x86_64/src/memory/paging/page_entry.cpp5
-rw-r--r--arch/x86_64/src/memory/paging/temporary_page.cpp8
-rw-r--r--arch/x86_64/src/stl/mutex.cpp (renamed from arch/x86_64/src/shared/mutex.cpp)6
-rw-r--r--arch/x86_64/src/user/main.cpp35
-rw-r--r--docs/arch/x86_64/context_switching.rst9
-rw-r--r--docs/arch/x86_64/context_switching/interrupt_descriptor_table.rst9
-rw-r--r--docs/arch/x86_64/context_switching/interrupt_descriptor_table/gate_descriptor.rst5
-rw-r--r--docs/arch/x86_64/context_switching/interrupt_descriptor_table/idt_flags.rst5
-rw-r--r--docs/arch/x86_64/context_switching/interrupt_descriptor_table/interrupt_descriptor_table copy.rst5
-rw-r--r--docs/arch/x86_64/context_switching/interrupt_descriptor_table/interrupt_descriptor_table_pointer copy.rst5
-rw-r--r--docs/arch/x86_64/context_switching/interrupt_descriptor_table/ist_offset.rst5
-rw-r--r--docs/arch/x86_64/context_switching/interrupt_descriptor_table/segment_selector.rst5
-rw-r--r--docs/arch/x86_64/context_switching/main.rst5
-rw-r--r--docs/arch/x86_64/context_switching/segment_descriptor_table.rst9
-rw-r--r--docs/arch/x86_64/context_switching/segment_descriptor_table/access_byte.rst5
-rw-r--r--docs/arch/x86_64/context_switching/segment_descriptor_table/gdt_flags.rst5
-rw-r--r--docs/arch/x86_64/context_switching/segment_descriptor_table/global_descriptor_table.rst5
-rw-r--r--docs/arch/x86_64/context_switching/segment_descriptor_table/global_descriptor_table_pointer.rst5
-rw-r--r--docs/arch/x86_64/context_switching/segment_descriptor_table/segment_descriptor_base.rst5
-rw-r--r--docs/arch/x86_64/context_switching/segment_descriptor_table/segment_descriptor_extension.rst5
-rw-r--r--docs/arch/x86_64/context_switching/segment_descriptor_table/segment_descriptor_type.rst5
-rw-r--r--docs/arch/x86_64/context_switching/segment_descriptor_table/task_state_segment.rst5
-rw-r--r--docs/arch/x86_64/context_switching/syscall.rst9
-rw-r--r--docs/arch/x86_64/context_switching/syscall/main.rst5
-rw-r--r--docs/arch/x86_64/context_switching/syscall/syscall_enable.rst5
-rw-r--r--docs/arch/x86_64/context_switching/syscall/syscall_handler.rst5
-rw-r--r--</