2021-12-12 07:05:17

by Muni Sekhar

[permalink] [raw]
Subject: X86 : system call

Hi all,

32-bit system call numbers and entry vectors are defined in the format
"<number> <abi> <name> <entry point> <compat entry point>". What is
the difference between <entry point> and <compat entry point>?

The abi is always "i386" for arch/x86/entry/syscalls/syscall_32.tbl,
whereas for 64-bit(arch/x86/entry/syscalls/syscall_64.tbl) it is used
as "common" and "64", "x32". What is the difference between "common"
and "64", "x32"?

While adding a new system call(for example: mlock) to kernel,
/kernel/sys_ni.c file modified as mentioned below:
+cond_syscall(sys_mlock2);

Why do we pass <entry point> to cond_syscall()?

Also, could someone please point me to a document which explains about
"how to add a new system call" and the "system call flow from user
space to kernel space" in X86 ARCHITECTURE (32-BIT AND 64-BIT).


--
Thanks,
Sekhar


2021-12-12 08:13:03

by Greg KH

[permalink] [raw]
Subject: Re: X86 : system call

On Sun, Dec 12, 2021 at 12:34:54PM +0530, Muni Sekhar wrote:
> Also, could someone please point me to a document which explains about
> "how to add a new system call" and the "system call flow from user
> space to kernel space" in X86 ARCHITECTURE (32-BIT AND 64-BIT).

There are many documents online that show both of these already. Have
you used a search engine first?

Both of these are usually questions that students are asked for
assignments, good luck in class!

greg k-h