@OSdev_ ↔ @mmoustafa8108 ↔ @ivanrouzanov conversation

OS Dev@OSdev_
13 views
Aug 26, 2026
~1 min read
Advertisement

OS Dev@OSdev_
When a Windows process starts, where does the Windows loader actually run, and how does execution reach user code?

Mohammed Moustafa@mmoustafa8108
the windows loader runs in user mode, in ntdll.dll, the layer between kernel mode and user mode

OS Dev@OSdev_
If NTDLL contains the loader, who maps NTDLL before the loader is already running?

Ivan Rouzanov@ivanrouzanov
Process manager in kernel mode orchestrates creation of the process address space and asks mm to map ntdll to the new process. When the first thread is created (in kernel), it is suspended and then resumed to "return" to user mode and start execution in ntdll to run the loader.

OS Dev@OSdev_
This is answer I was looking for, perfect!