Jump to content
Nytro

System calls in the Linux kernel

Recommended Posts

Posted

System calls in the Linux kernel. Part 1.

Introduction

This post opens new chapter in linux-insides book and as you may understand from the title, this chapter will devoted to the System call concept in the Linux kernel. The choice of the topic for this chapter is not accidental. In the previous chapter we saw interrupts and interrupt handling. Concept of system calls is very similar to interrupts, because the most common way to implement system calls as software interrupts. We will see many different aspects that are related to the system call concept. For example, we will learn what's happening when a system call occurs from userspace, we will see implementation of a couple system call handlers in the Linux kernel, VDSO and vsyscall concepts and many many more.

Before we will start to dive into the implementation of the system calls related stuff in the Linux kernel source code, it is good to know some theory about system calls. Let's do it in the following paragraph.

System call. What is it?

A system call is just an userspace request of a kernel service. Yes, the operating system kernel provides many services. When your program wants to write to or read from a file, start to listen for connections on a socket, delete or create directory, or even to finish its work, a program uses a system call. In another words, a system call is just a C function that is placed in the kernel space and an user program can ask kernel to do something via this function.

The Linux kernel provides a set of these functions and each architecture provides its own set. For example: the x86_64 provides 322 system calls and the x86 provides 358 different system calls. Ok, a system call is just a function. Let's look on a simple Hello world example that written in assembly programming language:

Articol complet: https://github.com/0xAX/linux-insides/blob/master/SysCall/syscall-1.md

Posted

Cu alte cuvinte, lumea a fost atat de idioata, incat a facut un cod, apoi a facut alt cod sa apeleze acel cod, apoi a facut alt cod sa apeleze acel cod si tot asa pana la frameworkuri => risipa de resurse pentru a fi cat mai simplu :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...