AiTechWorlds
AiTechWorlds
Imagine you walk into a restaurant and order in English. The waiter writes your order in shorthand. The kitchen manager reads it and calls out instructions in kitchen jargon. The chef interprets those instructions as specific techniques and timings. The stove doesn't "understand" anything — it just responds to heat settings.
Four different "languages." One plate of food.
Your computer works the same way. When you click "Print" in a document, the application doesn't know how to talk to a printer. A Python script doesn't know how to talk to a graphics card. The browser playing your YouTube video doesn't know how to negotiate with your Wi-Fi chip.
Software is abstract. Hardware is physical. They were never meant to talk directly to each other.
What makes modern computing possible is a beautifully engineered stack of translation layers — each one converting the language of the layer above into something the layer below can understand. Understanding this stack is understanding how every device you've ever used actually works.
"If every application had to know the exact hardware specifications of every possible device it might run on, software would be impossible to write."
Consider this: there are hundreds of different printer models from dozens of manufacturers. Each one has different internal commands, memory formats, and communication protocols. If Microsoft Word had to include specific code for every printer ever made, Word would be the size of a small country.
The solution is abstraction — hide the complexity of hardware behind clean, standardized interfaces. Applications talk to the operating system. The operating system talks to drivers. Drivers talk to hardware. Each layer speaks the language of its neighbor, and nobody has to know everyone else's.
A device driver is a software program that knows how to talk to one specific piece of hardware. It sits between the operating system and the device, translating generic OS commands into the exact electrical signals and register writes that hardware understands.
Real example — pressing "Print":
Without the correct driver, the hardware is completely silent. This is why a brand-new printer sometimes won't work until you install its driver software — or why Windows Update sometimes fixes hardware that "stopped working."
Why driver updates matter:
An API (Application Programming Interface) is a set of rules and functions that lets one piece of software talk to another in a standardized way. Where drivers translate between software and hardware, APIs translate between different software layers.
Graphics APIs are the most visible example:
DirectX / Direct3D (Microsoft, Windows): the primary API games use to communicate with the GPU. When a game says "render this 3D scene," it calls DirectX functions. DirectX then talks to the GPU driver, which talks to the actual GPU hardware. DirectX 12 and DirectX 12 Ultimate are the current versions.
OpenGL (Khronos Group): a cross-platform graphics API that works on Windows, macOS, and Linux. Many professional 3D tools and older games use OpenGL.
Vulkan (Khronos Group, 2016): a modern, low-overhead API giving developers closer-to-hardware control, resulting in better performance in well-optimized games.
POSIX (IEEE standard): not graphics-related, but defines the standard API for Linux and Unix-like systems. It ensures software written for one Linux system can run on another.
APIs are why the same game can run on any NVIDIA, AMD, or Intel GPU — the game speaks DirectX, and each GPU manufacturer's driver speaks DirectX back.
Applications run in user space — a protected memory area where they have limited privileges. They cannot directly access hardware, read other programs' memory, or write to disk. This isolation is intentional — it's what keeps one buggy app from crashing your entire system.
When an application needs to do something that requires hardware access — reading a file, playing audio, sending network data — it makes a system call. A system call is a formal request to the operating system kernel, crossing the boundary from user space into kernel space.
Common system calls you've indirectly triggered millions of times:
| System Call | What It Does | Example |
|---|---|---|
open() | Open a file for reading/writing | Opening a Word document |
read() | Read data from a file or device | Loading an image from disk |
write() | Write data to a file or device | Saving your work |
send() | Send data over a network | Submitting a web form |
malloc() | Request more RAM from the OS | App loading a large dataset |
The user space / kernel space boundary is one of computing's most important safety innovations. It means a crashed application cannot corrupt the operating system.
Here's a challenge: the CPU processes billions of instructions per second. Your keyboard might send a signal once every few seconds when you type. How does the CPU know when to pay attention to the keyboard?
The answer is interrupts — a hardware mechanism that lets devices tap the CPU on the shoulder.
When you press a key, the keyboard controller sends an IRQ (Interrupt Request) signal to the CPU. The CPU:
From your perspective, this happens invisibly and instantly. From the CPU's perspective, it's a highly coordinated handoff that happens thousands of times per second across all devices.
Each device is assigned an IRQ number — a channel number in the interrupt table. The keyboard traditionally uses IRQ 1, the system timer uses IRQ 0, and so on. Modern systems use more flexible interrupt routing, but the concept is the same.
Even after drivers, APIs, and system calls have done their work, the final step is the physical connection — the actual bus or wire that carries the signal to hardware. Different devices use different buses optimized for their needs.
| Bus / Protocol | Primary Use | Speed | Notes |
|---|---|---|---|
| PCIe 4.0 | GPU, NVMe SSD | ~64 GB/s (x16) | High-bandwidth for graphics and fast storage |
| PCIe 5.0 | GPU, latest NVMe | ~128 GB/s (x16) | Current high-end standard (2023+) |
| SATA III | HDDs, SATA SSDs | 600 MB/s | Slower, but still common for storage |
| USB 3.2 Gen 2 | External drives, peripherals | 10 Gbps | Universal external connection |
| USB4 / Thunderbolt 4 | High-speed peripherals, displays | 40 Gbps | Used in premium laptops |
| Bluetooth 5.3 | Wireless peripherals | ~2 Mbps | Short-range wireless |
| WiFi 6 (802.11ax) | Wireless networking | Up to 9.6 Gbps | Current mainstream WiFi standard |
The PCIe (Peripheral Component Interconnect Express) bus is why a gaming GPU can transfer enormous amounts of data to the CPU without bottlenecking — it uses multiple parallel "lanes" for simultaneous data transfer.
| Layer | What It Does | Example | Visible to User? |
|---|---|---|---|
| User Application | What you see and use | Microsoft Word, Chrome | Yes — this is the UI |
| System Libraries / APIs | Standardized software interfaces | DirectX, Win32 API, OpenGL | Rarely (maybe in settings) |
| OS Kernel | Manages all hardware resources | Windows NT Kernel, Linux kernel | Not directly |
| Device Drivers | Hardware-specific translators | NVIDIA GPU Driver, Realtek audio | Only when they fail |
| Hardware | Physical components | GPU, CPU, NIC, storage | Yes — physical parts |
Let's revisit our restaurant now that we understand all the layers:
Remove any one layer, and the food never arrives.
Get this course's notes on Telegram!
Free cheat sheets, summaries & practice exercises