# System Calls and Drivers

> How an app asks the kernel to open a file or send data. Why apps get a lower level of trust, and how a driver lets the kernel use a device.

**Course:** [Operating Systems and Files](https://learn.benibix.com/learn/development-platforms)  
**Time:** 11 min

**After this lesson you can:**

- Explain what a system call is for
- Tell user mode from kernel mode
- Say why a bad driver can crash a computer

## How apps reach the hardware through the kernel

A system call is how a program asks the kernel to do something it may not do itself. Open a file, read it, write to it, send data over the network: each one is a system call. Linux has a few hundred of them. Saving one document can take dozens, and every one is checked first.

The chip itself enforces this. It runs code at two levels of trust, called user mode and kernel mode. Apps run in user mode, where they can only touch their own memory. The kernel runs in kernel mode, where it can touch anything. A system call is the one door between the two.

That door is checked every time. When a program asks to open a file, the kernel looks at who is asking and what the file allows. If the answer is no, the program gets an error back, not the file. That is how one user's program is kept out of another user's mail.

You rarely write a system call by hand. When Python runs print, it calls a library, and the library makes the write call for you. Every language works this way. So the same script can run on many systems, because each library knows how to ask its own kernel.

The kernel cannot know every device ever made. A device driver fills that gap. It is a small program that knows the exact signals one kind of hardware expects. The kernel asks the disk driver for a block, and the driver speaks to the disk in its own terms. A printer, a graphics card and a Wi-Fi chip each need one.

Most drivers run in kernel mode, next to the kernel, because they talk straight to the hardware. That makes them strong and risky. In July 2024, one bad update to a safety tool that runs as a driver crashed about 8.5 million Windows computers. Many would not start again until someone fixed each one by hand.

People often blame the app when the whole computer freezes or restarts. An app runs in user mode, so a crash there usually closes its own window and nothing more. The whole screen goes blue or black and the machine restarts? Look at the drivers first, then the kernel.

![Three rows. On top, three apps: a web browser, a game and a code editor. Arrows marked system calls run down into the operating system, which holds the kernel and, under it, a disk driver, a screen driver and a Wi-Fi driver. Arrows run from each driver down to its piece of hardware: the disk, the screen and the Wi-Fi chip.](https://learn.benibix.com/diagrams/dev-os-layers.svg)

### Example: Jack's photo app is told no

Jack's photo app tries to open a file in his sister Emma's folder. It makes the open call, the same as for any other file.

The kernel checks the folder, sees that it belongs to Emma, and sends back an error: permission denied. The app shows a message, and the file stays closed.

**Words in this lesson:** [System Call](https://learn.benibix.com/term/development/system-call), [User Mode and Kernel Mode](https://learn.benibix.com/term/development/user-mode-and-kernel-mode), [Device Driver](https://learn.benibix.com/term/development/device-driver)

**Question:** Why can a bad driver crash a whole computer when a bad app cannot?

**Answer:** Most drivers run in kernel mode, where a fault can stop everything. An app runs in user mode and can only harm its own memory. Most drivers run in kernel mode, next to the kernel, so a fault there can bring the whole system down.

---

Source: https://learn.benibix.com/learn/development-platforms/system-calls-and-drivers
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
