| 9 | } |
| 10 | |
| 11 | void InterruptManager::initialize() |
| 12 | { |
| 13 | // 初始化IDT |
| 14 | IDT = (uint32 *)IDT_START_ADDRESS; |
| 15 | asm_lidt(IDT_START_ADDRESS, 256 * 8 - 1); |
| 16 | |
| 17 | for (uint i = 0; i < 256; ++i) |
| 18 | { |
| 19 | setInterruptDescriptor(i, (uint32)asm_unhandled_interrupt, 0); |
| 20 | } |
| 21 | |
| 22 | } |
| 23 | |
| 24 | void InterruptManager::setInterruptDescriptor(uint32 index, uint32 address, byte DPL) |
| 25 | { |