Windows OS Architecture Explained: User Mode, Kernel Mode and a Worked I/O Trace
Build a reliable Windows architecture model, then trace one file read across protection modes and calculate its virtual pages, physical endpoints and file blocks.
KnowledgeGate Team
Exam prep & CS education

Windows architecture diagrams mix applications, services, subsystem DLLs, the executive, kernel, drivers and hardware, so boundary and responsibility questions become easy to misread. The broader Windows Operating System: Architecture, Processes, Memory and Worked Examples connects processes, services, scheduling, memory and security within the CS Fundamentals path. PhotoIndex.exe supplies the narrower trace: PID 4240, TID 91, handle 0x74, and an 8,192-byte read at virtual address 0x00001003. With 4 KiB units, its unaligned buffer touches three virtual pages while its aligned file range covers two blocks.
Read Windows architecture as two modes and cooperating layers
Read the diagram from top to bottom:
user applications and user-mode services -> Windows API and subsystem support -> protected system-service boundary -> executive managers and kernel -> device drivers and HAL -> hardware
Microsoft Learn's User Mode and Kernel Mode says applications run in restricted user mode. Core components run in kernel mode, where faulty code can affect the whole system. Some drivers run in user mode, so “all drivers are kernel-mode” is too absolute.
Microsoft Learn's Overview of Windows Components, executive library and debugger glossary separate the responsibilities. Executive managers provide higher-level object, security, memory, process, thread and I/O services. The kernel handles scheduling, interrupts, exceptions and multiprocessor synchronisation. The HAL hides platform-specific hardware details. “Hybrid kernel” is shorthand, not a substitute for these names. A layer marks responsibility, not necessarily a separate process.

Keep process, thread, virtual address and handle separate
Microsoft Learn's About Processes and Threads defines a process as the owner of a private virtual address space, code, handles and security context. A thread is its schedulable execution unit. Threads share process resources but retain their own stacks and execution contexts.
Here, PID 4240 identifies PhotoIndex.exe; TID 91 identifies its caller; 0x00001003 is a virtual address interpreted through that process's mappings; and 0x74 is a handle-table entry, not a pointer or disk address. A validated handle refers to a managed object with access context. Closing or duplicating it changes a process reference, not the file.
Trace I/O as a controlled path, not a jump to disk
TID 91 calls the Windows API, crosses the protected boundary, and has its handle and access checked. I/O and file-system work follows. Cache, driver and hardware work occurs as needed before completion returns to user mode. The exact steps can differ between Windows versions.
Object and security services validate 0x74 and its access. Memory services handle the buffer. I/O services coordinate request and completion. The file system interprets the offset. If TID 91 waits, the scheduler can run another thread.
Three distinctions prevent common errors:
A mode switch need not switch processes. The same thread may enter kernel mode and return.
A handle is not a filename, pointer or physical sector.
API success does not prove hardware I/O, because a cache may satisfy the read.
Do not assume every read pins pages or reaches a disk.
Worked example: three memory pages, two file blocks
Assume fictional data: page size 4 KiB = 4,096 bytes = 0x1000; three present, writable, permitted user pages; buffer start 0x00001003; length 8,192 = 0x2000; file offset 12,288 = 0x3000; and 4 KiB file blocks.
The inclusive final buffer address is:
0x1003 + 0x2000 - 1 = 0x3002
Split the buffer by page:
Page
0x1000-0x1FFF:0x1000 - 0x0003 = 0x0FFD = 4,093bytes.Page
0x2000-0x2FFF:4,096bytes.Page
0x3000-0x3FFF: the final3bytes, at0x3000-0x3002.
Check: 4,093 + 4,096 + 3 = 8,192, so three virtual pages are touched.
Use invented mappings VPN 0x1 -> PFN 0x21, VPN 0x2 -> PFN 0x44, and VPN 0x3 -> PFN 0x2A. The first byte maps to 0x21000 + 0x003 = 0x21003; the last to 0x2A000 + 0x002 = 0x2A002. Microsoft Learn's Virtual Address Space supplies the model. The separated frames prove that virtual contiguity need not mean physical contiguity.
Separately, offset 0x3000 and length 0x2000 give inclusive range 0x3000-0x4FFF: blocks 3 and 4. Pages and file blocks remain different abstractions even when both are 4 KiB.

