Chapter 1 · Operating Systems: Structure and Services
1.6System Calls
How programs ask the operating system to do hardware work for them, and the four main types of system calls.
Written and checked by Muhammad Raheel(opens in a new tab)
Full Stack Developer · AI Engineer · Reviewed 6 Oct 2026 · 2 min read
On this page
Your apps cannot touch the hard drive, the screen or the keyboard by themselves. They must ask the operating system for help. This request is called a system call. In this topic, you will learn what a system call is, why it is needed, and the four main types.
Think of a system call as a bridge. On one side are user programs, like a text editor or a music player. On the other side is the kernel, the core of the OS that controls the hardware. A program crosses this bridge to use the hardware and the main OS functions in a safe way.
Why not let programs control the hardware directly? Because that would be unsafe and complex. A small mistake in one app could harm the whole computer. Also, every app would need to know how every printer or disk works. With system calls, the kernel does this risky work, and programs only ask.
A system call is a round trip with four steps:
- The program sends a request to the kernel.
- The kernel controls the hardware safely.
- The hardware does the job and responds.
- The kernel returns the result to the program.
Types of System Calls
The book lists four main types of system calls:
| System call | What it does | Example |
|---|---|---|
| open | Opens a file for reading or writing. | Opening a music file to play. |
| read | Retrieves data from a file or input device. | Reading text from a document. |
| write | Sends data to a file or output device. | Saving an image to the computer. |
| fork | Creates a new process by duplicating an existing one. | Opening a new browser tab, where the OS may use fork to create another process. |
"Retrieves" means gets back. "Duplicating" means making a copy. So fork makes a copy of a running process to start a new one.
Practice this topic
Short questions
1.Define a system call.2 marks
Answer
From the book: "A system call is a request made by a program to the operating system to perform a specific task that the program cannot do directly. They act as a bridge between user programs and the kernel, allowing applications to access hardware and core OS functions safely."
2.Why do we need system calls?3 marks
Answer
Without system calls, programs that directly control hardware can be unsafe and complex. System calls act as a bridge between user programs and the kernel, allowing applications to access hardware and core OS functions safely.
3.Give one real-world example of a system call, based on the book.2 marks
Answer
When you save a file in a text editor, the program uses a system call to tell the operating system to write the data to the storage drive(like a Hard drive).
4.List the main types of system calls given in the book, with a one-line description of each.4 marks
Answer
- "open Opens a file for reading or writing."
- "read Retrieves data from a file or input device."
- "write Sends data to a file or output device."
- "fork Creates a new process by duplicating an existing one."
5.Give the book's example for the `fork` system call.2 marks
Answer
Opening a new browser tab, where the OS may use fork to create another process.
6.Compare the number of system calls in Linux/macOS and Windows.2 marks
Answer
Linux and macOS have a few hundred system calls, while Windows uses nearly 2,000. These calls handle everything from opening files to running apps and showing graphics in the background while you work.
Long questions
1.Describe system calls, their purpose, and give examples of at least three types.8 marks
Answer
Cover three parts with the book's text (topic 1.6, page 12):
-
Definition and purpose (verbatim): "A system call is a request made by a program to the operating system to perform a specific task that the program cannot do directly. They act as a bridge between user programs and the kernel, allowing applications to access hardware and core OS functions safely. Without system calls, programs that directly control hardware can be unsafe and complex."
-
Example (verbatim): "When you save a file in a text editor, the program uses a system call to tell the operating system to write the data to the storage drive(like a Hard drive)."
-
At least three types (verbatim):
- open Opens a file for reading or writing. Example: Opening a music file to play.
- read Retrieves data from a file or input device. Example: Reading text from a document.
- write Sends data to a file or output device. Example: Saving an image to the computer.
- fork Creates a new process by duplicating an existing one. Example: Opening a new browser tab, where the OS may use fork to create another process.
Aim for 200-300 words.
-
2.Define a system call. Explain why system calls are necessary between user programs and the kernel. Include the book's text-editor save example and the DO YOU KNOW facts about how many system calls operating systems have.8 marks
Answer
Cover three parts:
-
Definition (verbatim): "A system call is a request made by a program to the operating system to perform a specific task that the program cannot do directly. They act as a bridge between user programs and the kernel, allowing applications to access hardware and core OS functions safely."
-
Why they are necessary (verbatim): "Without system calls, programs that directly control hardware can be unsafe and complex."
-
Text editor example (verbatim): "When you save a file in a text editor, the program uses a system call to tell the operating system to write the data to the storage drive(like a Hard drive)."
-
DO YOU KNOW (verbatim): "Linux and macOS have a few hundred system calls, while Windows uses nearly 2,000. These calls handle everything from opening files to running apps and showing graphics in the background while you work."
Aim for 200-300 words.
-