#include "arch/user/main.hpp" #include "arch/context_switching/syscall/main.hpp" #include "arch/memory/heap/global_heap_allocator.hpp" #include #include #include #include namespace teachos::arch::user { auto main() -> void { // Test writing to VGA Buffer char constexpr syscall_message[] = "Successfully entered user mode and wrote to VGA buffer via syscall!"; context_switching::syscall::syscall(context_switching::syscall::type::WRITE, {reinterpret_cast(&syscall_message)}); // Test C++ standard library std::array, 4> array_test = {std::atomic{5}, std::atomic{10}, std::atomic{15}, std::atomic{20}}; std::ranges::for_each(array_test, [](auto & item) { auto value = item.load(); uint8_t max_value = std::max(value, uint8_t{10}); item.exchange(max_value + 2); }); // Test user heap auto address = memory::heap::global_heap_allocator::malloc(8U); (void)address; for (;;) { } } } // namespace teachos::arch::user