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
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms