aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/user/main.cpp
blob: 747a8a46b50e893f266196a32d68ece1c547b8d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "arch/user/main.hpp"

#include "arch/context_switching/syscall/main.hpp"
#include "arch/memory/heap/global_heap_allocator.hpp"

#include <algorithm>
#include <atomic>

namespace teachos::arch::user
{
  auto main() -> void
  {
    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<uint64_t>(&syscall_message)});

    int test = std::max(5, 10);
    (void)test;

    std::atomic<bool> locked = {false};
    locked.exchange(true);

    auto address = memory::heap::global_heap_allocator::malloc(8U);
    (void)address;

    for (;;)
    {
    }
  }
}  // namespace teachos::arch::user