As we mentioned previously, the OS is divided into two parts: user mode and kernel mode. This is demonstrated in the following diagram:
Figure 2: The Windows OS design
Now, let's learn about the scope of these applications:
- User mode: This contains all the processes running in the system (which you can see in task manager). These processes are running under subsystems such as POSIX, the Win32 subsystem, and (more recently) the Windows subsystem for Linux. All of these subsystems call different APIs, which are tailored for that system through specific libraries, such as kernel32.dll in the Win32 and Win64 subsystems.
All of these Dynamic-Link Libraries (DLLs) call APIs in one DLL (ntdll.dll), which communicates directly to the kernel mode. Ntdll.dll is a library that sends requests to the kernel using special instructions, such as sysenter or syscall (depending on the mode and whether it is Intel or AMD; in this chapter, we will be using them interchangeably...