Nytro Posted August 23, 2015 Report Posted August 23, 2015 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 Quote
Gushterul Posted August 23, 2015 Report Posted August 23, 2015 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 Quote