DEV Community

Aadityansha
Aadityansha

Posted on

An Interaction Between OS and Hardware: Understanding Linux Kernel

Let’s begin with a simple scenario

Suppose you have a Bluetooth USB adapter plugged into your laptop or PC’s built-in Bluetooth chip.

When you click on the connect button to pair your Bluetooth headphones, you get a message like “Connected” or “Unable to connect”…

But what happens under the hood when you press that connect button?

Let’s have a zoom into your PC ↓

When you clicked the connect button, the OS (i.e., Windows or Linux) processes this user action through a series of steps that eventually communicate with your hardware.

Your request (like “connect Bluetooth” or “open movie file”) needs to be converted into instructions that the specific hardware can understand. Remember, each hardware device uses different communication protocols — Bluetooth and your Wi-Fi card don’t “speak” the same language.

This is where the kernel comes in. The kernel is the core part of your operating system that runs with special privileges, sitting between your user-facing OS (like Windows or Ubuntu) and your hardware.

Quick Summary:
Human action → OS processes request → Kernel receives system call → Routes to appropriate driver → Hardware executes command

Understanding OS Architecture:
“ User Mode vs Kernel Mode”

Here’s an important concept: your OS operates in two different modes:

  1. User Mode — Where regular programs run. Limited privileges, can’t directly access hardware. This is where Microsoft Windows desktop, Linux desktop environments, your applications, and games operate.

  2. Kernel Mode — The core of the OS that has full hardware access. It acts as the bridge between user programs and hardware.

Think of it this way:

The OS is the entire system (kernel + user-facing tools + utilities)
The kernel is the privileged core that manages hardware and system resources


So, What Actually Does the Kernel Do?
Let’s understand with an analogy

Suppose your class teacher checked all the students’ notebooks and then distributed them back one by one. Each notebook goes to the specific student whose name is written on it.

The teacher became a distributor — ensuring the right notebook reaches the right student.

If you understand this, congratulations — you’ve grasped what the kernel does!

Back to our Bluetooth example:

When you click the connect button, your request travels through the application, gets converted into a system call, and reaches the kernel. The kernel then routes this request to the specific driver that handles Bluetooth hardware.

The kernel is essentially a smart router and distributor:

  1. Bluetooth requests → Bluetooth driver
  2. File operations → Hard disk driver
  3. Audio playback → Sound card driver
  4. And so on…

What Are Drivers?
Now you might be wondering:

“What exactly is a driver?”

I have continued this discussion in next part , Till before, pls comment your thoughts and share it with others

Thankyou

Top comments (0)