0

When a system call is invoked by a user program, a software interrupt (trap) is raised, control first passes to the fixed location of the interrupt vector (IR) which contains the ISR associated with the interrupt, and then to the system call table which contains the pointer to the system call code? That is, it’s not clear to me what happens after the ISR is executed and the transition to the system call table.

6
  • 2
    Are you interested in a particular architecture? It varies slightly. Commented Oct 7 at 20:06
  • Study linux-kernel-labs.github.io/refs/heads/master/lectures/… Commented Oct 7 at 22:45
  • @stark No,basically I am having trouble to understand what happens after ISR execution mapped to a system call. What are the steps operating system follows to reach the system call table. Does ISR have a reference to the system call procedure in the system call table? Commented Oct 8 at 9:27
  • On x86 the index into the syscall table is passed as an argument. See stackoverflow.com/q/10583891/1216776 Commented Oct 8 at 11:23
  • On most architectures, the system call number and up to 6 arguments are passed in registers. If an architecture had insufficient registers, the information could be passed on the stack, although I cannot think of any Linux-supported architectures that do that. Commented Oct 14 at 16:12

1 Answer 1

0

The system call table is an array of function pointers that contains the list of all the system calls for the operating system. So, basically, the system call table is a dispatcher to map system call numbers to kernel functions; the system call number is the index into the array in the system call table which points to a specific kernel function.

For syscalls, generally, you don't handle them with ISR but by triggering software functions and instructions (e.g., entry_SYSCALL_64). So, when a syscall happens, you move from user space to the kernel space and starts execution of the system call entry point which uses the sys_call_table[] to get the function to execute in relation to the syscall number.

The ISR is software function the kernel runs in response to specific interrupts, associated to special events (ex. in drivers, hardware devices) and it should run immediately without blocks. For those type of interrupts management, Kernel creates an array of Interrupt Descriptors in memory, called Interrupt Descriptor Table (IDT), which contains the descriptors pointing to the kernel ISRs. Within this context, when idtr (index for the IDT relate to the interrupt happend) points to a syscall descriptor, the descriptor in the IDT will be associated to a syscall handler function that will follow the process above.

Sign up to request clarification or add additional context in comments.

1 Comment

@Fabio does my answer reply to your question? Do you have other doubts?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.