Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Assembly prototype
- extern "C" uintptr_t __interrupt_handlers[256];
- namespace system {
- namespace interrupts {
- static idt _idt = {};
- void init() {
- for (size_t i = 0; i < 256; i++) {
- _idt.entries[i] = {__interrupt_handlers[i], 0, type::Gate};
- }
- idt_descriptor descriptor = {
- sizeof(idt) - 1,
- reinterpret_cast<uintptr_t>(&_idt),
- };
- descriptor.load();
- log::info.print("IDT Initialization - Success");
- }
- } // namespace interrupts
- } // namespace system
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement