22#if defined(IGROS_ARCH_i386)
28#elif defined(IGROS_ARCH_x86_64)
64 void x86::native::idt::setPointer(
const pointer_t &pointer)
noexcept {
71 void x86::native::idt::init() noexcept {
74 constexpr auto KERNEL_CODE {x86::native::gdt::KERNEL_CODE};
76 constexpr auto INTERRUPT_GATE {0x8E_u8};
86 const auto gate = [](
const std::add_pointer_t<void()
noexcept> handler)
noexcept {
100#if defined(IGROS_ARCH_i386)
103 constexpr auto TASK_GATE {0x85_u8};
104 table[vector(DOUBLE_FAULT)] =
idt::setEntry(
nullptr, x86::native::gdt::TSS_DOUBLE_FAULT, TASK_GATE);
106#elif defined(IGROS_ARCH_x86_64)
109 table[vector(DOUBLE_FAULT)].ist =
static_cast<igros_byte_t>(x86::native::tss::IST::DOUBLE_FAULT);
110 table[vector(NON_MASKABLE_IRQ)].ist =
static_cast<igros_byte_t>(x86::native::tss::IST::NMI);
111 table[vector(MACHINE_CHECK)].ist =
static_cast<igros_byte_t>(x86::native::tss::IST::MACHINE_CHECK);
118 .pointer = table.data(),
NUMBER
Exceptions number enumeration.
static constexpr auto calcSize(const table_t &table) noexcept -> igros_word_t
Calc IDT size.
std::array< entry_t, IDT_SIZE > table_t
IDT table type.
static auto setEntry(const offset_t handle, const igros_word_t selector, const igros_byte_t type) noexcept -> entry_t
Make IDT entry.
static void setPointer(const pointer_t &pointer) noexcept
Set IDT pointer.
Exceptions low-level operations.
const std::add_pointer_t< void() noexcept > exHandlerTable[32]
Exception handlers addresses, indexed by exception number (exceptions.s).
std::size_t igros_usize_t
Unsigned size.
std::uint8_t igros_byte_t
8-bit unsigned integer
Global descriptor table low-level operations.
Interrupt descriptor table low-level operations.
void idtStore(igros::x86::native::idt::pointer_t *const idtPtr) noexcept
Store IDT.
void idtLoad(const igros::x86::native::idt::pointer_t *const idtPtr) noexcept
Load IDT.
constexpr auto IRQ_LINES
Number of PIC interrupt lines.
constexpr auto irqVector(const irq_t line) noexcept -> igros_usize_t
Interrupt vector of IRQ line.
constexpr auto IRQ_OFFSET
IRQ offset in ISR list.
IgrOS kernel: common types and literals.
x86 family current (native) architecture selection
Interrupts low-level operations.
const std::add_pointer_t< void() noexcept > irqHandlerTable[16]
IRQ handlers addresses, indexed by IRQ line (irq.s).
Global descriptor table low-level operations.
Interrupt descriptor table low-level operations.
Task state segment (x86_64).