I read in one topic that we can't use interrupts in 32 bits mode. I have two questions :
- Why ?
- So in the 32 bits mode the INT instruction is totally useless ?
Thanks
Yes unless you are writing very low level drivers for ring0.
Use the Windows API functions.
Quote from: ookami on February 15, 2011, 08:54:43 AM
I read in one topic that we can't use interrupts in 32 bits mode. I have two questions :
- Why ?
- So in the 32 bits mode the INT instruction is totally useless ?
You
can use the INT instruction in 32-bits of course. The problem is that many ints won't do anything else than a GPF. Exceptions are: INT 3 (which is similar to DebugBreak()), INT 2Eh (which is/was used to call the "native API"), ...
So the INT instruction is
not totally useless, but just not used that often anymore.
Thank you. :U
But why does that make a GPF ? What exactly the problem ?
Hi,
Why? Because the people that wrote Windows as a 32-bit
protected mode operating system decided to use CALL to
access the API rather than using INT. So an interrupt is
generally just not supported. And if it is not supported, it
is an error. GPF.
To a different why, DOS used INT to access its various
functions. As DOS went through newer versions and both
Microsoft and third parties added functions, the interrupt
"chain" became rather complex and "slow". And that is a
possible explanation for not wanting to use interrupts for
the more complex API of Windows. Though that is just
a guess of course.
Cheers,
Steve N.
privilege level :P
http://www.informit.com/articles/article.aspx?p=22442
I can't run this code right now cuz I am a Vista System.
NtQuerySystemInformation:
mov eax, 97h
lea edx, [esp+4]
int 2Eh
ret 10h
Thank you everybody !