1280 words
6 minutes
Study_WindowsOS_Kernel_001

link#


How to study the Windows kernel#

Yes, studying Microsoft’s documentation on GitHub is a good starting point. However, there is an important distinction:

The MicrosoftDocs/win32 repository documents the Windows Win32 API, not the Windows kernel implementation itself.

If your goal is to understand how Windows works internally—processes, threads, virtual memory, scheduling, interrupts, system calls, drivers, and the I/O subsystem—you should study several layers of Windows architecture.

Since you have already been studying Rust operating systems, x86-64 assembly, page tables, MMU, and kernel development, I recommend approaching Windows from an OS-kernel developer’s perspective rather than simply learning Windows application programming.

1. Understand the Windows documentation ecosystem#

Start by distinguishing these documentation sources.

Repository / documentationWhat you learnPriority
MicrosoftDocs/win32Windows user-mode APIsMedium
Windows Driver DocumentationKernel architecture and driver developmentVery high
Windows Kernel DDI ReferenceKernel routines, structures, and interfacesVery high
Windows Hardware Developer DocumentationWDK, drivers, debugging, and testingHigh
WinDbg Kernel DebuggingInspecting actual kernel executionVery high

The most important repository for your goal is:

MicrosoftDocs/windows-driver-docs

It contains documentation about the Windows kernel-mode architecture, managers, drivers, and kernel programming.

2. Learn the overall Windows architecture first#

Before studying individual kernel functions, understand how the components communicate.

Image

Windows System 프로그래밍 강의 | megayuchi - 인프런

inflearn.com

Study these components in this order:

ComponentResponsibilitiesConcepts to study
Hardware Abstraction Layer (HAL)Hardware abstractionInterrupt controllers, timers, hardware
Windows Kernel (ntoskrnl.exe)Core OS mechanismsScheduling, interrupts, synchronization
ExecutiveHigher-level OS servicesObject, process, memory, I/O managers
Memory ManagerVirtual and physical memoryPage tables, paging, working sets
Process/Thread ManagerProcess and thread managementContext switching, scheduling
I/O ManagerDevice communicationIRPs, device objects, driver stacks
Security Reference MonitorAccess controlTokens, privileges, security descriptors

A particularly useful Microsoft document is the Kernel-Mode Driver Architecture Design Guide.

It describes the responsibilities of the major kernel-mode managers and libraries.

image

Microsoft Learn+1

3. Follow this learning roadmap#

I recommend studying the following seven stages in order.

Stage 1 — Windows user mode and kernel mode#

Start here

Learn how an application communicates with the operating system.

Topics:

  1. User mode vs. kernel mode.
  2. Privilege levels (x86-64 rings).
  3. System calls.
  4. Windows API vs. Native API.
  5. ntdll.dll.
  6. ntoskrnl.exe.
  7. System service dispatch.

Understand this conceptual call chain:

User Application
       |
       v
Win32 API
       |
       v
KernelBase.dll
       |
       v
ntdll.dll
       |
       v
System Call (syscall)
       |
       v
Windows Kernel
       |
       v
Kernel Executive Services

For example, when an application creates a process:

CreateProcessW()
       |
       v
Windows user-mode libraries
       |
       v
Native system-call interface
       |
       v
Kernel process-management services
       |
       v
New process and initial thread

The exact internal path varies by Windows version and API.

Read:

Stage 2 — Process and Thread Management#

Topics:

  • EPROCESS
  • KPROCESS
  • ETHREAD
  • KTHREAD
  • Process creation and termination
  • Thread scheduling
  • Context switching
  • Dispatcher objects
  • Synchronization

Important question:

How does Windows switch the CPU from one thread to another?

Compare the concepts with your own x86-64 OS:

Your OS implementationWindows concepts
Process structureEPROCESS
Thread structureETHREAD / KTHREAD
SchedulerDispatcher / scheduler
Context switchThread context switching
Address-space switchingProcess address-space management

Read: Windows Kernel-Mode Process and Thread Manager.

