#define in_x32_syscall() (task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT) In arch/x86/entry/entry_64.S , the system call entry point checks the system call number. If the __X32_SYSCALL_BIT (bit 30) is set in orig_ax , it jumps to the x32 syscall table. Otherwise, it routes to the 64-bit table. For a 32-bit (non-x32) process, a completely different entry path ( ia32 ) is used, which involves switching to 32-bit compatibility mode.
For the systems programmer, studying x32 offers a profound lesson: Every pointer dereference carries the weight of its width. And sometimes, the most optimal path is the one the hardware never expected you to take. x32 driver
Introduction: The Forgotten Architecture In the landscape of operating system development, two primary execution environments dominate: 32-bit (x86) and 64-bit (x86-64, often called x64) . The former is the aging workhorse of the late 90s and early 2000s; the latter is the current standard. Yet, lurking in the shadow of these two giants is a third, often misunderstood beast: x32 . For a 32-bit (non-x32) process, a completely different
To truly understand the x32 driver, one must stop looking for a file named x32.sys and start looking at the entry_64.S file in the Linux kernel source—because in there, guarded by a single bitmask test on orig_ax , lies a ghost of what computing could have been: fast, lean, and forever limited to 4GB. Introduction: The Forgotten Architecture In the landscape of
static bool is_x32_task(struct task_struct *task) { return task->thread_info.status & TS_COMPAT; } Wait—that is too generic. Actually, the kernel uses: