Hello every body.
I have a simple question , shall I install the IDT befor enabling the protected mode or it dosn't matter . because I don't have enough space in my bootloader (4 bytes).
IDT questions
-
- Member
- Posts: 199
- Joined: Fri Jul 13, 2007 6:37 am
- Location: Stuttgart/Germany
- Contact:
You can do it in either mode, but you must disable interrupts prior to entering pmode or installing the idt, and only enable interrupts after p-mode and the idt was installed.
When you install the pmode idt, you are replacing the real mode idt so not disabling interrupts will cause the cpu to use the wrong idt.
Use cli to disable maskable interrupts, and use sti to enable them.
Non-maskable interrupts can still happen so its best to make sure that no errors occur in the time it takes you to switch modes and update idt or else you will crash- its best to place lidt and the pmode switch as close as possible and to avoid doing anything in between them.
When you install the pmode idt, you are replacing the real mode idt so not disabling interrupts will cause the cpu to use the wrong idt.
Use cli to disable maskable interrupts, and use sti to enable them.
Non-maskable interrupts can still happen so its best to make sure that no errors occur in the time it takes you to switch modes and update idt or else you will crash- its best to place lidt and the pmode switch as close as possible and to avoid doing anything in between them.