IVT and Protected mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
AlfaOmega08
Member
Member
Posts: 226
Joined: Wed Nov 07, 2007 12:15 pm
Location: Italy

IVT and Protected mode

Post by AlfaOmega08 »

In the piece of memory between 0x0 and 0x3FF, there is the IVT right?
The IVT is a 4-byte entry table. Each entry points to the code of an interrupt...

If I parse that zone of memory, I can find the code of the ints, can't I?
Then I can create some IDT descriptors (0x30 = int 0, 0x31 = int 1, ...) with as base, the value I found in the table (adapted for protected mode)

Can I do all this wonderful things? Or when switching to pmode, the IVT goes lost?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Each entry points to the code of an interrupt...
The interrupt handling code is 16 bits - real mode code. It can't be run in a 32bit protected mode environment.
tjhastings
Posts: 12
Joined: Sat Feb 02, 2008 5:49 pm

Post by tjhastings »

The IVT is not lost when you switch to protected mode. It may be possible to do as you suggest using the right call gates; as I recall they could be set to transfer execution between 32 and 16-bit code.

Check out chapter 16 of the Intel Software Developer's Manual Volume 3A

- TJ
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

The code referenced from the IDT will still assume real mode, not protected mode. If you want to make bios calls, you either have to leave protected mode, or use v8086
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply