Computer Systems

Windows Subsystem for Linux

Windows Subsystem for Linux

Table of Contents

WSL Components (WSL1)

Microsoft Blog

wsl-components

Pico Processes

Microsoft Blog

pico-process

System Calls

System calls are made by:

This is fairly similar between Linux and NT kernels, however the ABI differs, and syscalls don’t typically map directly.

When a WSL process makes a syscall, the NT kernel recognises that it came from a pico process, it maintains the register state and forwards the request to the pico driver. The pico driver inspects the rax register to determine which syscall was being made, and will then pass the parameters to the code to execute the syscall. This will likely issue an NT syscall. After the pico driver has handled the syscall it returns to NT, which restores the registers, placing the return value in rax, and invokes sysret instruction to return to user mode.

wsl-syscalls

File System

Microsoft Blog: WSL File System Support

Linux File Systems

Windows File Systems

WSL File Systems

WSL must perform the following file system functions:

To do this, WSL has a VFS component to provide similar functionality as the Linux VFS. When a syscall is made, it gets handled by the syscall layer: file-related syscalls get forwarded to VFS.

wsl-flie-system

VolFs

DrvFS


Edit this page.