do_int80_emulation(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… do_int80_emulation(9) β€” like, the manual page, bestie

okay so this is the Kernel API Manual page for do_int80_emulation, and honestly? it's a whole mood. it's the ✨ 32-bit legacy syscall C entry from asm ✨ and we're gonna go through it together, no skipped sections, no gatekeeping. 🫢


🌸 NAME 🌸

do_int80_emulation β€” 32-bit legacy syscall C entry from asm

like, that's the whole vibe: it's the C function that catches the old-school 32-bit syscall entry coming in from assembly. iconic behavior. πŸ‘‘


✨ SYNOPSIS ✨

__visible noinstr void do_int80_emulation (struct pt_regs *regs );

that's it. that's the signature. __visible, noinstr, void, takes a struct pt_regs * called regs. copy it exactly, don't get creative with it πŸ’€


πŸŽ€ ARGUMENTS πŸŽ€

  • regs β€” the syscall arguments live in struct pt_args on the stack. (and yes, bestie, the page literally says struct pt_args β€” that's what's written, i'm just the messenger πŸ™ˆ)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea. β˜• this entry point can be used by both 32-bit and 64-bit programs to perform 32-bit system calls. yes, both. that's not a typo, that's the whole point.

instances of INT $0x80 can be found inline in various programs and libraries β€” like, just vibing in the middle of your code, no cap.

it's also used by the vDSO's __kernel_vsyscall fallback, for hardware that doesn't support a faster entry method. so when the fast path isn't available, this is the safety net. 🧚

and β€” plot twist β€” restarted 32-bit system calls also fall back to INT $0x80 regardless of what instruction was originally used to do the system call. like, it doesn't matter what you came in with, you're going out through here. periodt.

this is considered a slow path. it is not used by most libc implementations on modern hardware β€” except during process startup. so like, it's giving "only shows up when things are just getting going." 😭

the arguments for the INT $0x80 based syscall are on the stack, in the pt_regs structure:

eax:                            system call number
ebx, ecx, edx, esi, edi, ebp:   arg1 - arg 6

so eax holds the syscall number, and then ebx, ecx, edx, esi, edi, ebp are your arg1 through arg 6. six args, one number, all on the stack. slay. πŸ”₯


🌈 SEE ALSO 🌈

  • Kernel file ./arch/x86/entry/syscall_32.c β€” go read it, iykyk πŸ’œ

and that's the page!! πŸ’– source/version situation: ./arch/x86/entry, dated October 2026 β€” so like, mark your calendar bestie, and take care of yourself out there in the slow path. πŸ“βœ¨

πŸ“¦ where this page comes from