image

GitHub

Stage 3 — Memory Management#

This should be one of your highest priorities.

Topics:

  1. Virtual address spaces.
  2. Physical memory management.
  3. Page tables.
  4. Page faults.
  5. Demand paging.
  6. Working sets.
  7. Memory-mapped files.
  8. Kernel virtual address space.
  9. TLB and address-space switching.

Compare:

x86-64 OS conceptWindows concept
PML4 / page tablesHardware page tables
Page fault handlerMemory Manager
Physical frame allocatorPhysical page management
Address-space structureProcess address space
Virtual memory mappingVirtual memory manager
Kernel heapKernel pool

Pay particular attention to the distinction between the hardware page-table mechanisms and the Windows Memory Manager’s higher-level policies.

Stage 4 — Interrupts, Exceptions, and Scheduling#

Topics:

  • IDT
  • Interrupt Service Routine (ISR)
  • Interrupt Request Level (IRQL)
  • Deferred Procedure Calls (DPC)
  • Asynchronous Procedure Calls (APC)
  • Hardware interrupts
  • Software interrupts
  • Exceptions
  • Thread dispatching

One important Windows concept is IRQL.

For example:

PASSIVE_LEVEL
       |
       v
APC_LEVEL
       |
       v
DISPATCH_LEVEL
       |
       v
Device IRQLs
       |
       v
HIGH_LEVEL

IRQL controls which interrupt and execution contexts are allowed to run. It is not simply another name for x86 privilege rings.

Study how Windows handles an interrupt using an ISR and subsequently schedules work through a DPC.

Stage 5 — Object Manager and I/O Manager#

Topics:

  • Windows Object Manager
  • Handles
  • Object types
  • Object namespaces
  • Device objects
  • Driver objects
  • I/O Request Packets (IRPs)
  • Device stacks
  • Asynchronous I/O

For example, a file operation conceptually follows:

Application
    |
    v
ReadFile()
    |
    v
Windows I/O system
    |
    v
I/O Manager
    |
    v
IRP_MJ_READ
    |
    v
File System Driver
    |
    v
Storage Driver
    |
    v
Hardware

Read Microsoft’s Overview of the Windows I/O Model.

image

GitHub

Stage 6 — Windows Security#

Topics:

  • Access tokens
  • Security identifiers (SIDs)
  • Privileges
  • Access control lists (ACLs)
  • Security descriptors
  • User/kernel access boundaries
  • Object access checking
  • Windows security reference monitor

Understand how the kernel determines whether a process can access a particular object.

Stage 7 — Device Driver Development#

Finally, implement a small kernel-mode driver.

Study:

  • Windows Driver Kit (WDK)
  • Windows Driver Model (WDM)
  • Kernel-Mode Driver Framework (KMDF)
  • DriverEntry
  • IRP_MJ_CREATE
  • IRP_MJ_CLOSE
  • IRP_MJ_DEVICE_CONTROL
  • DriverUnload

Start with Microsoft’s Windows Driver Samples.

Don’t begin by writing a complicated hardware driver. Start with a simple driver that creates a device and handles basic requests.

4. Set up a Windows kernel debugging environment#

Reading documentation alone is insufficient. You should inspect the actual Windows kernel while it is running.

I recommend using a virtual machine rather than experimenting on your primary operating system.

FLUG: QEMU lightning talk

1. Windows 11 virtual machine

Use VMware, Hyper-V, or another suitable hypervisor. Keep a snapshot so you can recover from crashes.

Visão geral do Depurador do Windows WinDbg - Windows drivers | Microsoft Learn

2. WinDbg

Inspect kernel modules, symbols, registers, memory, threads, and kernel data structures.

Sysinternals graphical tools — MCSI Library

3. Sysinternals

Use Process Explorer, Process Monitor, RAMMap, and other utilities to observe Windows internals.

Write a Universal Windows Driver (KMDF) Based on a Template - Windows drivers | Microsoft Learn

