Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern "C" uintptr_t __interrupt_handlers[256];
- namespace system {
- namespace interrupts {
- static idt _idt = {};
- void init() {
- for (int i = 0; i < 256; i++) {
- _idt.entries[i] = {__interrupt_handlers[i], 0, type::Gate};
- }
- idt_descriptor descriptor = {
- (uint16_t)sizeof(idt_entry) * 256 - 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