Divide work among executive, kernel, drivers and HAL
These Windows-specific names follow Microsoft Learn. One request can involve several components with distinct jobs.
Component | Stable responsibility | Role in the worked trace | Common wrong answer |
|---|---|---|---|
Object Manager | Managed objects and handles | Resolves | Handle is a pointer |
Security checks | Access decisions | Checks read permission | Driver owns all policy |
Memory Manager | Virtual memory | Interprets pages covering | Virtual page is a frame |
I/O Manager | Request and completion coordination | Coordinates | It is the file system |
Process/Thread Manager | Process and thread lifecycle | Tracks PID | Thread equals process |
Kernel | Scheduling, interrupts, exceptions | Can schedule another thread while TID | Kernel equals the whole OS |
File-system or device driver | File or device-facing behaviour | Interprets | Driver decides all security |
HAL | Platform-specific hardware abstraction | Connects kernel-facing work to the platform | HAL is an application API |
The executive is not a user application. The HAL does not erase every hardware difference.
Understand the architecture trade-offs
If PhotoIndex.exe dereferences an invalid user address, Windows can normally fault that process without allowing access to another process's private memory. User-mode failures are not harmless, but their privilege and failure scope are constrained. A kernel-mode driver corrupting shared memory may affect the whole system.
User mode improves isolation; kernel mode permits protected-resource and hardware coordination. Moving all work to either side changes protection, performance and compatibility. Drivers provide device behaviour, while the HAL separates core components from platform details. Layering improves portability but has limits and overhead.
Practise trace, classify, calculate and reject traps
Questions can ask you to label components by mode, separate executive from kernel and HAL, distinguish process from thread, trace I/O, calculate unaligned pages, or match a manager to a job.
Try these before reading the answers:
Is
0x74a disk address?Must a user-to-kernel transition change PID?
How many
4 KiBpages contain8,192bytes from0x1003?Which physical addresses hold the first and final bytes?
How many
4 KiBfile blocks cover offset0x3000for length0x2000?
Answers: (1) No, it is the invented process-local handle. (2) No. (3) Three. (4) 0x21003 and 0x2A002. (5) Two.
Reject these traps: kernel is not the entire OS; executive is not kernel; mode switch is not context switch; thread is not process; handle is not pointer; page is not frame or file block; API completion does not prove disk access; and drivers need not all be kernel-mode. Use OS Basics MCQs for adjacent practice.
Windows architecture in the short version
Applications and many services run with user-mode restrictions.
Protected system services lead to kernel-mode components.
Executive managers provide higher-level OS services.
The kernel handles lower-level scheduling and interrupts.
Drivers and HAL connect the OS to hardware.
Processes own resources, threads execute, and handles refer to managed objects.
Without looking back, use VA 0x1003, length 0x2000, page size 0x1000, mappings 0x1->0x21, 0x2->0x44, 0x3->0x2A, and file offset 0x3000 to recover three pages, endpoints 0x21003 and 0x2A002, and two blocks ending at 0x4FFF.
Use ZERO TO HERO for a semester-oriented CS route or CS Fundamentals for Placements by Sanchit Sir for placement-oriented revision. Redraw both figures and solve the drills before moving on.
Keep learning
Windows Design & Architecture MCQs: 9 Solved MCQs and 1 Dual-Mode Scenario
Attempt nine Windows architecture MCQs, then solve a dual-mode scenario. Each answer separates product lineage, internal boundaries and Win32 mechanisms.
Linux Kernel Architecture Explained: User Space, System Calls and a Worked write() Example
Build a clear map of Linux user space and kernel space, then follow one three-byte write() request through x86-64 registers, VFS, and the return path.
System Calls and Dual Mode in OS: Mode-Bit Trace, Worked Example and Exam Traps
Follow one read() call across the user-kernel boundary, calculate its stated overhead, and learn the distinctions that make system-call questions easier.
Windows OS Architecture: Processes, Memory, NTFS and Worked Examples
Follow one coherent map of Windows OS architecture, then solve thread scheduling, virtual-address translation and NTFS allocation examples step by step.





