惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
Y
Y Combinator Blog
WordPress大学
WordPress大学
L
LangChain Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
A
About on SuperTechFans
小众软件
小众软件
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
GbyAI
GbyAI
I
InfoQ
The GitHub Blog
The GitHub Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
C
Check Point Blog
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
量子位
雷峰网
雷峰网
Hugging Face - Blog
Hugging Face - Blog

Hacker News

GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Bonsai 1-bit WebGPU - a Hugging Face Space by webml-community Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Retrofitting JIT Compilers into C Interpreters IPv6 – Google The Accursèd Alphabetical Clock Cybersecurity Looks Like Proof of Work Now Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent When moving fast, talking is the first thing to break Too much Discussion of the XOR swap trick – Heather Cafe Introduction to Spherical Harmonics for Graphics Programmers The Grand Line
wsl9x
2026-05-13 · via Hacker News

Windows 9x Subsystem for Linux.

WSL9x runs a modern Linux kernel (6.19 at time of writing) cooperatively inside the Windows 9x kernel, enabling users to take advantage of the full suite of capabilities of both operating systems at the same time, including paging, memory protection, and pre-emptive scheduling. Run all your favourite applications side by side - no rebooting required!

Proudly written without AI.

Technical details

WSL9x is made up of three components: a patched Linux kernel (see the win9x-um-6.19 branch), a VxD driver, and a wsl.com client program.

The driver is responsible for the initialisation of WSL9x (see vxd/wsl9x.asm for the driver entry point). It sets up the initial mappings for the kernel code and loads vmlinux.elf off disk using DOS interrupts (see vxd/loader.c and vxd/fs.asm). The kernel is compiled with a fixed base address of 0xd0000000.

The driver then starts a new thread in the System VM, allocates a 16 KiB stack for entering Linux on, and drops into an event loop which handles entering the kernel, dispatching IRQs, returning to userspace, and idling. See vxd/entry.c for this code.

The driver is also responsible for handling userspace events which must be dispatched to the kernel, currently page faults and syscalls. Syscalls are handled via the general protection fault handler, as Win9x does not have an interrupt descriptor table long enough to install a proper handler for int 0x80 - the Linux i386 syscall interrupt. Instead, the GPF handler inspects the faulting instruction. If it's int 0x80, the GPF handler advances the instruction pointer as if the interrupt succeeded and dispatches as a syscall to Linux. See vxd/fault.c for this code.

The Linux kernel is based on user-mode Linux, but hacked to call Windows 9x kernel APIs instead of posix APIs, and running in ring 0 (supervisor/kernel mode) rather than ring 3 (user mode). Much of the actual Win9x kernel integration including context switching lives in the Linux kernel. See linux/arch/um/os-Win95 for the bulk of the Linux-side code. The entry point called by vxd/entry.c is _start in main.c. process.c and mmu.c are also important.

The last piece is the wsl.com client. This is a small 16 bit DOS program implemented in wsl/wsl.asm which exists to allow WSL9x to use MS-DOS prompts as TTY windows rather than needing to implement something custom.

When wsl.com starts, it makes an initial call into wsl9x_v86_api in vxd/console.c to claim an unused console and notify WSL9x that output for that console should be dispatched to it. Then it drops into an event loop waiting for an IRQ and attempting to read from the keyboard when interrupted. The top of this event loop also serves as a synchronisation point for the console driver - when output from Linux is ready, it schedules an event and executes int 0x29 in the context of the MS-DOS VM to output chars to the DOS window. This interrupt is also where an ANSI driver for DOS such as NNANSI is able to intercept the terminal output to implement ANSI escape codes.

Building and running

  • You will need a cross toolchain targeting i386-linux-musl on PATH. Use musl-cross-make to build one

  • You will need the Open Watcom v2 toolchain for building the Windows components. Set the WATCOM env var to the prefix where you installed it. On my machine, that's /opt/watcom.

  • Build the patched Linux kernel. This is a manual step because building the kernel takes quite a long time.

    $ git submodule update --init # make sure linux submodule is up to date
    $ make build-linux -j $(nproc)
    
  • You will need a hard drive image hdd.base.img with Windows 9x pre-installed

  • Run make - this will produce a new hdd.img with WSL9x ready to go.

  • Run wsl at the MS-DOS prompt to open a pty. If you'd like to use ANSI colours, make sure you have an appropriate driver loaded before running wsl. nnansi.com is a good option.

License

GPL-3