The Linux System Call Execution Model: An Insight
Open Source For You|August 2024
This two-part series of articles focuses on the system call execution model in Linux based operating systems. This first part explains what system calls are, why they are required and the role of the glibc wrapper in system call execution. It then touches on the system call execution model from the Linux kernel perspective.
The Linux System Call Execution Model: An Insight

A system call is a request by a user space program (application) to interact with an OS executing in the kernel space. Basically, the user application invokes a system call when it requires access to the services that can only be accessed through a higher privilege mode — for example, creating a new task, doing network I/O or file I/O, or accessing hardware resources. These operations cannot be directly performed by the user space application; hence, operating systems like Linux provide a set of routines called system calls which are basically C functions executing in the kernel space.

When a user space program invokes a system call, there is a software interrupt (nowadays x86-64 provides syscall instruction for fast system call execution) and the mode switches from user space to kernel space (or more precisely, the privilege mode changes from lower to higher). Now the system call handler in the kernel space performs the required operation on behalf of the user space application and sends the response back to it.

We will see in detail in later sections as to how the user space to kernel space mode switching happens and how kernel space system call handlers are invoked. But first let’s examine the role of the standard C library in the execution of system calls.

Role of the C library

When we say C library, the most commonly and widely distributed C library with a Linux based OS is glibc or GNU C library. This C library helps implement standard C functions and APIs like print(), scanf(), malloc(), fopen(), strcpy(), etc. These standard functions may or may not invoke system calls internally — for example, printf() internally invokes write(2) system calls. However, all these internal invocations of system calls are hidden from the user space application.

This story is from the August 2024 edition of Open Source For You.

Start your 7-day Magzter GOLD free trial to access thousands of curated premium stories, and 9,000+ magazines and newspapers.

This story is from the August 2024 edition of Open Source For You.

Start your 7-day Magzter GOLD free trial to access thousands of curated premium stories, and 9,000+ magazines and newspapers.

MORE STORIES FROM OPEN SOURCE FOR YOUView All
Amazon Bedrock: A Boon for the Financial Services Industry
Open Source For You

Amazon Bedrock: A Boon for the Financial Services Industry

Amazon Bedrock is a fully managed service that provides access to foundation models from top AI providers, enabling organisations to build and scale generative AI applications. It is specifically designed to bring AI solutions to the financial sector. Let's explore all that it can do...

time-read
9 mins  |
December 2024
Quantum-Safe VPNs: The Future of Secure Communication
Open Source For You

Quantum-Safe VPNs: The Future of Secure Communication

As quantum computing continues to advance, it poses a significant threat to traditional cryptographic algorithms that secure our digital communications. Virtual private networks (VPNs), which rely heavily on encryption, are particularly vulnerable. Quantum-safe VPNs utilise post-quantum cryptographic algorithms to protect against quantum attacks.

time-read
3 mins  |
December 2024
Popular Open Source Toolkits for Quantum Machine Learning
Open Source For You

Popular Open Source Toolkits for Quantum Machine Learning

Quantum machine learning is becoming increasingly popular due to its ability to solve the complex problems of the AI age. Here are a few open source libraries and frameworks that help with quantum computations.

time-read
5 mins  |
December 2024
Quantum Computing: Harnessing Open Source for Innovation and Accessibility
Open Source For You

Quantum Computing: Harnessing Open Source for Innovation and Accessibility

We explore how open source initiatives are shaping the future of quantum computing, making it more accessible and driving innovation through collaboration.

time-read
9 mins  |
December 2024
How Quantum Computing Differs from Classical Computing
Open Source For You

How Quantum Computing Differs from Classical Computing

Despite being in its infancy, quantum computing has numerous potential applications in modelling, cybersecurity, AI/ML, and other fields. But how do quantum and classical computing compare with each other? Let's find out...

time-read
4 mins  |
December 2024
From Bits to Qubits: The Growth Story of Quantum Computing
Open Source For You

From Bits to Qubits: The Growth Story of Quantum Computing

Quantum computing may still be in the early stages of evolution, but its potential impact on everyday life is significant. We delve into the key concepts behind it, the reasons for its rapid growth, and how global advancements are shaping its future.

time-read
10+ mins  |
December 2024
Pytket: A Comprehensive Guide to Quantum Circuit Design
Open Source For You

Pytket: A Comprehensive Guide to Quantum Circuit Design

Pytket stands out as a powerful toolkit in the realm of quantum computing, offering a suite of features that cater to both researchers and industry practitioners. Its key strengths include optimisation, platform-agnostic support, flexible quantum circuit design and hybrid algorithm support. These features make Pytket a versatile tool for various quantum computing applications, from machine learning and cryptography to optimisation problems in industrial settings.

time-read
10+ mins  |
December 2024
Cirq: The Open Source Framework for Programming Quantum Computers
Open Source For You

Cirq: The Open Source Framework for Programming Quantum Computers

Explore the key features, capabilities, and impact of Cirq, an open source quantum computing framework developed by Google, on the quantum programming landscape.

time-read
4 mins  |
December 2024
The Role of Open Source in Accelerating Quantum AI
Open Source For You

The Role of Open Source in Accelerating Quantum AI

Here's an overview of how open source frameworks are being utilised to build quantum machine learning models, including quantum neural networks and quantum kernel methods. The challenges and future directions in the quantum AI landscape are also discussed.

time-read
7 mins  |
December 2024
Quantum Machine Learning: An Overview
Open Source For You

Quantum Machine Learning: An Overview

Quantum machine learning (QML) is a burgeoning field at the intersection of quantum computing and artificial intelligence. In recent years, the integration of quantum mechanics with machine learning algorithms has sparked substantial interest among researchers and technologists alike. Here's a quick look at the essentials of creating quantum algorithms for AI models, their practical use cases on open source platforms, and best practices for implementing these advanced algorithms.

time-read
7 mins  |
December 2024