MSDN Documentation

Windows Architecture

The Windows operating system is built on a layered architecture that separates core system services from user-facing components. This design promotes stability, security, and extensibility.

System Architecture Overview

At a high level, Windows consists of three primary layers:

Kernel Mode vs User Mode

Windows separates execution contexts into two modes:

Kernel ModeUser Mode
Full access to hardware and memory.Restricted access; runs application code.
Runs in Ring 0 on x86.Runs in Ring 3.

Subsystems

Subsystems expose the kernel's capabilities to different programming models:

Process and Thread Model

Each process has its own virtual address space, while threads share this space and execute concurrently.

void CreateSimpleThread()
{
    HANDLE hThread = CreateThread(
        NULL, 0,
        [](LPVOID) -> DWORD { /* work */ return 0; },
        NULL, 0, NULL);
    WaitForSingleObject(hThread, INFINITE);
    CloseHandle(hThread);
}

Memory Management

Windows uses a paging system with a configurable page size (usually 4 KB). The memory manager handles virtual memory, working sets, and the page file.

Security Architecture

Key security components include:

Future Directions

Microsoft continues to evolve Windows with a focus on: