The task is to create a message queue on the NASM assembler, to demonstrate its operation.

Linux kernel version 4.10 Ideally, I would like to get a format response like on this site https://syscalls.kernelgrok.com/ In which register and which values ​​to write. But I will be glad to any information on this topic. It is important that the implementation be made on 32-bit width and through interrupts int 0x80

    1 answer 1

    The call number can be taken from the kernel source tree, namely (for x86) arch/x86/entry/syscalls/syscall_32.tbl , and parameters from include/linux/syscalls.h . The call number is placed in EAX, and the parameters are pushed in direct order by register (% ebx,% ecx,% edx,% esi,% edi).

    To create a message queue, you need to call mq_open() , number 0x116 . It has one parameter - a buffer with the name of the queue, which is passed through% ebx, respectively. To manipulate the queue you need other mq_ * calls.

    Creation and manipulation of SysV queues ( msgopen() , etc.) on x86 is emulated by user space.

    It is possible to use data from syscalls.kernelgrok.com/. As soon as the system call enters the release core, its number does not change, so as not to break the ABI. So since 2.6, they haven't changed a bit.

    All of the above implies that “32-bit width” is the x86 architecture, not x32-ABI for x86_64.