4. Windows Driver Kit (WDK)

Set up the environment for compiling and testing kernel-mode drivers.

Your first WinDbg exercises#

After setting up kernel debugging, learn these commands:

CommandPurpose
lmList loaded modules
!process 0 0Display process information
!threadDisplay current thread information
!pte ADDRESSInspect page-table entries
!address ADDRESSExamine virtual address information
rDisplay CPU registers
kDisplay the call stack
dtDisplay data structures
u ADDRESSDisassemble instructions

For example:

kd> lm
kd> !process 0 0
kd> !thread
kd> r
kd> k

Official tutorial: Get started with WinDbg kernel-mode debugging.

image

Microsoft Learn

5. Read Windows Internals#

I strongly recommend studying the book series Windows Internals.

‎Windows Internals by Pavel Yosifovich, Alex Ionescu, Mark Russinovich & David Solomon on Apple Books

Windows Internals, Part 2, 7th Edition | Microsoft Press Store

It provides a deeper explanation of Windows architecture than ordinary Win32 API documentation.

Prioritize these subjects:

  1. System architecture.
  2. Processes and jobs.
  3. Threads and scheduling.
  4. Memory management.
  5. I/O system.
  6. Security.
  7. Boot process and initialization.

The book’s coverage depends on the edition, so supplement older material with current Microsoft documentation.

6. A practical 12-week study schedule#

Here is the order I would use:

WeeksSubjectPractical exercise
1–2Windows architectureTrace a Win32 API call
3System callsInspect ntdll.dll in WinDbg
4Processes and threadsExamine EPROCESS and ETHREAD
5–6Memory managementInspect virtual addresses and PTEs
7Interrupts and exceptionsStudy IRQL, ISR, and DPC
8SchedulingInspect thread states and context
9Object ManagerExamine handles and kernel objects
10I/O ManagerTrace an IRP
11SecurityExamine access tokens and ACLs
12Driver developmentBuild a simple KMDF driver

7. Connect Windows concepts to your Rust OS project#

This is probably the most valuable exercise for understanding Windows deeply.

Instead of just memorizing Windows terminology, implement a small equivalent in your own operating system and compare the designs.

For example:

Your Rust OSWindows
BootloaderWindows Boot Manager
Kernel entry pointWindows kernel initialization
PageTableHardware page tables + Memory Manager
FrameAllocatorPhysical Memory Manager
ProcessEPROCESS
ThreadETHREAD / KTHREAD
SchedulerWindows dispatcher
Interrupt handlerISR
Deferred workDPC
System call handlerSystem service dispatch
Device abstractionDevice Object
Driver interfaceWDM / KMDF

One important limitation: Windows is not an open-source operating system. Its kernel implementation is proprietary. Microsoft publishes documentation, public headers, debugging symbols, and driver samples, but these do not expose the complete kernel source code.

Therefore, combine documentation with WinDbg, disassembly, and practical experiments.

Recommended approach

I would prioritize these resources:

  1. Windows Internals — understand how the operating system works.
  2. Windows Driver Documentation — understand kernel architecture.
  3. Windows Kernel DDI Reference — learn actual kernel interfaces.
  4. WinDbg — investigate the running kernel.
  5. Windows Driver Samples — learn through implementation.
  6. Win32 API Documentation — understand the user-mode interface.

Useful starting links:

My advice: Don’t try to learn every Windows API. Focus on the boundary between user mode and kernel mode, then study the Memory Manager, Process Manager, Scheduler, Interrupt Manager, and I/O Manager.

That will give you a much stronger understanding of Windows kernel architecture.

I can also turn this roadmap into a hands-on weekly Windows kernel course, with Rust OS comparisons, assembly exercises, WinDbg commands, and practical debugging assignments.

🖥️Weekly Windows kernel study lessons눌러서 설정하세요

Study_WindowsOS_Kernel_001
https://younghakim7.github.io/blog/posts/study_windowsos_kernel_001/
Author
YoungHa
Published at
2026-11-11