Skip to main content

Posts

Showing posts from March, 2026

What Is a System Call? How Applications Talk to the OS

Every time you open a file, access the internet, allocate memory, or create a new process, something important happens behind the scenes. Your application does not directly control the hardware. It asks the operating system to do it. That request is called a system call . System calls are the controlled communication bridge between user applications and the operating system kernel. Understanding them is key to understanding how an OS really works. Why Applications Cannot Access Hardware Directly Applications run in a restricted environment. They cannot: Access physical memory directly Control the CPU scheduler Communicate with hardware devices Modify kernel memory Execute privileged instructions Related: User Mode vs Kernel Mode This restriction exists for security and stability. If every application could directly access hardware, the system would become: Unstable Vulnerable to attacks Prone to crashes The operating system protects itself by forcing applications to request services s...

What Is a Socket? The OS Gateway to Network Communication

 When two devices communicate over a network, something inside the operating system makes that communication possible. Applications do not directly talk to the internet. They talk to the operating system . And the operating system uses something called a socket . If you understand sockets, you understand how real network communication begins at the OS level. The Problem Sockets Solve Imagine a web browser trying to load a website. The browser needs to: Send a request Receive a response Identify which server to contact Ensure the data reaches the correct application But applications cannot directly control: Network cards IP routing Packet transmission Hardware-level communication That responsibility belongs to the operating system. Sockets are the interface that connects applications to the OS networking stack. What Exactly Is a Socket? A socket is a software endpoint for communication. It acts as: A communication doorway A link between application and network An abstraction over lo...