aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/pre/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/pre/src/kernel')
-rw-r--r--arch/x86_64/pre/src/kernel/cpu/call.cpp9
-rw-r--r--arch/x86_64/pre/src/kernel/cpu/idtr.cpp18
-rw-r--r--arch/x86_64/pre/src/kernel/cpu/if.cpp13
-rw-r--r--arch/x86_64/pre/src/kernel/cpu/tr.cpp16
-rw-r--r--arch/x86_64/pre/src/kernel/main.cpp71
5 files changed, 0 insertions, 127 deletions
diff --git a/arch/x86_64/pre/src/kernel/cpu/call.cpp b/arch/x86_64/pre/src/kernel/cpu/call.cpp
deleted file mode 100644
index 98fa248..0000000
--- a/arch/x86_64/pre/src/kernel/cpu/call.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "arch/kernel/cpu/call.hpp"
-
-namespace teachos::arch::kernel::cpu
-{
- auto call(far_pointer pointer) -> void
- {
- asm volatile("rex64 lcall *%[input]" : /* no output from call */ : [input] "m"(pointer));
- }
-} // namespace teachos::arch::kernel::cpu
diff --git a/arch/x86_64/pre/src/kernel/cpu/idtr.cpp b/arch/x86_64/pre/src/kernel/cpu/idtr.cpp
deleted file mode 100644
index 7aa20c1..0000000
--- a/arch/x86_64/pre/src/kernel/cpu/idtr.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "arch/kernel/cpu/idtr.hpp"
-
-namespace teachos::arch::kernel::cpu
-{
- auto store_interrupt_descriptor_table()
- -> context_switching::interrupt_descriptor_table::interrupt_descriptor_table_pointer
- {
- context_switching::interrupt_descriptor_table::interrupt_descriptor_table_pointer current_value{};
- asm("sidt %[output]" : [output] "=m"(current_value));
- return current_value;
- }
-
- auto load_interrupt_descriptor_table(
- context_switching::interrupt_descriptor_table::interrupt_descriptor_table_pointer const & idt_pointer) -> void
- {
- asm volatile("lidt %[input]" : /* no output from call */ : [input] "m"(idt_pointer));
- }
-} // namespace teachos::arch::kernel::cpu
diff --git a/arch/x86_64/pre/src/kernel/cpu/if.cpp b/arch/x86_64/pre/src/kernel/cpu/if.cpp
deleted file mode 100644
index 5d056fc..0000000
--- a/arch/x86_64/pre/src/kernel/cpu/if.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace teachos::arch::kernel::cpu
-{
- auto set_interrupt_flag() -> void
- {
- asm volatile("sti");
- }
-
- auto clear_interrupt_flag() -> void
- {
- asm volatile("cli");
- }
-
-} // namespace teachos::arch::kernel::cpu
diff --git a/arch/x86_64/pre/src/kernel/cpu/tr.cpp b/arch/x86_64/pre/src/kernel/cpu/tr.cpp
deleted file mode 100644
index a435540..0000000
--- a/arch/x86_64/pre/src/kernel/cpu/tr.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "arch/kernel/cpu/tr.hpp"
-
-namespace teachos::arch::kernel::cpu
-{
- auto store_task_register() -> uint16_t
- {
- uint16_t current_value{};
- asm("str %[output]" : [output] "=r"(current_value));
- return current_value;
- }
-
- auto load_task_register(uint16_t gdt_offset) -> void
- {
- asm volatile("ltr %[input]" : /* no output from call */ : [input] "m"(gdt_offset));
- }
-} // namespace teachos::arch::kernel::cpu
diff --git a/arch/x86_64/pre/src/kernel/main.cpp b/arch/x86_64/pre/src/kernel/main.cpp
deleted file mode 100644
index 43b5f90..0000000
--- a/arch/x86_64/pre/src/kernel/main.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-#include "arch/kernel/main.hpp"
-
-#include "arch/boot/pointers.hpp"
-#include "arch/context_switching/interrupt_descriptor_table/segment_selector.hpp"
-#include "arch/context_switching/main.hpp"
-#include "arch/kernel/cpu/if.hpp"
-#include "arch/kernel/cpu/segment_register.hpp"
-#include "arch/memory/heap/bump_allocator.hpp"
-#include "arch/memory/heap/global_heap_allocator.hpp"
-#include "arch/memory/main.hpp"
-#include "arch/memory/multiboot/reader.hpp"
-#include "arch/stl/vector.hpp"
-#include "arch/video/vga/text.hpp"
-
-namespace teachos::arch::kernel
-{
- auto stack_overflow_test(int count) -> int
- {
- int test[5000] = {};
- if (test[0] == 0xFFFF)
- {
- return count;
- }
- count = stack_overflow_test(count);
- return count++;
- }
-
- auto heap_test() -> void
- {
- auto test2 = new memory::multiboot::memory_information{};
- auto test3 = new memory::multiboot::memory_information{};
- auto test4 = *test2;
- auto test5 = *test3;
- test4.kernel_end = 5000;
- test5.kernel_end = 3000;
- auto test6 = test4.kernel_end;
- auto test7 = test5.kernel_end;
- auto test8 = memory::multiboot::read_multiboot2();
- if (test6 && test7 && test8.kernel_end)
- {
- video::vga::text::write("Heap test successful", video::vga::text::common_attributes::green_on_black);
- }
- test2->kernel_end = 2000;
- test2->kernel_start = 1000;
- test2->multiboot_start = 2000;
- delete test2;
- delete test3;
-
- auto test9 = new int(50);
- delete test9;
- }
-
- auto main() -> void
- {
- video::vga::text::clear();
- video::vga::text::cursor(false);
- video::vga::text::write("TeachOS is starting up...", video::vga::text::common_attributes::green_on_black);
- video::vga::text::newline();
-
- memory::initialize_memory_management();
- // stack_overflow_test(0);
-
- memory::heap::global_heap_allocator::register_heap_allocator(memory::heap::heap_allocator_type::LINKED_LIST);
- // heap_test();
-
- auto address = memory::heap::global_heap_allocator::kmalloc(8U);
- (void)address;
-
- context_switching::switch_to_user_mode();
- }
-} // namespace teachos::arch::kernel