IgrOS-Kernel 0.1.34.545
Simple C++20 Kernel for i386/x86_64
Loading...
Searching...
No Matches
native.hpp
Go to the documentation of this file.
1
11
12
13#pragma once
14
15
16#if defined(IGROS_ARCH_i386)
17
18// IgrOS-Kernel arch i386
19#include <arch/i386/cpu.hpp>
21
22#elif defined(IGROS_ARCH_x86_64)
23
24// IgrOS-Kernel arch x86_64
25#include <arch/x86_64/cpu.hpp>
27
28#else
29
30#error "x86 code built for non-x86 architecture!"
31
32#endif
33
34
35// x86 namespace
36namespace igros::x86 {
37
38
39#if defined(IGROS_ARCH_i386)
40
42 namespace native = igros::i386;
44 constexpr auto ARCH_NAME {"i386"};
45
46#elif defined(IGROS_ARCH_x86_64)
47
49 namespace native = igros::x86_64;
51 constexpr auto ARCH_NAME {"x86_64"};
52
53#endif
54
55
57 using native::cpu;
59 using native::register_t;
60
61
62} // namespace igros::x86
63
CPU operations.
Task switch registers data structure.
x86_64 (long mode): GDT, IDT, TSS, CPUID, MSR, CPU registers
Code shared by i386 and x86_64: ports, interrupts, exceptions, paging.
constexpr auto ARCH_NAME
Current architecture.
Definition native.hpp:51
CPU operations.
Task switch registers data structure.