Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void IDTEntry(int num, unsigned int offset, uint16_t selector, uint8_t gate_type, uint8_t dpl){
- uint64_t entry = 0;
- entry = entry | (((uint64_t)offset & 0x0000FFFF) << 0);
- entry = entry | (((uint64_t)selector & 0xFFFF) << 16);
- // 8 bits reseentryed (next is 40)
- entry = entry | (((uint64_t)gate_type & 0xF) << 40);
- // 1 bits reseentryed (next is 45)
- entry = entry | (((uint64_t)dpl & 0b11) << 45);
- uint64_t thingy = 0b1;
- entry = entry | (((uint64_t)thingy & 0b1) << 47);
- entry = entry | (((uint64_t)offset & 0xFFFF0000) << 48);
- IDT[num] = entry;
- }
Advertisement
Add Comment
Please, Sign In to add comment