How does Windows switch to supervisor mode during a system call?

How does Windows switch to supervisor mode during a system call? I heard something about trap 0, but it doesn't even look like an x86 instruction. I went through some system calls, but I cannot find them. Are there many Windows system calls in user mode? Which DO runs in supervisor mode?

+3
source share
2 answers

A system call is also known as a software interrupt. An x86 instruction that causes a software interrupt has a mnemonic INT . How data is transferred to the operating system is determined by the ABI operating system. As far as I know, Windows uses 0x80 at once for all its routines and sends additional data through registers, but I'm not sure. 0x20 is the first available immediately because the range from 0 to 31 is reserved and is used for general exceptions, such as integer division by zero and memory errors.

, , IDTR ( Interupt). IDT ( Interupt) IDT 8- . IDT , . IDTR / LIDT SIDT. IDT , , INT.

win32-, .. hm. printf , EnterCriticalSection. Windows Vista Windows 7 OpenGL DirectX API - . OpenGL , backbuffer, glReadPixels, glCopy (Sub) TexImage2D ..

P.S: . , Windows , . .

Intel 386 ( )

+3

x86 SYSENTER SYSEXIT. , , , , .

Intel, 2B

+4

Source: https://habr.com/ru/post/1722070/


All Articles