vm86(2)
๐ vm86 โ bestie edition (section 2 of the manual, the System Calls Manual, iykyk) ๐
โจ NAME โจ
vm86old, vm86 โ enter virtual 8086 mode ๐ฆ
๐ LIBRARY ๐
Standard C library (libc, -lc) โ she's already in your group chat, no install needed ๐
๐ธ SYNOPSIS ๐ธ
#include <sys/vm86.h>
int vm86old(struct vm86_struct *info);
int vm86(unsigned long fn, struct vm86plus_struct *v86);
okay so literally just two tiny calls and you're in another mode entirely, no cap โจ
๐ DESCRIPTION ๐
The system call vm86() was introduced in Linux 0.97p2. Then in Linux 2.1.15 and 2.0.28, it got renamed to vm86old(), and a brand-new vm86() showed up to take its place ๐ซถ. And the definition of struct vm86_struct got changed in 1.1.8 and 1.1.9 โ so yeah, this whole thing has had a glow-up or two, fr fr.
These calls cause the process to enter VM86 mode (that's virtual-8086 if you're reading the Intel literature, bestie ๐), and they're used by dosemu ๐.
VM86 mode is an emulation of real mode within a protected mode task. It's giving "living your best retro life inside a modern apartment" and honestly? iconic. ๐
๐ฅ RETURN VALUE ๐ฅ
Slay: on success, zero is returned โจ. On error, -1 is returned, and errno is set to indicate the error. Classic. No notes. ๐ญ
๐ ERRORS ๐
- EFAULT โ this return value is specific to i386 and indicates a problem with getting user-space data. She tried to grab your stuff and justโฆ couldn't ๐ซ .
- ENOSYS โ this return value indicates the call is not implemented on the present architecture. Wrong building, hon ๐ .
- EPERM โ saved kernel stack exists. (This is a kernel sanity check; the saved stack should exist only within vm86 mode itself.) So like, if you're seeing this and you're not in vm86 mode? That's a red flag, bestie ๐ฉ.
โ ๏ธ heads up: that EPERM one is the kernel doing a little vibe check on itself. The saved stack has no business existing outside vm86 mode, periodt.
๐ STANDARDS ๐
Linux on 32-bit Intel processors. That's the whole vibe check, no cap ๐
โจ that's the whole page, bestie โ now go forth and virtualize โจ
This lil masterpiece is from Linux man-pages 6.20, dated 2026-02-08 ๐ mwah, drink water, and remember: man pages are just lore drops for your terminal ๐๐ฆ๐ธ
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: Linux-man-pages-copyleft
- Copyright 1993, Rickard E. Faith <faith@cs.unc.edu>
- Copyright 1997, Andries E. Brouwer <aeb@cwi.nl>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms