Skip to content

arch/x86: Changed system call ABI#9

Open
Ioan-Cristian wants to merge 1 commit into
masterfrom
x86-abi
Open

arch/x86: Changed system call ABI#9
Ioan-Cristian wants to merge 1 commit into
masterfrom
x86-abi

Conversation

@Ioan-Cristian

@Ioan-Cristian Ioan-Cristian commented Jun 3, 2025

Copy link
Copy Markdown

Pull Request Overview

This pull request changes the system call ABI on x86. Instead of passing arguments and return values on the stack, they are passed in registers. The following registers are used for argument/return values: ebx, ecx, edx, edi.

This change is needed to simplify the implementation of the MMU on the x86 architecture, where the virtual address space of a process doesn't match the virtual address space of the kernel. In that case, writing/reading from stack led to page faults due to missing pages.

The new system call ABI mimics the Linux kernel's ABI and Tock's RISC-V ABI.

Testing Strategy

This pull request was tested by running two libtock-rs applications on QEMU.

TODO or Help Wanted

No help needed.

Documentation Updated

  • No updates required.

Formatting

  • Ran make prepush.

Instead of pushing and popping arguments on the stack, arguments are
passed in registers as on Linux x86 and Tock RISC-V. This new ABI
simplifies the implementation of virtual memory.

Signed-off-by: Ioan-Cristian CÎRSTEA <ioan.cirstea@oxidos.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants